S Price: $0.516787 (+1.88%)

Contract

0x828825f11C084c190344263Aefa8fB33A8308292

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Multicall2

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 700 runs

Other Settings:
default evmVersion
File 1 of 1 : Multicall2.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;

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

contract Multicall2 {
    struct Call {
        address target;
        bytes callData;
    }
    struct Result {
        bool success;
        bytes returnData;
    }

    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, "Multicall aggregate: call failed");
            returnData[i] = ret;
        }
    }
    function blockAndAggregate(Call[] memory calls) public returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) {
        (blockNumber, blockHash, returnData) = tryBlockAndAggregate(true, calls);
    }
    function getBlockHash(uint256 blockNumber) public view returns (bytes32 blockHash) {
        blockHash = blockhash(blockNumber);
    }
    function getBlockNumber() public view returns (uint256 blockNumber) {
        blockNumber = block.number;
    }
    function getCurrentBlockCoinbase() public view returns (address coinbase) {
        coinbase = block.coinbase;
    }
    function getCurrentBlockDifficulty() public view returns (uint256 difficulty) {
        difficulty = block.difficulty;
    }
    function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) {
        gaslimit = block.gaslimit;
    }
    function getCurrentBlockTimestamp() public view returns (uint256 timestamp) {
        timestamp = block.timestamp;
    }
    function getEthBalance(address addr) public view returns (uint256 balance) {
        balance = addr.balance;
    }
    function getLastBlockHash() public view returns (bytes32 blockHash) {
        blockHash = blockhash(block.number - 1);
    }
    function tryAggregate(bool requireSuccess, Call[] memory calls) public returns (Result[] memory returnData) {
        returnData = new Result[](calls.length);
        for(uint256 i = 0; i < calls.length; i++) {
            (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData);

            if (requireSuccess) {
                require(success, "Multicall2 aggregate: call failed");
            }

            returnData[i] = Result(success, ret);
        }
    }
    function tryBlockAndAggregate(bool requireSuccess, Call[] memory calls) public returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData) {
        blockNumber = block.number;
        blockHash = blockhash(block.number);
        returnData = tryAggregate(requireSuccess, calls);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 700
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

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

608060405234801561001057600080fd5b5061093e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806372425d9d11610081578063bce38bd71161005b578063bce38bd714610182578063c3077fa9146101a2578063ee82ac5e146101b5576100d4565b806372425d9d1461015d57806386d516e814610165578063a8b0574e1461016d576100d4565b8063399542e9116100b2578063399542e91461012057806342cbb15c146101425780634d2301cc1461014a576100d4565b80630f28c97d146100d9578063252dba42146100f757806327e86d6e14610118575b600080fd5b6100e16101c8565b6040516100ee91906107a5565b60405180910390f35b61010a610105366004610625565b6101cc565b6040516100ee929190610824565b6100e161030a565b61013361012e366004610660565b610313565b6040516100ee9392919061088c565b6100e161032b565b6100e1610158366004610604565b61032f565b6100e161033c565b6100e1610340565b610175610344565b6040516100ee919061077e565b610195610190366004610660565b610348565b6040516100ee9190610792565b6101336101b0366004610625565b61049d565b6100e16101c33660046106b2565b6104ba565b4290565b8051439060609067ffffffffffffffff811180156101e957600080fd5b5060405190808252806020026020018201604052801561021d57816020015b60608152602001906001900390816102085790505b50905060005b83518110156103045760008085838151811061023b57fe5b6020026020010151600001516001600160a01b031686848151811061025c57fe5b6020026020010151602001516040516102759190610762565b6000604051808303816000865af19150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5091509150816102e25760405162461bcd60e51b81526004016102d9906107ef565b60405180910390fd5b808484815181106102ef57fe5b60209081029190910101525050600101610223565b50915091565b60001943014090565b43804060606103228585610348565b90509250925092565b4390565b6001600160a01b03163190565b4490565b4590565b4190565b6060815167ffffffffffffffff8111801561036257600080fd5b5060405190808252806020026020018201604052801561039c57816020015b6103896104be565b8152602001906001900390816103815790505b50905060005b8251811015610496576000808483815181106103ba57fe5b6020026020010151600001516001600160a01b03168584815181106103db57fe5b6020026020010151602001516040516103f49190610762565b6000604051808303816000865af19150503d8060008114610431576040519150601f19603f3d011682016040523d82523d6000602084013e610436565b606091505b5091509150851561045e578161045e5760405162461bcd60e51b81526004016102d9906107ae565b604051806040016040528083151581526020018281525084848151811061048157fe5b602090810291909101015250506001016103a2565b5092915050565b60008060606104ad600185610313565b9196909550909350915050565b4090565b60408051808201909152600081526060602082015290565b80356001600160a01b03811681146104ed57600080fd5b919050565b600082601f830112610502578081fd5b8135602067ffffffffffffffff8083111561051957fe5b61052682838502016108b4565b83815282810190868401865b868110156105f657813589016040601f198181848f03011215610553578a8bfd5b81518281018181108a8211171561056657fe5b8352610573848b016104d6565b81528284013589811115610585578c8dfd5b8085019450508d603f850112610599578b8cfd5b89840135898111156105a757fe5b6105b78b84601f840116016108b4565b92508083528e848287010111156105cc578c8dfd5b808486018c85013782018a018c9052808a0191909152865250509285019290850190600101610532565b509098975050505050505050565b600060208284031215610615578081fd5b61061e826104d6565b9392505050565b600060208284031215610636578081fd5b813567ffffffffffffffff81111561064c578182fd5b610658848285016104f2565b949350505050565b60008060408385031215610672578081fd5b82358015158114610681578182fd5b9150602083013567ffffffffffffffff81111561069c578182fd5b6106a8858286016104f2565b9150509250929050565b6000602082840312156106c3578081fd5b5035919050565b60008282518085526020808601955080818302840101818601855b8481101561072957858303601f190189528151805115158452840151604085850181905261071581860183610736565b9a86019a94505050908301906001016106e5565b5090979650505050505050565b6000815180845261074e8160208601602086016108d8565b601f01601f19169290920160200192915050565b600082516107748184602087016108d8565b9190910192915050565b6001600160a01b0391909116815260200190565b60006020825261061e60208301846106ca565b90815260200190565b60208082526021908201527f4d756c746963616c6c32206167677265676174653a2063616c6c206661696c656040820152601960fa1b606082015260800190565b6020808252818101527f4d756c746963616c6c206167677265676174653a2063616c6c206661696c6564604082015260600190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b8281101561087e57605f1988870301845261086c868351610736565b95509284019290840190600101610850565b509398975050505050505050565b6000848252836020830152606060408301526108ab60608301846106ca565b95945050505050565b60405181810167ffffffffffffffff811182821017156108d057fe5b604052919050565b60005b838110156108f35781810151838201526020016108db565b83811115610902576000848401525b5050505056fea264697066735822122067bd011fcfa54fbca62390e41d983f8401e4b1ab9ff8095986d538850a215a0064736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806372425d9d11610081578063bce38bd71161005b578063bce38bd714610182578063c3077fa9146101a2578063ee82ac5e146101b5576100d4565b806372425d9d1461015d57806386d516e814610165578063a8b0574e1461016d576100d4565b8063399542e9116100b2578063399542e91461012057806342cbb15c146101425780634d2301cc1461014a576100d4565b80630f28c97d146100d9578063252dba42146100f757806327e86d6e14610118575b600080fd5b6100e16101c8565b6040516100ee91906107a5565b60405180910390f35b61010a610105366004610625565b6101cc565b6040516100ee929190610824565b6100e161030a565b61013361012e366004610660565b610313565b6040516100ee9392919061088c565b6100e161032b565b6100e1610158366004610604565b61032f565b6100e161033c565b6100e1610340565b610175610344565b6040516100ee919061077e565b610195610190366004610660565b610348565b6040516100ee9190610792565b6101336101b0366004610625565b61049d565b6100e16101c33660046106b2565b6104ba565b4290565b8051439060609067ffffffffffffffff811180156101e957600080fd5b5060405190808252806020026020018201604052801561021d57816020015b60608152602001906001900390816102085790505b50905060005b83518110156103045760008085838151811061023b57fe5b6020026020010151600001516001600160a01b031686848151811061025c57fe5b6020026020010151602001516040516102759190610762565b6000604051808303816000865af19150503d80600081146102b2576040519150601f19603f3d011682016040523d82523d6000602084013e6102b7565b606091505b5091509150816102e25760405162461bcd60e51b81526004016102d9906107ef565b60405180910390fd5b808484815181106102ef57fe5b60209081029190910101525050600101610223565b50915091565b60001943014090565b43804060606103228585610348565b90509250925092565b4390565b6001600160a01b03163190565b4490565b4590565b4190565b6060815167ffffffffffffffff8111801561036257600080fd5b5060405190808252806020026020018201604052801561039c57816020015b6103896104be565b8152602001906001900390816103815790505b50905060005b8251811015610496576000808483815181106103ba57fe5b6020026020010151600001516001600160a01b03168584815181106103db57fe5b6020026020010151602001516040516103f49190610762565b6000604051808303816000865af19150503d8060008114610431576040519150601f19603f3d011682016040523d82523d6000602084013e610436565b606091505b5091509150851561045e578161045e5760405162461bcd60e51b81526004016102d9906107ae565b604051806040016040528083151581526020018281525084848151811061048157fe5b602090810291909101015250506001016103a2565b5092915050565b60008060606104ad600185610313565b9196909550909350915050565b4090565b60408051808201909152600081526060602082015290565b80356001600160a01b03811681146104ed57600080fd5b919050565b600082601f830112610502578081fd5b8135602067ffffffffffffffff8083111561051957fe5b61052682838502016108b4565b83815282810190868401865b868110156105f657813589016040601f198181848f03011215610553578a8bfd5b81518281018181108a8211171561056657fe5b8352610573848b016104d6565b81528284013589811115610585578c8dfd5b8085019450508d603f850112610599578b8cfd5b89840135898111156105a757fe5b6105b78b84601f840116016108b4565b92508083528e848287010111156105cc578c8dfd5b808486018c85013782018a018c9052808a0191909152865250509285019290850190600101610532565b509098975050505050505050565b600060208284031215610615578081fd5b61061e826104d6565b9392505050565b600060208284031215610636578081fd5b813567ffffffffffffffff81111561064c578182fd5b610658848285016104f2565b949350505050565b60008060408385031215610672578081fd5b82358015158114610681578182fd5b9150602083013567ffffffffffffffff81111561069c578182fd5b6106a8858286016104f2565b9150509250929050565b6000602082840312156106c3578081fd5b5035919050565b60008282518085526020808601955080818302840101818601855b8481101561072957858303601f190189528151805115158452840151604085850181905261071581860183610736565b9a86019a94505050908301906001016106e5565b5090979650505050505050565b6000815180845261074e8160208601602086016108d8565b601f01601f19169290920160200192915050565b600082516107748184602087016108d8565b9190910192915050565b6001600160a01b0391909116815260200190565b60006020825261061e60208301846106ca565b90815260200190565b60208082526021908201527f4d756c746963616c6c32206167677265676174653a2063616c6c206661696c656040820152601960fa1b606082015260800190565b6020808252818101527f4d756c746963616c6c206167677265676174653a2063616c6c206661696c6564604082015260600190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b8281101561087e57605f1988870301845261086c868351610736565b95509284019290840190600101610850565b509398975050505050505050565b6000848252836020830152606060408301526108ab60608301846106ca565b95945050505050565b60405181810167ffffffffffffffff811182821017156108d057fe5b604052919050565b60005b838110156108f35781810151838201526020016108db565b83811115610902576000848401525b5050505056fea264697066735822122067bd011fcfa54fbca62390e41d983f8401e4b1ab9ff8095986d538850a215a0064736f6c63430007060033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.