Contract Address Details

0x7818a6A0fFe134b2aF30850DCE7c86A52eC6AC4F

Contract Name
Multicall
Creator
0x214fdc–1a027a at 0xec2dc5–adc2a7
Balance
0 TT
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
82842825
Contract name:
Multicall




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
200
EVM Version
byzantium




Verified at
2022-03-02 04:53:34.181423Z

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
/**
* Fork from https://github.com/makerdao/multicall/blob/master/src/Multicall.sol
*
* @title Multicall - Aggregate results from multiple read-only function calls
* @author Michael Elliot <mike@makerdao.com>
* @author Joshua Levine <joshua@makerdao.com>
* @author Nick Johnson <arachnid@notdot.net>
*/
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":[]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100a5576000357c01000000000000000000000000000000000000000000000000000000009004806372425d9d1161007857806372425d9d1461011057806386d516e814610116578063a8b0574e1461011c578063ee82ac5e1461012a57600080fd5b80630f28c97d146100aa578063252dba42146100bf57806327e86d6e146100e05780634d2301cc146100e8575b600080fd5b425b6040519081526020015b60405180910390f35b6100d26100cd36600461034e565b61013c565b6040516100b69291906104db565b6100ac610289565b6100ac6100f636600461055c565b73ffffffffffffffffffffffffffffffffffffffff163190565b446100ac565b456100ac565b6040514181526020016100b6565b6100ac61013836600461057e565b4090565b8051439060609067ffffffffffffffff81111561015b5761015b61029c565b60405190808252806020026020018201604052801561018e57816020015b60608152602001906001900390816101795790505b50905060005b8351811015610283576000808583815181106101b2576101b2610597565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106101e6576101e6610597565b6020026020010151602001516040516101ff91906105c6565b6000604051808303816000865af19150503d806000811461023c576040519150601f19603f3d011682016040523d82523d6000602084013e610241565b606091505b50915091508161025057600080fd5b8084848151811061026357610263610597565b60200260200101819052505050808061027b90610611565b915050610194565b50915091565b600061029660014361062c565b40905090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156102ee576102ee61029c565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561031d5761031d61029c565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461034957600080fd5b919050565b6000602080838503121561036157600080fd5b823567ffffffffffffffff8082111561037957600080fd5b818501915085601f83011261038d57600080fd5b81358181111561039f5761039f61029c565b8381026103ad8582016102f4565b91825283810185019185810190898411156103c757600080fd5b86860192505b8383101561049e578235858111156103e55760008081fd5b86016040601f19828d0381018213156103fe5760008081fd5b6104066102cb565b6104118b8501610325565b815282840135898111156104255760008081fd5b8085019450508d603f85011261043b5760008081fd5b8a8401358981111561044f5761044f61029c565b61045f8c84601f840116016102f4565b92508083528e848287010111156104765760008081fd5b808486018d85013760009083018c0152808b01919091528452505091860191908601906103cd565b9998505050505050505050565b60005b838110156104c65781810151838201526020016104ae565b838111156104d5576000848401525b50505050565b60006040820184835260206040818501528185518084526060860191506060838202870101935082870160005b8281101561054e57878603605f190184528151805180885261052f81888a018985016104ab565b601f01601f191696909601850195509284019290840190600101610508565b509398975050505050505050565b60006020828403121561056e57600080fd5b61057782610325565b9392505050565b60006020828403121561059057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082516105d88184602087016104ab565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000600019821415610625576106256105e2565b5060010190565b60008282101561063e5761063e6105e2565b50039056fea2646970667358221220a4909094187a95c4e36f230022f82f367643ea1fa676bab1e34b9cbb4415295364736f6c63430008090033