false
false
0

Contract Address Details

0x8f4F079884632a7D8D6bD898887cB4B07AB4C213

Contract Name
ColdFiInterfaceMulticallV2
Creator
0x25a861–9aa76e at 0x8790c4–875680
Balance
0 CLO
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
18656668
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ColdFiInterfaceMulticallV2




Optimization enabled
true
Compiler version
v0.7.6+commit.7338295f




Optimization runs
200
EVM Version
default




Verified at
2024-12-01T14:36:50.141331Z

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;

/// @notice A fork of MultiCall with gas limit
contract ColdFiInterfaceMulticallV2 {
    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();
    }
}
        

Contract ABI

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

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b50610740806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610542565b6100ba565b604051610072929190610674565b60405180910390f35b610083610231565b604051610072919061066b565b610083610235565b6100ab6100a636600461057d565b61023d565b6040516100729392919061068d565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103d9565b8152602001906001900390816100f65790505b50905060005b835181101561022b57600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b03168585604051610194919061064f565b60006040518083038160008787f1925050503d80600081146101d2576040519150601f19603f3d011682016040523d82523d6000602084013e6101d7565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061020c57fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561025e57600080fd5b5060405190808252806020026020018201604052801561029857816020015b6102856103d9565b81526020019060019003908161027d5790505b50915060005b85518110156103c95760008060008884815181106102b857fe5b6020026020010151600001518985815181106102d057fe5b6020026020010151602001518a86815181106102e857fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b0316858560405161031b919061064f565b60006040518083038160008787f1925050503d8060008114610359576040519150601f19603f3d011682016040523d82523d6000602084013e61035e565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a898151811061039357fe5b60200260200101819052508b5a10156103b657509596506103d295505050505050565b50506001909501945061029e9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f83011261040c578081fd5b8135602067ffffffffffffffff8083111561042357fe5b61043082838502016106b6565b83815282810190868401865b868110156104cf5781358901606080601f19838e0301121561045c57898afd5b604080518281018181108a8211171561047157fe5b8252838a01356001600160a01b038116811461048b578c8dfd5b8152838201358a8201529183013591888311156104a6578b8cfd5b6104b48e8b858701016104dd565b9181019190915286525050928501929085019060010161043c565b509098975050505050505050565b600082601f8301126104ed578081fd5b813567ffffffffffffffff81111561050157fe5b610514601f8201601f19166020016106b6565b818152846020838601011115610528578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610553578081fd5b813567ffffffffffffffff811115610569578182fd5b610575848285016103fc565b949350505050565b6000806040838503121561058f578081fd5b823567ffffffffffffffff8111156105a5578182fd5b6105b1858286016103fc565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561064257828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061062281838901858b016106da565b9a87019a601f01601f1916959095019094019350908401906001016105dc565b5091979650505050505050565b600082516106618184602087016106da565b9190910192915050565b90815260200190565b60008382526040602083015261057560408301846105c0565b6000848252606060208301526106a660608301856105c0565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106d257fe5b604052919050565b60005b838110156106f55781810151838201526020016106dd565b83811115610704576000848401525b5050505056fea264697066735822122031e1de225ca854a2d24e8bfeec9483910fe0e35e45fa56ae9572ece077aa61a564736f6c63430007060033

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610542565b6100ba565b604051610072929190610674565b60405180910390f35b610083610231565b604051610072919061066b565b610083610235565b6100ab6100a636600461057d565b61023d565b6040516100729392919061068d565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103d9565b8152602001906001900390816100f65790505b50905060005b835181101561022b57600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b03168585604051610194919061064f565b60006040518083038160008787f1925050503d80600081146101d2576040519150601f19603f3d011682016040523d82523d6000602084013e6101d7565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061020c57fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561025e57600080fd5b5060405190808252806020026020018201604052801561029857816020015b6102856103d9565b81526020019060019003908161027d5790505b50915060005b85518110156103c95760008060008884815181106102b857fe5b6020026020010151600001518985815181106102d057fe5b6020026020010151602001518a86815181106102e857fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b0316858560405161031b919061064f565b60006040518083038160008787f1925050503d8060008114610359576040519150601f19603f3d011682016040523d82523d6000602084013e61035e565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a898151811061039357fe5b60200260200101819052508b5a10156103b657509596506103d295505050505050565b50506001909501945061029e9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f83011261040c578081fd5b8135602067ffffffffffffffff8083111561042357fe5b61043082838502016106b6565b83815282810190868401865b868110156104cf5781358901606080601f19838e0301121561045c57898afd5b604080518281018181108a8211171561047157fe5b8252838a01356001600160a01b038116811461048b578c8dfd5b8152838201358a8201529183013591888311156104a6578b8cfd5b6104b48e8b858701016104dd565b9181019190915286525050928501929085019060010161043c565b509098975050505050505050565b600082601f8301126104ed578081fd5b813567ffffffffffffffff81111561050157fe5b610514601f8201601f19166020016106b6565b818152846020838601011115610528578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610553578081fd5b813567ffffffffffffffff811115610569578182fd5b610575848285016103fc565b949350505050565b6000806040838503121561058f578081fd5b823567ffffffffffffffff8111156105a5578182fd5b6105b1858286016103fc565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561064257828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061062281838901858b016106da565b9a87019a601f01601f1916959095019094019350908401906001016105dc565b5091979650505050505050565b600082516106618184602087016106da565b9190910192915050565b90815260200190565b60008382526040602083015261057560408301846105c0565b6000848252606060208301526106a660608301856105c0565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106d257fe5b604052919050565b60005b838110156106f55781810151838201526020016106dd565b83811115610704576000848401525b5050505056fea264697066735822122031e1de225ca854a2d24e8bfeec9483910fe0e35e45fa56ae9572ece077aa61a564736f6c63430007060033