ETH Price: $2,078.96 (-0.99%)

Transaction Decoder

Block:
20498391 at Aug-10-2024 01:05:11 PM +UTC
Transaction Fee:
0.000063670136959686 ETH $0.13
Gas Used:
45,699 Gas / 1.393250114 Gwei

Account State Difference:

  Address   Before After State Difference Code
0x82A53178...338418F74
0.905235003448321804 Eth
Nonce: 36515
0.905171333311362118 Eth
Nonce: 36516
0.000063670136959686
(beaverbuild)
6.62999100901418969 Eth6.62999679720885758 Eth0.00000578819466789
0xE73d53e3...B256Cc243

Execution Trace

0xb7d5f2bbb6c7c5b3bcace5f4ebc67e805133dca5.CALL( )
  • N.CALL( )
    pragma solidity ^0.8.0;
    
    /*
    
    Some say the world will end in fire,
    Some say in ice.
    From what I’ve tasted of desire
    I hold with those who favor fire.
    But if it had to perish twice,
    I think I know enough of hate
    To say that for destruction ice
    Is also great
    And would suffice.
    
    The following is a simple contract for a token, "N", with a bound supply curve.
    Every block a new token is made available for minting.
    Every 4 years a "doubling" occurs, wherein the number of blocks passed required to mint a new token doubles.
    Following this schedule, in roughly 92 years it will take 4 years to mint a single token, at which point the supply will be roughly ~21,000,000.
    The supply is technically uncapped, but after 92 years no more than a handful of tokens could ever be minted before the heat death of the universe.
    
    Alea iacta est
    
    */
    
    contract N {
        string public name = "N";
        string public symbol = "N";
        uint8 public decimals = 18;
        uint256 public totalSupply;
        uint8 public epoch = 0;
        uint256 public lastDoublingBlock;
        uint256 public nextDoublingBlock;
        uint256 public lastMintingBlock;
        
    
        mapping(address => uint256) public balanceOf;
        mapping(address => mapping(address => uint256)) public allowance;
    
        event Transfer(address indexed from, address indexed to, uint256 value);
        event Approval(address indexed owner, address indexed spender, uint256 value);
    
        constructor() {
            totalSupply = 1e18;
            balanceOf[msg.sender] = totalSupply;
            emit Transfer(address(0), msg.sender, totalSupply);
            lastDoublingBlock = block.number;
            nextDoublingBlock = block.number + 10519200; //((86400*365*4)+86400)/12 (4 years and one day of blocks, with leap day)
            lastMintingBlock = block.number;
        }
    
        function transfer(address _to, uint256 _value) public returns (bool success) {
            require(balanceOf[msg.sender] >= _value, "Insufficient balance");
            balanceOf[msg.sender] -= _value;
            balanceOf[_to] += _value;
            emit Transfer(msg.sender, _to, _value);
            return true;
        }
    
        function approve(address _spender, uint256 _value) public returns (bool success) {
            allowance[msg.sender][_spender] = _value;
            emit Approval(msg.sender, _spender, _value);
            return true;
        }
    
        function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
            require(_value <= balanceOf[_from], "Insufficient balance");
            require(_value <= allowance[_from][msg.sender], "Insufficient allowance");
            balanceOf[_from] -= _value;
            balanceOf[_to] += _value;
            allowance[_from][msg.sender] -= _value;
            emit Transfer(_from, _to, _value);
            return true;
        }
    
        function mint() public {
            uint256 numberToMint = mintable();
            totalSupply+= numberToMint;
            balanceOf[msg.sender]+= numberToMint;
            if(block.number >= nextDoublingBlock) {
                lastDoublingBlock = block.number;
                lastMintingBlock = block.number;
                nextDoublingBlock = block.number + 10519200;
                epoch++;
            }
        }
    
        function mintable() internal returns (uint256 numberToMint) {
            uint256 blocksBetweenMints = block.number-lastMintingBlock;
            if(blocksBetweenMints >= 2**epoch) {
                numberToMint = (blocksBetweenMints/(2**epoch))*1e18;
                lastMintingBlock = block.number - (blocksBetweenMints % (2**epoch));
                return (numberToMint);
            } else revert();
        }
    }