Contract Address Details

0x861aa52B81A16E146E1f8D39B6C8BdC072d8348d

Contract Name
Multicall
Creator
0x115efe–328823 at 0xf69ff6–95ffc0
Balance
0 ASTR ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
1337556
Contract name:
Multicall




Optimization enabled
true
Compiler version
v0.5.16+commit.9c3226ce




Optimization runs
1000
EVM Version
default




Verified at
2022-05-14T08:58:36.410032Z

Contract source code

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","payable":false,"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"}]}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bytes32","name":"blockHash","internalType":"bytes32"}],"name":"getBlockHash","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"coinbase","internalType":"address"}],"name":"getCurrentBlockCoinbase","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"difficulty","internalType":"uint256"}],"name":"getCurrentBlockDifficulty","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"gaslimit","internalType":"uint256"}],"name":"getCurrentBlockGasLimit","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"timestamp","internalType":"uint256"}],"name":"getCurrentBlockTimestamp","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"balance","internalType":"uint256"}],"name":"getEthBalance","inputs":[{"type":"address","name":"addr","internalType":"address"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bytes32","name":"blockHash","internalType":"bytes32"}],"name":"getLastBlockHash","inputs":[],"constant":true}]
            

Contract Creation Code

0x608060405234801561001057600080fd5b506106c0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d146100e757806386d516e8146100ef578063a8b0574e146100f7578063ee82ac5e1461010c57610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100cc5780634d2301cc146100d4575b600080fd5b61009561011f565b6040516100a2919061053a565b60405180910390f35b6100be6100b93660046103cd565b610123565b6040516100a2929190610548565b61009561023e565b6100956100e23660046103a7565b610247565b610095610261565b610095610265565b6100ff610269565b6040516100a2919061052c565b61009561011a366004610402565b61026d565b4290565b60006060439150825160405190808252806020026020018201604052801561015f57816020015b606081526020019060019003908161014a5790505b50905060005b8351811015610238576000606085838151811061017e57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106101ac57fe5b6020026020010151602001516040516101c59190610520565b6000604051808303816000865af19150503d8060008114610202576040519150601f19603f3d011682016040523d82523d6000602084013e610207565b606091505b50915091508161021657600080fd5b8084848151811061022357fe5b60209081029190910101525050600101610165565b50915091565b60001943014090565b73ffffffffffffffffffffffffffffffffffffffff163190565b4490565b4590565b4190565b4090565b803561027c8161065d565b92915050565b600082601f83011261029357600080fd5b81356102a66102a18261058f565b610568565b81815260209384019390925082018360005b838110156102e457813586016102ce888261033d565b84525060209283019291909101906001016102b8565b5050505092915050565b600082601f8301126102ff57600080fd5b813561030d6102a1826105b0565b9150808252602083016020830185838301111561032957600080fd5b610334838284610617565b50505092915050565b60006040828403121561034f57600080fd5b6103596040610568565b905060006103678484610271565b825250602082013567ffffffffffffffff81111561038457600080fd5b610390848285016102ee565b60208301525092915050565b803561027c81610674565b6000602082840312156103b957600080fd5b60006103c58484610271565b949350505050565b6000602082840312156103df57600080fd5b813567ffffffffffffffff8111156103f657600080fd5b6103c584828501610282565b60006020828403121561041457600080fd5b60006103c5848461039c565b600061042c83836104b9565b9392505050565b61043c816105f0565b82525050565b600061044d826105de565b61045781856105e2565b935083602082028501610469856105d8565b8060005b858110156104a357848403895281516104868582610420565b9450610491836105d8565b60209a909a019992505060010161046d565b5091979650505050505050565b61043c816105fb565b60006104c4826105de565b6104ce81856105e2565b93506104de818560208601610623565b6104e781610653565b9093019392505050565b60006104fc826105de565b61050681856105eb565b9350610516818560208601610623565b9290920192915050565b600061042c82846104f1565b6020810161027c8284610433565b6020810161027c82846104b0565b6040810161055682856104b0565b81810360208301526103c58184610442565b60405181810167ffffffffffffffff8111828210171561058757600080fd5b604052919050565b600067ffffffffffffffff8211156105a657600080fd5b5060209081020190565b600067ffffffffffffffff8211156105c757600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b919050565b600061027c826105fe565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b82818337506000910152565b60005b8381101561063e578181015183820152602001610626565b8381111561064d576000848401525b50505050565b601f01601f191690565b610666816105f0565b811461067157600080fd5b50565b610666816105fb56fea365627a7a72315820d09357d38d5990f6eaa4df5bc048bb0fbb49f33571d8e8e3c83c3914b3aeadf96c6578706572696d656e74616cf564736f6c63430005100040

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d146100e757806386d516e8146100ef578063a8b0574e146100f7578063ee82ac5e1461010c57610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100cc5780634d2301cc146100d4575b600080fd5b61009561011f565b6040516100a2919061053a565b60405180910390f35b6100be6100b93660046103cd565b610123565b6040516100a2929190610548565b61009561023e565b6100956100e23660046103a7565b610247565b610095610261565b610095610265565b6100ff610269565b6040516100a2919061052c565b61009561011a366004610402565b61026d565b4290565b60006060439150825160405190808252806020026020018201604052801561015f57816020015b606081526020019060019003908161014a5790505b50905060005b8351811015610238576000606085838151811061017e57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106101ac57fe5b6020026020010151602001516040516101c59190610520565b6000604051808303816000865af19150503d8060008114610202576040519150601f19603f3d011682016040523d82523d6000602084013e610207565b606091505b50915091508161021657600080fd5b8084848151811061022357fe5b60209081029190910101525050600101610165565b50915091565b60001943014090565b73ffffffffffffffffffffffffffffffffffffffff163190565b4490565b4590565b4190565b4090565b803561027c8161065d565b92915050565b600082601f83011261029357600080fd5b81356102a66102a18261058f565b610568565b81815260209384019390925082018360005b838110156102e457813586016102ce888261033d565b84525060209283019291909101906001016102b8565b5050505092915050565b600082601f8301126102ff57600080fd5b813561030d6102a1826105b0565b9150808252602083016020830185838301111561032957600080fd5b610334838284610617565b50505092915050565b60006040828403121561034f57600080fd5b6103596040610568565b905060006103678484610271565b825250602082013567ffffffffffffffff81111561038457600080fd5b610390848285016102ee565b60208301525092915050565b803561027c81610674565b6000602082840312156103b957600080fd5b60006103c58484610271565b949350505050565b6000602082840312156103df57600080fd5b813567ffffffffffffffff8111156103f657600080fd5b6103c584828501610282565b60006020828403121561041457600080fd5b60006103c5848461039c565b600061042c83836104b9565b9392505050565b61043c816105f0565b82525050565b600061044d826105de565b61045781856105e2565b935083602082028501610469856105d8565b8060005b858110156104a357848403895281516104868582610420565b9450610491836105d8565b60209a909a019992505060010161046d565b5091979650505050505050565b61043c816105fb565b60006104c4826105de565b6104ce81856105e2565b93506104de818560208601610623565b6104e781610653565b9093019392505050565b60006104fc826105de565b61050681856105eb565b9350610516818560208601610623565b9290920192915050565b600061042c82846104f1565b6020810161027c8284610433565b6020810161027c82846104b0565b6040810161055682856104b0565b81810360208301526103c58184610442565b60405181810167ffffffffffffffff8111828210171561058757600080fd5b604052919050565b600067ffffffffffffffff8211156105a657600080fd5b5060209081020190565b600067ffffffffffffffff8211156105c757600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b919050565b600061027c826105fe565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b82818337506000910152565b60005b8381101561063e578181015183820152602001610626565b8381111561064d576000848401525b50505050565b601f01601f191690565b610666816105f0565b811461067157600080fd5b50565b610666816105fb56fea365627a7a72315820d09357d38d5990f6eaa4df5bc048bb0fbb49f33571d8e8e3c83c3914b3aeadf96c6578706572696d656e74616cf564736f6c63430005100040