Contract

0x6dF85fD781ddDAbD7f12835f1ff847Db6F14Ca2c

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

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:
InterfaceMulticallV2

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 700 runs

Other Settings:
default evmVersion
File 1 of 1 : InterfaceMulticallV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;

/// @notice A fork of MultiCall with gas limit
contract InterfaceMulticallV2 {
    struct Call {
        address target;
        uint256 gasLimit;
        bytes callData;
    }

    struct Result {
        bool success;
        uint256 gasUsed;
        bytes returnData;
    }

    function multicall(Call[] memory calls) public returns (uint256 blockNumber, Result[] memory returnData) {
        blockNumber = block.number;
        returnData = new Result[](calls.length);

        for (uint256 i = 0; i < calls.length; i++) {
            (address target, uint256 gasLimit, bytes memory callData) = (
                calls[i].target,
                calls[i].gasLimit,
                calls[i].callData
            );

            uint256 gasLeftBefore = gasleft();
            (bool success, bytes memory ret) = target.call{gas: gasLimit}(callData);
            uint256 gasUsed = gasLeftBefore - gasleft();
            returnData[i] = Result(success, gasUsed, ret);
        }
    }

    function multicallWithGasLimitation(
        Call[] memory calls,
        uint256 gasBuffer
    ) public returns (uint256 blockNumber, Result[] memory returnData, uint256 lastSuccessIndex) {
        blockNumber = block.number;
        returnData = new Result[](calls.length);

        for (uint256 i = 0; i < calls.length; i++) {
            (address target, uint256 gasLimit, bytes memory callData) = (
                calls[i].target,
                calls[i].gasLimit,
                calls[i].callData
            );

            uint256 gasLeftBefore = gasleft();
            (bool success, bytes memory ret) = target.call{gas: gasLimit}(callData);
            uint256 gasUsed = gasLeftBefore - gasleft();
            returnData[i] = Result(success, gasUsed, ret);

            if (gasleft() < gasBuffer) {
                return (blockNumber, returnData, i);
            }
        }

        return (blockNumber, returnData, calls.length - 1);
    }

    function gaslimit() external view returns (uint256) {
        return block.gaslimit;
    }

    function gasLeft() external view returns (uint256) {
        return gasleft();
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"gasLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaslimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct InterfaceMulticallV2.Call[]","name":"calls","type":"tuple[]"}],"name":"multicall","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct InterfaceMulticallV2.Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct InterfaceMulticallV2.Call[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"gasBuffer","type":"uint256"}],"name":"multicallWithGasLimitation","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct InterfaceMulticallV2.Result[]","name":"returnData","type":"tuple[]"},{"internalType":"uint256","name":"lastSuccessIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610767806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610569565b6100ba565b60405161007292919061069b565b60405180910390f35b61008361023e565b6040516100729190610692565b610083610242565b6100ab6100a63660046105a4565b61024a565b604051610072939291906106b4565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103f3565b8152602001906001900390816100f65790505b50905060005b835181101561023857600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101a19190610676565b60006040518083038160008787f1925050503d80600081146101df576040519150601f19603f3d011682016040523d82523d6000602084013e6101e4565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061021957fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561026b57600080fd5b506040519080825280602002602001820160405280156102a557816020015b6102926103f3565b81526020019060019003908161028a5790505b50915060005b85518110156103e35760008060008884815181106102c557fe5b6020026020010151600001518985815181106102dd57fe5b6020026020010151602001518a86815181106102f557fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516103359190610676565b60006040518083038160008787f1925050503d8060008114610373576040519150601f19603f3d011682016040523d82523d6000602084013e610378565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a89815181106103ad57fe5b60200260200101819052508b5a10156103d057509596506103ec95505050505050565b5050600190950194506102ab9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f830112610426578081fd5b8135602067ffffffffffffffff8083111561043d57fe5b61044a82838502016106dd565b83815282810190868401865b868110156104f65781358901606080601f19838e0301121561047657898afd5b604080518281018181108a8211171561048b57fe5b8252838a013573ffffffffffffffffffffffffffffffffffffffff811681146104b2578c8dfd5b8152838201358a8201529183013591888311156104cd578b8cfd5b6104db8e8b85870101610504565b91810191909152865250509285019290850190600101610456565b509098975050505050505050565b600082601f830112610514578081fd5b813567ffffffffffffffff81111561052857fe5b61053b601f8201601f19166020016106dd565b81815284602083860101111561054f578283fd5b816020850160208301379081016020019190915292915050565b60006020828403121561057a578081fd5b813567ffffffffffffffff811115610590578182fd5b61059c84828501610416565b949350505050565b600080604083850312156105b6578081fd5b823567ffffffffffffffff8111156105cc578182fd5b6105d885828601610416565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561066957828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061064981838901858b01610701565b9a87019a601f01601f191695909501909401935090840190600101610603565b5091979650505050505050565b60008251610688818460208701610701565b9190910192915050565b90815260200190565b60008382526040602083015261059c60408301846105e7565b6000848252606060208301526106cd60608301856105e7565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106f957fe5b604052919050565b60005b8381101561071c578181015183820152602001610704565b8381111561072b576000848401525b5050505056fea2646970667358221220af649def1781eeca2b8cb3dc4b73fbab2c59f06a2848908fcfc224ab24c4bf1664736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610569565b6100ba565b60405161007292919061069b565b60405180910390f35b61008361023e565b6040516100729190610692565b610083610242565b6100ab6100a63660046105a4565b61024a565b604051610072939291906106b4565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103f3565b8152602001906001900390816100f65790505b50905060005b835181101561023857600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101a19190610676565b60006040518083038160008787f1925050503d80600081146101df576040519150601f19603f3d011682016040523d82523d6000602084013e6101e4565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061021957fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561026b57600080fd5b506040519080825280602002602001820160405280156102a557816020015b6102926103f3565b81526020019060019003908161028a5790505b50915060005b85518110156103e35760008060008884815181106102c557fe5b6020026020010151600001518985815181106102dd57fe5b6020026020010151602001518a86815181106102f557fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516103359190610676565b60006040518083038160008787f1925050503d8060008114610373576040519150601f19603f3d011682016040523d82523d6000602084013e610378565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a89815181106103ad57fe5b60200260200101819052508b5a10156103d057509596506103ec95505050505050565b5050600190950194506102ab9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f830112610426578081fd5b8135602067ffffffffffffffff8083111561043d57fe5b61044a82838502016106dd565b83815282810190868401865b868110156104f65781358901606080601f19838e0301121561047657898afd5b604080518281018181108a8211171561048b57fe5b8252838a013573ffffffffffffffffffffffffffffffffffffffff811681146104b2578c8dfd5b8152838201358a8201529183013591888311156104cd578b8cfd5b6104db8e8b85870101610504565b91810191909152865250509285019290850190600101610456565b509098975050505050505050565b600082601f830112610514578081fd5b813567ffffffffffffffff81111561052857fe5b61053b601f8201601f19166020016106dd565b81815284602083860101111561054f578283fd5b816020850160208301379081016020019190915292915050565b60006020828403121561057a578081fd5b813567ffffffffffffffff811115610590578182fd5b61059c84828501610416565b949350505050565b600080604083850312156105b6578081fd5b823567ffffffffffffffff8111156105cc578182fd5b6105d885828601610416565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561066957828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061064981838901858b01610701565b9a87019a601f01601f191695909501909401935090840190600101610603565b5091979650505050505050565b60008251610688818460208701610701565b9190910192915050565b90815260200190565b60008382526040602083015261059c60408301846105e7565b6000848252606060208301526106cd60608301856105e7565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106f957fe5b604052919050565b60005b8381101561071c578181015183820152602001610704565b8381111561072b576000848401525b5050505056fea2646970667358221220af649def1781eeca2b8cb3dc4b73fbab2c59f06a2848908fcfc224ab24c4bf1664736f6c63430007060033

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.