Skip to content
Verified contractExactMIT

Frame

Address0x2b377414906a673b2bdd262a3168cde3bbf6a599
Balance

0 ETH

 

Transactions

3

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,914,352
Creation transaction
0xed0348327e…1264b5b782

frame/Frame.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

// Frame — a plain ERC-20 that trades on a Uniswap v4 pool.
//
// Named after EIP-8141, Frame Transaction:
// https://eips.ethereum.org/EIPS/eip-8141
//
// It decomposes a transaction into a list of frames — contract calls that
// separately validate it, approve who pays for it, and execute it. Validation
// and gas payment stop being fixed by the protocol and become ordinary contract
// code, so an account is no longer a keypair. It is an address with code.
//
// Native batching, sponsored fees with no relayer in the middle, key rotation
// without moving your assets, and an off-ramp from the elliptic curve toward
// post-quantum signatures all fall out of that single change.
//
// Nothing in this token requires it, and nothing here breaks if it never
// arrives. No live EVM implements those opcodes, so a contract emitting one
// today would hit an undefined instruction and halt on the spot. {FrameHook} is
// built accordingly: correct under ordinary transactions, able to recognise a
// frame transaction at runtime if one ever reaches it, and correct under both.
// Forward-compatible, not forward-dependent.
//
// One billion units, minted once in the constructor and never again. No mint
// after that, no transfer tax, no reflection, no rebase, no blacklist, no max
// wallet, no cooldown, no pause. Sending Frame between two wallets is an
// ordinary ERC-20 transfer and costs what one costs.
//
// The fee people will ask about lives in {FrameHook}, on the pool, charged in
// ETH. It is a property of trading, not of holding.
//
// Before {openTrading} only the launcher can send, so the pool can be filled
// without anyone trading against it while it is being filled. That call is
// one-way and deletes the launcher role in the same transaction. Afterwards
// there is no privileged address in this file at all: no owner, no admin, and
// nothing to renounce because nothing is left.
//
// Nobody is affiliated with this token. The EIP authors have no involvement in
// it, have not approved it, and have not been asked. A link to a specification
// is a citation, not an endorsement.

contract Frame {
    string public constant name = "Frame";
    string public constant symbol = "FRAME";
    uint8 public constant decimals = 18;

    uint256 public constant SUPPLY = 1_000_000_000 ether;

    uint256 public totalSupply;
    uint256 public totalBurned;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    /// @notice May send before {openTrading}. Deleted by it.
    address public launcher;
    /// @notice One-way. False until {openTrading}, and never false again.
    bool public open;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Burned(address indexed who, uint256 value, uint256 supplyAfter);
    event Opened(uint64 at);

    error ZeroAddress();
    error NotLauncher();
    error NotOpen();
    error InsufficientBalance();
    error InsufficientAllowance();
    error AlreadyOpen();

    constructor(address _launcher) {
        if (_launcher == address(0)) revert ZeroAddress();
        launcher = _launcher;
        totalSupply = SUPPLY;
        balanceOf[_launcher] = SUPPLY;
        emit Transfer(address(0), _launcher, SUPPLY);
    }

    /// @notice Open trading for good, and delete the launcher role in the same call.
    function openTrading() external {
        if (msg.sender != launcher) revert NotLauncher();
        if (open) revert AlreadyOpen();
        open = true;
        launcher = address(0);
        emit Opened(uint64(block.timestamp));
    }

    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 a = allowance[from][msg.sender];
        if (a != type(uint256).max) {
            if (a < value) revert InsufficientAllowance();
            unchecked { allowance[from][msg.sender] = a - value; }
        }
        _move(from, to, value);
        return true;
    }

    function _move(address from, address to, uint256 value) private {
        if (!open && from != launcher) revert NotOpen();
        if (to == address(0)) revert ZeroAddress();
        uint256 b = balanceOf[from];
        if (b < value) revert InsufficientBalance();
        unchecked {
            balanceOf[from] = b - value;
            balanceOf[to] += value;
        }
        emit Transfer(from, to, value);
    }

    /// @notice Destroy your own units. Permissionless, and irreversible.
    function burn(uint256 value) external {
        uint256 b = balanceOf[msg.sender];
        if (b < value) revert InsufficientBalance();
        unchecked {
            balanceOf[msg.sender] = b - value;
            totalSupply -= value;
            totalBurned += value;
        }
        emit Transfer(msg.sender, address(0), value);
        emit Burned(msg.sender, value, totalSupply);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.