Contract Address Details

0x5FA712069F62c62eA73a7F8e2A4bdec11c2BfeF7

Contract Name
Multicall
Creator
0x32c2b2–e25fd3 at 0xd320e5–cb0a46
Balance
0 ASTR ( )
Tokens
Fetching tokens...
Transactions
2 Transactions
Transfers
0 Transfers
Gas Used
494,944
Last Balance Update
2813728
Contract name:
Multicall




Optimization enabled
false
Compiler version
v0.8.3+commit.8d00100c




EVM Version
default




Verified at
2022-02-14T16:23:14.613620Z

Contract source code

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.5.0;
pragma experimental ABIEncoderV2;

/// @title Multicall - Aggregate results from multiple read-only function calls
/// @author Michael Elliot <[email protected]>
/// @author Joshua Levine <[email protected]>
/// @author Nick Johnson <[email protected]>

contract Multicall {
    struct Call {
        address target;
        bytes callData;
    }

    function aggregate(Call[] memory calls) public returns (uint256 blockNumber, bytes[] memory returnData) {
        blockNumber = block.number;
        returnData = new bytes[](calls.length);
        for (uint256 i = 0; i < calls.length; i++) {
            (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData);
            require(success);
            returnData[i] = ret;
        }
    }

    // Helper functions
    function getEthBalance(address addr) public view returns (uint256 balance) {
        balance = addr.balance;
    }

    function getBlockHash(uint256 blockNumber) public view returns (bytes32 blockHash) {
        blockHash = blockhash(blockNumber);
    }

    function getLastBlockHash() public view returns (bytes32 blockHash) {
        blockHash = blockhash(block.number - 1);
    }

    function getCurrentBlockTimestamp() public view returns (uint256 timestamp) {
        timestamp = block.timestamp;
    }

    function getCurrentBlockDifficulty() public view returns (uint256 difficulty) {
        difficulty = block.difficulty;
    }

    function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) {
        gaslimit = block.gaslimit;
    }

    function getCurrentBlockCoinbase() public view returns (address coinbase) {
        coinbase = block.coinbase;
    }
}
        

Contract ABI

