Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x320aAAB3038bc08317f5a4be19EA1D9608551d79
Balance 0 ETH
Nonce 1
Code Size 3099 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3099 bytes
0x608060405234801561001057600080fd5b50600436106100ba5760003560e01c806306fdde03146100bf578063095ea7b3146100dd57806318160ddd1461010057806323b872dd14610117578063313ce5671461012a5780633644e5151461016357806340c10f191461016b57806370a08231146101805780637ecebe00146101a057806395d89b41146101c05780639dc29fac146101c8578063a9059cbb146101db578063d505accf146101ee578063dd62ed3e14610201575b600080fd5b6100c761022c565b6040516100d49190610918565b60405180910390f35b6100f06100eb366004610982565b6102ba565b60405190151581526020016100d4565b61010960025481565b6040519081526020016100d4565b6100f06101253660046109ac565b610327565b6101517f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff90911681526020016100d4565b610109610407565b61017e610179366004610982565b610462565b005b61010961018e3660046109e8565b60036020526000908152604090205481565b6101096101ae3660046109e8565b60056020526000908152604090205481565b6100c76104b9565b61017e6101d6366004610982565b6104c6565b6100f06101e9366004610982565b610519565b61017e6101fc366004610a0a565b61057f565b61010961020f366004610a7d565b600460209081526000928352604080842090915290825290205481565b6000805461023990610ab0565b80601f016020809104026020016040519081016040528092919081815260200182805461026590610ab0565b80156102b25780601f10610287576101008083540402835291602001916102b2565b820191906000526020600020905b81548152906001019060200180831161029557829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103159086815260200190565b60405180910390a35060015b92915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103835761035e8382610b00565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103ab908490610b00565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020610bc6833981519152906103f49087815260200190565b60405180910390a3506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000001461461043d576104386107c2565b905090565b507f506e5415a48e721a0783e3dd62f5127ec3a11487ce0f0e3820a7cb1f941225d090565b336001600160a01b037f0000000000000000000000003b29c19ff2fcea0ff98d0ef5b184354d74ea74b016146104ab57604051635647fbb560e11b815260040160405180910390fd5b6104b5828261085c565b5050565b6001805461023990610ab0565b336001600160a01b037f0000000000000000000000003b29c19ff2fcea0ff98d0ef5b184354d74ea74b0161461050f57604051635647fbb560e11b815260040160405180910390fd5b6104b582826108b6565b3360009081526003602052604081208054839190839061053a908490610b00565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020610bc6833981519152906103159086815260200190565b428410156105ce5760405162461bcd60e51b815260206004820152601760248201527614115493525517d11150511312539157d1561412549151604a1b60448201526064015b60405180910390fd5b600060016105da610407565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156106e6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061071c5750876001600160a01b0316816001600160a01b0316145b6107595760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016105c5565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516107f49190610b13565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806002600082825461086e9190610bb2565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020610bc683398151915291015b60405180910390a35050565b6001600160a01b038216600090815260036020526040812080548392906108de908490610b00565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020610bc6833981519152906020016108aa565b600060208083528351808285015260005b8181101561094557858101830151858201604001528201610929565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461097d57600080fd5b919050565b6000806040838503121561099557600080fd5b61099e83610966565b946020939093013593505050565b6000806000606084860312156109c157600080fd5b6109ca84610966565b92506109d860208501610966565b9150604084013590509250925092565b6000602082840312156109fa57600080fd5b610a0382610966565b9392505050565b600080600080600080600060e0888a031215610a2557600080fd5b610a2e88610966565b9650610a3c60208901610966565b95506040880135945060608801359350608088013560ff81168114610a6057600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610a9057600080fd5b610a9983610966565b9150610aa760208401610966565b90509250929050565b600181811c90821680610ac457607f821691505b602082108103610ae457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561032157610321610aea565b600080835481600182811c915080831680610b2f57607f831692505b60208084108203610b4e57634e487b7160e01b86526022600452602486fd5b818015610b625760018114610b7757610ba4565b60ff1986168952841515850289019650610ba4565b60008a81526020902060005b86811015610b9c5781548b820152908501908301610b83565b505084890196505b509498975050505050505050565b8082018082111561032157610321610aea56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200e9e237763b087330ae63ebfd3bc2934d774bab4c059a1a2ec2474f9779e5f0864736f6c63430008110033

Verified Source Code Full Match

Compiler: v0.8.17+commit.8df45f5f EVM: london Optimization: Yes (20 runs)
PaprToken.sol 31 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";

contract PaprToken is ERC20 {
    error ControllerOnly();

    address immutable controller;

    modifier onlyController() {
        if (msg.sender != controller) {
            revert ControllerOnly();
        }
        _;
    }

    constructor(string memory name, string memory symbol)
        ERC20(string.concat("papr ", name), string.concat("papr", symbol), 18)
    {
        controller = msg.sender;
    }

    function mint(address to, uint256 amount) external onlyController {
        _mint(to, amount);
    }

    function burn(address account, uint256 amount) external onlyController {
        _burn(account, amount);
    }
}
ERC20.sol 206 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Read Contract

DOMAIN_SEPARATOR 0x3644e515 → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 6 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x9dc29fac
address account
uint256 amount
mint 0x40c10f19
address to
uint256 amount
permit 0xd505accf
address owner
address spender
uint256 value
uint256 deadline
uint8 v
bytes32 r
bytes32 s
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool

Recent Transactions

No transactions found for this address