Address io1la4yrq24st8arzz4ckusalgag4uyl484csj835

Contract Overview

Balance:
0 IOTX

IOTX Value:
$ 0

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Multicall

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

// SPDX-License-Identifier: MIT


pragma solidity ^0.8.0;

/// @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;
    }
    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.prevrandao;
    }
    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);
    }
}

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall.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 Multicall.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 Multicall.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 Multicall.Call[]","name":"calls","type":"tuple[]"}],"name":"tryAggregate","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Multicall.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 Multicall.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 Multicall.Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"}]

Contract Creation Code

608060405234801561000f575f80fd5b50600436106100b1575f3560e01c806372425d9d1161006e57806372425d9d1461013657806386d516e81461013c578063a8b0574e14610142578063bce38bd714610150578063c3077fa914610170578063ee82ac5e14610183575f80fd5b80630f28c97d146100b5578063252dba42146100ca57806327e86d6e146100eb578063399542e9146100f357806342cbb15c146101155780634d2301cc1461011b575b5f80fd5b425b6040519081526020015b60405180910390f35b6100dd6100d83660046106af565b610195565b6040516100c1929190610736565b6100b761030b565b6101066101013660046107a0565b61031d565b6040516100c19392919061085d565b436100b7565b6100b7610129366004610884565b6001600160a01b03163190565b446100b7565b456100b7565b6040514181526020016100c1565b61016361015e3660046107a0565b610335565b6040516100c191906108a4565b61010661017e3660046106af565b6104dc565b6100b76101913660046108b6565b4090565b8051439060609067ffffffffffffffff8111156101b4576101b46104f8565b6040519080825280602002602001820160405280156101e757816020015b60608152602001906001900390816101d25790505b5090505f5b8351811015610305575f80858381518110610209576102096108cd565b60200260200101515f01516001600160a01b031686848151811061022f5761022f6108cd565b60200260200101516020015160405161024891906108e1565b5f604051808303815f865af19150503d805f8114610281576040519150601f19603f3d011682016040523d82523d5f602084013e610286565b606091505b5091509150816102dd5760405162461bcd60e51b815260206004820181905260248201527f4d756c746963616c6c206167677265676174653a2063616c6c206661696c656460448201526064015b60405180910390fd5b808484815181106102f0576102f06108cd565b602090810291909101015250506001016101ec565b50915091565b5f6103176001436108fc565b40905090565b438040606061032c8585610335565b90509250925092565b6060815167ffffffffffffffff811115610351576103516104f8565b60405190808252806020026020018201604052801561039657816020015b604080518082019091525f81526060602082015281526020019060019003908161036f5790505b5090505f5b82518110156104d5575f808483815181106103b8576103b86108cd565b60200260200101515f01516001600160a01b03168584815181106103de576103de6108cd565b6020026020010151602001516040516103f791906108e1565b5f604051808303815f865af19150503d805f8114610430576040519150601f19603f3d011682016040523d82523d5f602084013e610435565b606091505b5091509150851561049757816104975760405162461bcd60e51b815260206004820152602160248201527f4d756c746963616c6c32206167677265676174653a2063616c6c206661696c656044820152601960fa1b60648201526084016102d4565b60405180604001604052808315158152602001828152508484815181106104c0576104c06108cd565b6020908102919091010152505060010161039b565b5092915050565b5f8060606104eb60018561031d565b9196909550909350915050565b634e487b7160e01b5f52604160045260245ffd5b6040805190810167ffffffffffffffff8111828210171561052f5761052f6104f8565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561055e5761055e6104f8565b604052919050565b80356001600160a01b038116811461057c575f80fd5b919050565b5f601f83601f840112610592575f80fd5b8235602067ffffffffffffffff808311156105af576105af6104f8565b8260051b6105be838201610535565b93845286810183019383810190898611156105d7575f80fd5b84890192505b858310156106a2578235848111156105f3575f80fd5b89016040601f19828d03810182131561060a575f80fd5b61061261050c565b61061d898501610566565b8152828401358881111561062f575f80fd5b8085019450508d603f850112610643575f80fd5b8884013588811115610657576106576104f8565b6106668a848e84011601610535565b92508083528e8482870101111561067b575f80fd5b808486018b8501375f9083018a0152808901919091528452505091840191908401906105dd565b9998505050505050505050565b5f602082840312156106bf575f80fd5b813567ffffffffffffffff8111156106d5575f80fd5b6106e184828501610581565b949350505050565b5f5b838110156107035781810151838201526020016106eb565b50505f910152565b5f81518084526107228160208601602086016106e9565b601f01601f19169290920160200192915050565b5f6040820184835260206040602085015281855180845260608601915060608160051b8701019350602087015f5b8281101561079257605f1988870301845261078086835161070b565b95509284019290840190600101610764565b509398975050505050505050565b5f80604083850312156107b1575f80fd5b823580151581146107c0575f80fd5b9150602083013567ffffffffffffffff8111156107db575f80fd5b6107e785828601610581565b9150509250929050565b5f82825180855260208086019550808260051b8401018186015f5b8481101561085057858303601f190189528151805115158452840151604085850181905261083c8186018361070b565b9a86019a945050509083019060010161080c565b5090979650505050505050565b838152826020820152606060408201525f61087b60608301846107f1565b95945050505050565b5f60208284031215610894575f80fd5b61089d82610566565b9392505050565b602081525f61089d60208301846107f1565b5f602082840312156108c6575f80fd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b5f82516108f28184602087016106e9565b9190910192915050565b8181038181111561091b57634e487b7160e01b5f52601160045260245ffd5b9291505056fea264697066735822122078be26b04bb229652929fd686f1bbfd946238898621ded2ca880b4ad1be5e7fa64736f6c63430008170033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.