[{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"},{"type":"bytes[]","name":"returnData","internalType":"bytes[]"}],"name":"aggregate","inputs":[{"type":"tuple[]","name":"calls","internalType":"struct Multicall.Call[]","components":[{"type":"address","name":"target","internalType":"address"},{"type":"bytes","name":"callData","internalType":"bytes"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"blockHash","internalType":"bytes32"}],"name":"getBlockHash","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"coinbase","internalType":"address"}],"name":"getCurrentBlockCoinbase","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"difficulty","internalType":"uint256"}],"name":"getCurrentBlockDifficulty","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"gaslimit","internalType":"uint256"}],"name":"getCurrentBlockGasLimit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"timestamp","internalType":"uint256"}],"name":"getCurrentBlockTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"balance","internalType":"uint256"}],"name":"getEthBalance","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"blockHash","internalType":"bytes32"}],"name":"getLastBlockHash","inputs":[]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b50610ab3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d1461012a57806386d516e814610148578063a8b0574e14610166578063ee82ac5e1461018457610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100dc5780634d2301cc146100fa575b600080fd5b6100956101b4565b6040516100a2919061077d565b60405180910390f35b6100c560048036038101906100c091906105a6565b6101bc565b6040516100d3929190610798565b60405180910390f35b6100e46103a7565b6040516100f19190610762565b60405180910390f35b610114600480360381019061010f919061057d565b6103bc565b604051610121919061077d565b60405180910390f35b6101326103dd565b60405161013f919061077d565b60405180910390f35b6101506103e5565b60405161015d919061077d565b60405180910390f35b61016e6103ed565b60405161017b9190610747565b60405180910390f35b61019e600480360381019061019991906105e7565b6103f5565b6040516101ab9190610762565b60405180910390f35b600042905090565b60006060439150825167ffffffffffffffff811115610204577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561023757816020015b60608152602001906001900390816102225790505b50905060005b83518110156103a157600080858381518110610282577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106102dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151602001516040516102f69190610730565b6000604051808303816000865af19150503d8060008114610333576040519150601f19603f3d011682016040523d82523d6000602084013e610338565b606091505b50915091508161034757600080fd5b80848481518110610381577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052505050808061039990610997565b91505061023d565b50915091565b60006001436103b691906108aa565b40905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b600045905090565b600041905090565b600081409050919050565b600061041361040e846107ed565b6107c8565b9050808382526020820190508260005b8581101561045357813585016104398882610504565b845260208401935060208301925050600181019050610423565b5050509392505050565b600061047061046b84610819565b6107c8565b90508281526020810184848401111561048857600080fd5b610493848285610924565b509392505050565b6000813590506104aa81610a4f565b92915050565b600082601f8301126104c157600080fd5b81356104d1848260208601610400565b91505092915050565b600082601f8301126104eb57600080fd5b81356104fb84826020860161045d565b91505092915050565b60006040828403121561051657600080fd5b61052060406107c8565b905060006105308482850161049b565b600083015250602082013567ffffffffffffffff81111561055057600080fd5b61055c848285016104da565b60208301525092915050565b60008135905061057781610a66565b92915050565b60006020828403121561058f57600080fd5b600061059d8482850161049b565b91505092915050565b6000602082840312156105b857600080fd5b600082013567ffffffffffffffff8111156105d257600080fd5b6105de848285016104b0565b91505092915050565b6000602082840312156105f957600080fd5b600061060784828501610568565b91505092915050565b600061061c83836106b7565b905092915050565b61062d816108de565b82525050565b600061063e8261085a565b610648818561087d565b93508360208202850161065a8561084a565b8060005b8581101561069657848403895281516106778582610610565b945061068283610870565b925060208a0199505060018101905061065e565b50829750879550505050505092915050565b6106b1816108f0565b82525050565b60006106c282610865565b6106cc818561088e565b93506106dc818560208601610933565b6106e581610a3e565b840191505092915050565b60006106fb82610865565b610705818561089f565b9350610715818560208601610933565b80840191505092915050565b61072a8161091a565b82525050565b600061073c82846106f0565b915081905092915050565b600060208201905061075c6000830184610624565b92915050565b600060208201905061077760008301846106a8565b92915050565b60006020820190506107926000830184610721565b92915050565b60006040820190506107ad6000830185610721565b81810360208301526107bf8184610633565b90509392505050565b60006107d26107e3565b90506107de8282610966565b919050565b6000604051905090565b600067ffffffffffffffff82111561080857610807610a0f565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561083457610833610a0f565b5b61083d82610a3e565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006108b58261091a565b91506108c08361091a565b9250828210156108d3576108d26109e0565b5b828203905092915050565b60006108e9826108fa565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610951578082015181840152602081019050610936565b83811115610960576000848401525b50505050565b61096f82610a3e565b810181811067ffffffffffffffff8211171561098e5761098d610a0f565b5b80604052505050565b60006109a28261091a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156109d5576109d46109e0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a58816108de565b8114610a6357600080fd5b50565b610a6f8161091a565b8114610a7a57600080fd5b5056fea2646970667358221220fd3aa8380454f08fa02f9ba178248a724399dcb4df7dcb767730d87b0ff5feb164736f6c63430008030033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d1461012a57806386d516e814610148578063a8b0574e14610166578063ee82ac5e1461018457610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100dc5780634d2301cc146100fa575b600080fd5b6100956101b4565b6040516100a2919061077d565b60405180910390f35b6100c560048036038101906100c091906105a6565b6101bc565b6040516100d3929190610798565b60405180910390f35b6100e46103a7565b6040516100f19190610762565b60405180910390f35b610114600480360381019061010f919061057d565b6103bc565b604051610121919061077d565b60405180910390f35b6101326103dd565b60405161013f919061077d565b60405180910390f35b6101506103e5565b60405161015d919061077d565b60405180910390f35b61016e6103ed565b60405161017b9190610747565b60405180910390f35b61019e600480360381019061019991906105e7565b6103f5565b6040516101ab9190610762565b60405180910390f35b600042905090565b60006060439150825167ffffffffffffffff811115610204577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561023757816020015b60608152602001906001900390816102225790505b50905060005b83518110156103a157600080858381518110610282577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106102dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151602001516040516102f69190610730565b6000604051808303816000865af19150503d8060008114610333576040519150601f19603f3d011682016040523d82523d6000602084013e610338565b606091505b50915091508161034757600080fd5b80848481518110610381577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052505050808061039990610997565b91505061023d565b50915091565b60006001436103b691906108aa565b40905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b600045905090565b600041905090565b600081409050919050565b600061041361040e846107ed565b6107c8565b9050808382526020820190508260005b8581101561045357813585016104398882610504565b845260208401935060208301925050600181019050610423565b5050509392505050565b600061047061046b84610819565b6107c8565b90508281526020810184848401111561048857600080fd5b610493848285610924565b509392505050565b6000813590506104aa81610a4f565b92915050565b600082601f8301126104c157600080fd5b81356104d1848260208601610400565b91505092915050565b600082601f8301126104eb57600080fd5b81356104fb84826020860161045d565b91505092915050565b60006040828403121561051657600080fd5b61052060406107c8565b905060006105308482850161049b565b600083015250602082013567ffffffffffffffff81111561055057600080fd5b61055c848285016104da565b60208301525092915050565b60008135905061057781610a66565b92915050565b60006020828403121561058f57600080fd5b600061059d8482850161049b565b91505092915050565b6000602082840312156105b857600080fd5b600082013567ffffffffffffffff8111156105d257600080fd5b6105de848285016104b0565b91505092915050565b6000602082840312156105f957600080fd5b600061060784828501610568565b91505092915050565b600061061c83836106b7565b905092915050565b61062d816108de565b82525050565b600061063e8261085a565b610648818561087d565b93508360208202850161065a8561084a565b8060005b8581101561069657848403895281516106778582610610565b945061068283610870565b925060208a0199505060018101905061065e565b50829750879550505050505092915050565b6106b1816108f0565b82525050565b60006106c282610865565b6106cc818561088e565b93506106dc818560208601610933565b6106e581610a3e565b840191505092915050565b60006106fb82610865565b610705818561089f565b9350610715818560208601610933565b80840191505092915050565b61072a8161091a565b82525050565b600061073c82846106f0565b915081905092915050565b600060208201905061075c6000830184610624565b92915050565b600060208201905061077760008301846106a8565b92915050565b60006020820190506107926000830184610721565b92915050565b60006040820190506107ad6000830185610721565b81810360208301526107bf8184610633565b90509392505050565b60006107d26107e3565b90506107de8282610966565b919050565b6000604051905090565b600067ffffffffffffffff82111561080857610807610a0f565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561083457610833610a0f565b5b61083d82610a3e565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006108b58261091a565b91506108c08361091a565b9250828210156108d3576108d26109e0565b5b828203905092915050565b60006108e9826108fa565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610951578082015181840152602081019050610936565b83811115610960576000848401525b50505050565b61096f82610a3e565b810181811067ffffffffffffffff8211171561098e5761098d610a0f565b5b80604052505050565b60006109a28261091a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156109d5576109d46109e0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a58816108de565b8114610a6357600080fd5b50565b610a6f8161091a565b8114610a7a57600080fd5b5056fea2646970667358221220fd3aa8380454f08fa02f9ba178248a724399dcb4df7dcb767730d87b0ff5feb164736f6c63430008030033