Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- Multicall
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 9999
- EVM Version
- default
- Verified at
- 2021-12-06T11:18:04.892525Z
Contract source code
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; pragma experimental ABIEncoderV2; /// @title Multicall - Aggregate results from multiple read-only function calls interface IERC20 { function balanceOf(address user) external view returns (uint256); } contract Multicall { address public metis = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000; 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 getMetisBalance(address addr) public view returns(uint256 balance) { balance = IERC20(metis).balanceOf(addr); } function getCurrentBlockTimestamp() public view returns (uint256 timestamp) { timestamp = block.timestamp; } function isContract(address account) public view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } }
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":"uint256","name":"timestamp","internalType":"uint256"}],"name":"getCurrentBlockTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"balance","internalType":"uint256"}],"name":"getMetisBalance","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isContract","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"metis","inputs":[]}]
Contract Creation Code
0x6080604052600080546001600160a01b03191673deaddeaddeaddeaddeaddeaddeaddeaddead000017905534801561003657600080fd5b5061063b806100466000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063252dba4211610050578063252dba42146100aa578063d53d6507146100cb578063e5974554146100de57610067565b80630f28c97d1461006c578063162790551461008a575b600080fd5b6100746100f3565b60405161008191906104e9565b60405180910390f35b61009d61009836600461031a565b6100f7565b60405161008191906104de565b6100bd6100b836600461033c565b6100fd565b6040516100819291906104f2565b6100746100d936600461031a565b61022d565b6100e66102da565b60405161008191906104bd565b4290565b3b151590565b8051439060609067ffffffffffffffff8111801561011a57600080fd5b5060405190808252806020026020018201604052801561014e57816020015b60608152602001906001900390816101395790505b50905060005b8351811015610227576000606085838151811061016d57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1686848151811061019b57fe5b6020026020010151602001516040516101b491906104a1565b6000604051808303816000865af19150503d80600081146101f1576040519150601f19603f3d011682016040523d82523d6000602084013e6101f6565b606091505b50915091508161020557600080fd5b8084848151811061021257fe5b60209081029190910101525050600101610154565b50915091565b600080546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906370a08231906102849085906004016104bd565b60206040518083038186803b15801561029c57600080fd5b505afa1580156102b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d49190610489565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b803573ffffffffffffffffffffffffffffffffffffffff811681146102d457600080fd5b60006020828403121561032b578081fd5b61033583836102f6565b9392505050565b6000602080838503121561034e578182fd5b823567ffffffffffffffff80821115610365578384fd5b818501915085601f830112610378578384fd5b813581811115610386578485fd5b61039384858302016105ae565b81815284810190848601875b8481101561047a57813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0604081838f030112156103dd578a8bfd5b6103e760406105ae565b6103f38e8c85016102f6565b8152604083013589811115610406578c8dfd5b8084019350508d603f84011261041a578b8cfd5b8a8301358981111561042a578c8dfd5b61043a8c84601f840116016105ae565b92508083528e6040828601011115610450578c8dfd5b80604085018d85013782018b018c9052808b0191909152855250928701929087019060010161039f565b50909998505050505050505050565b60006020828403121561049a578081fd5b5051919050565b600082516104b38184602087016105d5565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b901515815260200190565b90815260200190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b828110156105a0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184528151805180885261056381888a018985016105d5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169690960185019550928401929084019060010161051e565b509398975050505050505050565b60405181810167ffffffffffffffff811182821017156105cd57600080fd5b604052919050565b60005b838110156105f05781810151838201526020016105d8565b838111156105ff576000848401525b5050505056fea2646970667358221220de33380384d2bd95b1bd99d17ad6ac04991500a46b463dcc1c81bb75cbae845c64736f6c634300060c0033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063252dba4211610050578063252dba42146100aa578063d53d6507146100cb578063e5974554146100de57610067565b80630f28c97d1461006c578063162790551461008a575b600080fd5b6100746100f3565b60405161008191906104e9565b60405180910390f35b61009d61009836600461031a565b6100f7565b60405161008191906104de565b6100bd6100b836600461033c565b6100fd565b6040516100819291906104f2565b6100746100d936600461031a565b61022d565b6100e66102da565b60405161008191906104bd565b4290565b3b151590565b8051439060609067ffffffffffffffff8111801561011a57600080fd5b5060405190808252806020026020018201604052801561014e57816020015b60608152602001906001900390816101395790505b50905060005b8351811015610227576000606085838151811061016d57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1686848151811061019b57fe5b6020026020010151602001516040516101b491906104a1565b6000604051808303816000865af19150503d80600081146101f1576040519150601f19603f3d011682016040523d82523d6000602084013e6101f6565b606091505b50915091508161020557600080fd5b8084848151811061021257fe5b60209081029190910101525050600101610154565b50915091565b600080546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906370a08231906102849085906004016104bd565b60206040518083038186803b15801561029c57600080fd5b505afa1580156102b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d49190610489565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b803573ffffffffffffffffffffffffffffffffffffffff811681146102d457600080fd5b60006020828403121561032b578081fd5b61033583836102f6565b9392505050565b6000602080838503121561034e578182fd5b823567ffffffffffffffff80821115610365578384fd5b818501915085601f830112610378578384fd5b813581811115610386578485fd5b61039384858302016105ae565b81815284810190848601875b8481101561047a57813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0604081838f030112156103dd578a8bfd5b6103e760406105ae565b6103f38e8c85016102f6565b8152604083013589811115610406578c8dfd5b8084019350508d603f84011261041a578b8cfd5b8a8301358981111561042a578c8dfd5b61043a8c84601f840116016105ae565b92508083528e6040828601011115610450578c8dfd5b80604085018d85013782018b018c9052808b0191909152855250928701929087019060010161039f565b50909998505050505050505050565b60006020828403121561049a578081fd5b5051919050565b600082516104b38184602087016105d5565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b901515815260200190565b90815260200190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b828110156105a0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184528151805180885261056381888a018985016105d5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169690960185019550928401929084019060010161051e565b509398975050505050505050565b60405181810167ffffffffffffffff811182821017156105cd57600080fd5b604052919050565b60005b838110156105f05781810151838201526020016105d8565b838111156105ff576000848401525b5050505056fea2646970667358221220de33380384d2bd95b1bd99d17ad6ac04991500a46b463dcc1c81bb75cbae845c64736f6c634300060c0033