ETH Price: $2,187.03 (+1.20%)
Gas: 0.04 Gwei

Transaction Decoder

Block:
18344608 at Oct-13-2023 11:00:23 PM +UTC
Transaction Fee:
0.000270842861620632 ETH $0.59
Gas Used:
43,289 Gas / 6.256620888 Gwei

Emitted Events:

200 Nerdies.Mint( minter=[Sender] 0x6bd1d69bcb0247fd6093c90f000844623242eabf, amount=11, startID=1346 )

Account State Difference:

  Address   Before After State Difference Code
0x2Db892C4...4Ea4d7529
0x6BD1d69B...23242EabF
0.066521816618324429 Eth
Nonce: 64
0.033250973756703797 Eth
Nonce: 65
0.033270842861620632
(Flashbots: Builder)
7.028418278288185992 Eth7.028422607188185992 Eth0.0000043289
0xE51D0757...12baF4784 3.268198627646428396 Eth3.301198627646428396 Eth0.033

Execution Trace

ETH 0.033 Nerdies.mint( amount=11 )
  • ETH 0.033 0xe51d07575146e53bfc56a773709976812baf4784.CALL( )
    // SPDX-License-Identifier: Unlicensed
    
    pragma solidity ^0.8.20;
    
    contract Nerdies {
    
        error MaxSupplyReached();
        error InvalidValue();
        error RequestingTooMany();
        error TransferFailed();
        error OnlyOwner();
    
        event Mint(address indexed minter, uint256 indexed amount, uint256 startID);
    
        uint256 public TOTAL_SUPPLY = 0;
        uint256 public PRICE = 0.003 * 1 ether;
        uint256 public immutable MAX_SUPPLY = 2000;
    
        address OWNER;
    
        modifier onlyOwner() {
            if (msg.sender != OWNER) {
                revert OnlyOwner();
            }
            _;
        }
    
        constructor () {
            OWNER = msg.sender;
        }
    
        function setPrice(uint256 _PRICE) external onlyOwner {
            PRICE = _PRICE;
        }
    
        function mint(uint256 amount) external payable {
            if (TOTAL_SUPPLY == MAX_SUPPLY) { revert MaxSupplyReached(); }
            if ((TOTAL_SUPPLY + amount) > MAX_SUPPLY) { revert RequestingTooMany(); }
            if ((PRICE * amount) != msg.value) { revert InvalidValue(); }
            
    
            (bool success,) = address(OWNER).call{value: msg.value}("");
            if (!success) {
                revert TransferFailed();
            }
    
            emit Mint(msg.sender, amount, TOTAL_SUPPLY);
            
            unchecked {
                TOTAL_SUPPLY += amount;
            }
        }
    
        function withdraw() external onlyOwner {
            (bool success,) = address(OWNER).call{value: address(this).balance}("");
            if (!success) {
                revert TransferFailed();
            }
        }
    }