GmeToken

0x5223248fe19297a09833edc0098a4760daae4de2

Verification
Verified
v0.8.30+commit.73712a01
Type
Contract
4,461 bytes
ABI entries
40
13 read · 12 write
License
none

Contract information

Address
0x5223248fe19297a09833edc0098a4760daae4de2
Chain
Robinhood Chain (4663)
Compiler
v0.8.30+commit.73712a01
Optimization
Enabled
Creation tx
0x239e7d4f17…f0e44ed83e

Token

Name
GME
Symbol
GME
Decimals
18
Holders
80

Read contract (13)

allowance(address, address)uint256
balanceOf(address)uint256
decimals()uint8
limitExempt(address)bool
maxTxAmount()uint256
name()string
sidelined(address)bool
steward()address
symbol()string
totalSupply()uint256
vault()address
walletCap()uint256
workGas()uint256

Events (9)

ApprovalLimitExemptSetLimitsSetSidelinedStewardPassedSyncFailedTransferVaultSetWorkGasSet

ABI

[
  {
    "inputs": [
      {
        "internalType": "string",
        "name": "name_",
        "type": "string"
      },
      {
        "internalType": "string",
        "name": "symbol_",
        "type": "string"
      },
      {
        "internalType": "uint256",
        "name": "supply_",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "poolManager_",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "BadConfig",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "MaxTxExceeded",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "NotAuthorized",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "WalletCapExceeded",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "ZeroAddress",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "state",
        "type": "bool"
      }
    ],
    "name": "LimitExemptSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "maxTx",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "maxWallet",
        "type": "uint256"
      }
    ],
    "name": "LimitsSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "state",
        "type": "bool"
      }
    ],
    "name": "Sidelined",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "next",
        "type": "address"
      }
    ],
    "name": "StewardPassed",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "holder",
        "type": "address"
      }
    ],
    "name": "SyncFailed",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Transfer",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "vault",
        "type": "address"
      }
    ],
    "name": "VaultSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "workGas",
        "type": "uint256"
      }
    ],
    "name": "WorkGasSet",
    "type": "event"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "allowance",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "approve",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "a",
        "type": "address"
      }
    ],
    "name": "balanceOf",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "decimals",
    "outputs": [
      {
        "internalType": "uint8",
        "name": "",
        "type": "uint8"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "liftLimits",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "limitExempt",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxTxAmount",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "name",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "next",
        "type": "address"
      }
    ],
    "name": "passStewardship",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "poke",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "state",
        "type": "bool"
      }
    ],
    "name": "setLimitExempt",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "maxTx",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "maxWallet",
        "type": "uint256"
      }
    ],
    "name": "setLimits",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "v",
        "type": "address"
      }
    ],
    "name": "setVault",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "g",
        "type": "uint256"
      }
    ],
    "name": "setWorkGas",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "state",
        "type": "bool"
      }
    ],
    "name": "sideline",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "sidelined",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "steward",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "symbol",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "who",
        "type": "address"
      }
    ],
    "name": "syncHolder",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "totalSupply",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transferFrom",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "vault",
    "outputs": [
      {
        "internalType": "contract IVault",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "walletCap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "workGas",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

/*

    GME  ·  The sequel is onchain   (Uniswap V4 edition)

    Website: https://gmeonchain.com
    X:       https://x.com/GMEONCHAIN

    No tax lives in this token. The sell fee (paid in real GME) is taken by the
    V4 hook inside the swap. This contract only mirrors holder balances into the
    rewards vault so conviction (time-held) can be tracked for the diamond split.

*/

interface IVault {
    function sync(address holder, uint256 newBalance) external;
    function work(uint256 gasBudget) external;
}

contract GmeToken {
    error NotAuthorized();
    error ZeroAddress();
    error MaxTxExceeded();
    error WalletCapExceeded();
    error BadConfig();

    string public name;
    string public symbol;
    uint8 public constant decimals = 18;
    uint256 public immutable totalSupply;

    mapping(address => uint256) private _bal;
    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);

    address public steward;
    IVault public vault;

    /// Addresses excluded from rewards: the V4 PoolManager (holds all pooled
    /// liquidity), routers, the vault, the burn hole, and this contract.
    mapping(address => bool) public sidelined;
    /// Exempt from the per-tx cap (the deployer's LP seed, the vault). Deliberately
    /// NOT the PoolManager — so ordinary buys/sells stay subject to the cap.
    mapping(address => bool) public limitExempt;
    uint256 public maxTxAmount;
    uint256 public walletCap;
    uint256 public workGas = 450_000;

    event Sidelined(address indexed account, bool state);
    event StewardPassed(address indexed next);
    event VaultSet(address indexed vault);
    event SyncFailed(address indexed holder);
    event WorkGasSet(uint256 workGas);
    event LimitsSet(uint256 maxTx, uint256 maxWallet);
    event LimitExemptSet(address indexed account, bool state);

    modifier onlySteward() {
        if (msg.sender != steward) revert NotAuthorized();
        _;
    }

    /// @param name_         token name ("GME" for the real launch; a throwaway for probes)
    /// @param symbol_       token symbol
    /// @param supply_       total supply, all minted to the deployer for the LP seed
    /// @param poolManager_  the canonical V4 PoolManager (sidelined: it is the pool, not a holder)
    constructor(string memory name_, string memory symbol_, uint256 supply_, address poolManager_) {
        if (poolManager_ == address(0)) revert ZeroAddress();
        name = name_;
        symbol = symbol_;
        totalSupply = supply_;
        steward = msg.sender;

        _bal[msg.sender] = supply_;
        emit Transfer(address(0), msg.sender, supply_);

        sidelined[msg.sender] = true; // deployer holds pre-launch, seeds LP; not a rewards holder
        sidelined[address(this)] = true;
        sidelined[address(0xdead)] = true;
        sidelined[poolManager_] = true;

        // 2% anti-whale limits (max tx + max wallet). The deployer is cap-exempt so it
        // can seed 100% of supply into the LP; the PoolManager is intentionally NOT, so
        // buys/sells (which always face the PoolManager) stay capped.
        maxTxAmount = supply_ / 50;
        walletCap = supply_ / 50;
        limitExempt[msg.sender] = true;
        limitExempt[address(this)] = true;
        limitExempt[address(0xdead)] = true;
    }

    function balanceOf(address a) public view returns (uint256) {
        return _bal[a];
    }

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _move(msg.sender, to, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        uint256 granted = allowance[from][msg.sender];
        if (granted != type(uint256).max) {
            allowance[from][msg.sender] = granted - value;
        }
        _move(from, to, value);
        return true;
    }

    function _move(address from, address to, uint256 value) internal {
        if (to == address(0)) revert ZeroAddress();

        if (maxTxAmount != 0 && !limitExempt[from] && !limitExempt[to] && value > maxTxAmount) {
            revert MaxTxExceeded();
        }

        _bal[from] -= value;
        _bal[to] += value;
        emit Transfer(from, to, value);

        if (walletCap != 0 && !sidelined[to] && _bal[to] > walletCap) revert WalletCapExceeded();

        IVault v = vault;
        if (address(v) != address(0)) {
            if (_rewardEligible(from)) try v.sync(from, _bal[from]) {} catch { emit SyncFailed(from); }
            if (_rewardEligible(to)) try v.sync(to, _bal[to]) {} catch { emit SyncFailed(to); }
        }
    }

    /// @notice Permissionlessly re-sync a holder's true balance into the vault.
    /// Heals a stale record from a failed sync and registers dormant holders
    /// (buyers whose tokens arrived via the pool and never moved again).
    function syncHolder(address who) external {
        IVault v = vault;
        if (address(v) != address(0) && _rewardEligible(who)) v.sync(who, _bal[who]);
    }

    function _rewardEligible(address a) internal view returns (bool) {
        return a != address(0) && !sidelined[a];
    }

    function setVault(address v) external onlySteward {
        if (v == address(0)) revert ZeroAddress();
        vault = IVault(v);
        sidelined[v] = true;
        limitExempt[v] = true;
        emit VaultSet(v);
    }

    /// @notice Sideline exempts an account from rewards, so it must push the change
    /// into the vault (zero on sideline, restore on un-sideline) or the vault would
    /// keep paying a frozen balance. Use to exclude routers / the position manager.
    function sideline(address account, bool state) external onlySteward {
        sidelined[account] = state;
        emit Sidelined(account, state);
        IVault v = vault;
        if (address(v) != address(0)) {
            if (state) {
                try v.sync(account, 0) {} catch { emit SyncFailed(account); }
            } else if (_rewardEligible(account)) {
                try v.sync(account, _bal[account]) {} catch { emit SyncFailed(account); }
            }
        }
    }

    /// @notice Anyone can spend their own gas to run a distribution pass (extra
    /// keeperless fuel on top of the hook's per-swap trigger).
    function poke() external {
        IVault v = vault;
        if (address(v) != address(0)) try v.work{gas: workGas}(workGas) {} catch {}
    }

    function setWorkGas(uint256 g) external onlySteward {
        require(g <= 2_000_000, "gas cap");
        workGas = g;
        emit WorkGasSet(g);
    }

    /// @notice Adjust the anti-whale limits. 0 disables a cap; a non-zero cap cannot be
    /// set below 0.1% of supply, so it can never become a honeypot. Use liftLimits to
    /// remove both entirely once the launch has matured.
    function setLimits(uint256 maxTx, uint256 maxWallet) external onlySteward {
        uint256 floorLimit = totalSupply / 1000;
        if (maxTx != 0 && maxTx < floorLimit) revert BadConfig();
        if (maxWallet != 0 && maxWallet < floorLimit) revert BadConfig();
        maxTxAmount = maxTx;
        walletCap = maxWallet;
        emit LimitsSet(maxTx, maxWallet);
    }

    function liftLimits() external onlySteward {
        maxTxAmount = 0;
        walletCap = 0;
        emit LimitsSet(0, 0);
    }

    function setLimitExempt(address account, bool state) external onlySteward {
        limitExempt[account] = state;
        emit LimitExemptSet(account, state);
    }

    function passStewardship(address next) external onlySteward {
        if (next == address(0)) revert ZeroAddress();
        steward = next;
        emit StewardPassed(next);
    }
}
Chain explorer2869msChain node88ms