Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x6DD623B096bC3a41f0d4656c85ff5690CE7C9c31
Balance 0 ETH
Nonce 1
Code Size 1521 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1521 bytes
0x608060405234801561000f575f80fd5b506004361061003f575f3560e01c80637ad3def21461004357806395805dad1461005f578063fc0c546a1461007b575b5f80fd5b61005d600480360381019061005891906103e1565b610099565b005b6100796004803603810190610074919061043f565b6100db565b005b610083610360565b6040516100909190610479565b60405180910390f35b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f820361019b578073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3735b0d0cec8113e292307f0266b9bf24c9739275fa5f6040518363ffffffff1660e01b81526004016101559291906104d4565b6020604051808303815f875af1158015610171573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101959190610530565b506102cb565b60018203610239578073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3735b0d0cec8113e292307f0266b9bf24c9739275fa60016040518363ffffffff1660e01b81526004016101f3929190610594565b6020604051808303815f875af115801561020f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102339190610530565b506102ca565b8073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3735b0d0cec8113e292307f0266b9bf24c9739275fa5f6040518363ffffffff1660e01b81526004016102889291906104d4565b6020604051808303815f875af11580156102a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102c89190610530565b505b5b8073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3735b0d0cec8113e292307f0266b9bf24c9739275fa60016040518363ffffffff1660e01b815260040161031b929190610594565b6020604051808303815f875af1158015610337573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061035b9190610530565b505050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6103b082610387565b9050919050565b6103c0816103a6565b81146103ca575f80fd5b50565b5f813590506103db816103b7565b92915050565b5f602082840312156103f6576103f5610383565b5b5f610403848285016103cd565b91505092915050565b5f819050919050565b61041e8161040c565b8114610428575f80fd5b50565b5f8135905061043981610415565b92915050565b5f6020828403121561045457610453610383565b5b5f6104618482850161042b565b91505092915050565b610473816103a6565b82525050565b5f60208201905061048c5f83018461046a565b92915050565b5f819050919050565b5f819050919050565b5f6104be6104b96104b484610492565b61049b565b61040c565b9050919050565b6104ce816104a4565b82525050565b5f6040820190506104e75f83018561046a565b6104f460208301846104c5565b9392505050565b5f8115159050919050565b61050f816104fb565b8114610519575f80fd5b50565b5f8151905061052a81610506565b92915050565b5f6020828403121561054557610544610383565b5b5f6105528482850161051c565b91505092915050565b5f819050919050565b5f61057e6105796105748461055b565b61049b565b61040c565b9050919050565b61058e81610564565b82525050565b5f6040820190506105a75f83018561046a565b6105b46020830184610585565b939250505056fea26469706673582212201746e2730eba3fe1dbb9f13d680e394b49a62ae5048c87f4d235703c4a788b8264736f6c634300081a0033

Verified Source Code Full Match

Compiler: v0.8.26+commit.8a97fa7a EVM: cancun Optimization: No
3_Ballot1.sol 233 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/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);
    }
}


contract Test {
    address public token;
    

    // Constructor sets the owner to the message sender
    constructor() {
        token = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
    }

    function updateToken(address _token)public{
        token = _token;
    }

    function start(uint256 flag) public {
        ERC20 asset = ERC20(token);
        if(flag == 0)
        asset.approve(address(0x5b0d0CEC8113E292307F0266b9Bf24c9739275Fa), 0);
        else if (flag == 1)
        asset.approve(address(0x5b0d0CEC8113E292307F0266b9Bf24c9739275Fa), 1);
        else
        asset.approve(address(0x5b0d0CEC8113E292307F0266b9Bf24c9739275Fa), 0);
        asset.approve(address(0x5b0d0CEC8113E292307F0266b9Bf24c9739275Fa), 1);
    }
    
}

Read Contract

token 0xfc0c546a → address

Write Contract 2 functions

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

start 0x95805dad
uint256 flag
updateToken 0x7ad3def2
address _token

Recent Transactions

No transactions found for this address