Overview
APE Balance
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
AstraInterfaceMulticallV2
Compiler Version
v0.7.6+commit.7338295f
Contract Source Code (Solidity)
/** *Submitted for verification at apescan.io on 2024-10-20 */ // SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; /// @notice A fork of MultiCall with gas limit contract AstraInterfaceMulticallV2 { 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 Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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 AstraInterfaceMulticallV2.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 AstraInterfaceMulticallV2.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 AstraInterfaceMulticallV2.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 AstraInterfaceMulticallV2.Result[]","name":"returnData","type":"tuple[]"},{"internalType":"uint256","name":"lastSuccessIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50610740806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610542565b6100ba565b604051610072929190610674565b60405180910390f35b610083610231565b604051610072919061066b565b610083610235565b6100ab6100a636600461057d565b61023d565b6040516100729392919061068d565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103d9565b8152602001906001900390816100f65790505b50905060005b835181101561022b57600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b03168585604051610194919061064f565b60006040518083038160008787f1925050503d80600081146101d2576040519150601f19603f3d011682016040523d82523d6000602084013e6101d7565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061020c57fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561025e57600080fd5b5060405190808252806020026020018201604052801561029857816020015b6102856103d9565b81526020019060019003908161027d5790505b50915060005b85518110156103c95760008060008884815181106102b857fe5b6020026020010151600001518985815181106102d057fe5b6020026020010151602001518a86815181106102e857fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b0316858560405161031b919061064f565b60006040518083038160008787f1925050503d8060008114610359576040519150601f19603f3d011682016040523d82523d6000602084013e61035e565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a898151811061039357fe5b60200260200101819052508b5a10156103b657509596506103d295505050505050565b50506001909501945061029e9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f83011261040c578081fd5b8135602067ffffffffffffffff8083111561042357fe5b61043082838502016106b6565b83815282810190868401865b868110156104cf5781358901606080601f19838e0301121561045c57898afd5b604080518281018181108a8211171561047157fe5b8252838a01356001600160a01b038116811461048b578c8dfd5b8152838201358a8201529183013591888311156104a6578b8cfd5b6104b48e8b858701016104dd565b9181019190915286525050928501929085019060010161043c565b509098975050505050505050565b600082601f8301126104ed578081fd5b813567ffffffffffffffff81111561050157fe5b610514601f8201601f19166020016106b6565b818152846020838601011115610528578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610553578081fd5b813567ffffffffffffffff811115610569578182fd5b610575848285016103fc565b949350505050565b6000806040838503121561058f578081fd5b823567ffffffffffffffff8111156105a5578182fd5b6105b1858286016103fc565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561064257828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061062281838901858b016106da565b9a87019a601f01601f1916959095019094019350908401906001016105dc565b5091979650505050505050565b600082516106618184602087016106da565b9190910192915050565b90815260200190565b60008382526040602083015261057560408301846105c0565b6000848252606060208301526106a660608301856105c0565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106d257fe5b604052919050565b60005b838110156106f55781810151838201526020016106dd565b83811115610704576000848401525b5050505056fea26469706673582212205c3737742b534f6ed67a90cf91f0649ca38595d3af4f6075ed85cd779a71886c64736f6c63430007060033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631749e1e3146100515780632a7228391461007b5780632ddb301b14610090578063d8f9584314610098575b600080fd5b61006461005f366004610542565b6100ba565b604051610072929190610674565b60405180910390f35b610083610231565b604051610072919061066b565b610083610235565b6100ab6100a636600461057d565b61023d565b6040516100729392919061068d565b8051439060609067ffffffffffffffff811180156100d757600080fd5b5060405190808252806020026020018201604052801561011157816020015b6100fe6103d9565b8152602001906001900390816100f65790505b50905060005b835181101561022b57600080600086848151811061013157fe5b60200260200101516000015187858151811061014957fe5b60200260200101516020015188868151811061016157fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b03168585604051610194919061064f565b60006040518083038160008787f1925050503d80600081146101d2576040519150601f19603f3d011682016040523d82523d6000602084013e6101d7565b606091505b509150915060005a84039050604051806060016040528084151581526020018281526020018381525089898151811061020c57fe5b6020026020010181905250505050505050508080600101915050610117565b50915091565b4590565b60005a905090565b600060606000439250845167ffffffffffffffff8111801561025e57600080fd5b5060405190808252806020026020018201604052801561029857816020015b6102856103d9565b81526020019060019003908161027d5790505b50915060005b85518110156103c95760008060008884815181106102b857fe5b6020026020010151600001518985815181106102d057fe5b6020026020010151602001518a86815181106102e857fe5b60200260200101516040015192509250925060005a9050600080856001600160a01b0316858560405161031b919061064f565b60006040518083038160008787f1925050503d8060008114610359576040519150601f19603f3d011682016040523d82523d6000602084013e61035e565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508a898151811061039357fe5b60200260200101819052508b5a10156103b657509596506103d295505050505050565b50506001909501945061029e9350505050565b50508351600019015b9250925092565b604051806060016040528060001515815260200160008152602001606081525090565b600082601f83011261040c578081fd5b8135602067ffffffffffffffff8083111561042357fe5b61043082838502016106b6565b83815282810190868401865b868110156104cf5781358901606080601f19838e0301121561045c57898afd5b604080518281018181108a8211171561047157fe5b8252838a01356001600160a01b038116811461048b578c8dfd5b8152838201358a8201529183013591888311156104a6578b8cfd5b6104b48e8b858701016104dd565b9181019190915286525050928501929085019060010161043c565b509098975050505050505050565b600082601f8301126104ed578081fd5b813567ffffffffffffffff81111561050157fe5b610514601f8201601f19166020016106b6565b818152846020838601011115610528578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610553578081fd5b813567ffffffffffffffff811115610569578182fd5b610575848285016103fc565b949350505050565b6000806040838503121561058f578081fd5b823567ffffffffffffffff8111156105a5578182fd5b6105b1858286016103fc565b95602094909401359450505050565b6000815180845260208085018081965082840281019150828601855b8581101561064257828403895281518051151585528581015186860152604090810151606091860182905280519186018290529060809061062281838901858b016106da565b9a87019a601f01601f1916959095019094019350908401906001016105dc565b5091979650505050505050565b600082516106618184602087016106da565b9190910192915050565b90815260200190565b60008382526040602083015261057560408301846105c0565b6000848252606060208301526106a660608301856105c0565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156106d257fe5b604052919050565b60005b838110156106f55781810151838201526020016106dd565b83811115610704576000848401525b5050505056fea26469706673582212205c3737742b534f6ed67a90cf91f0649ca38595d3af4f6075ed85cd779a71886c64736f6c63430007060033
Deployed Bytecode Sourcemap
129:2155:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;382:717;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;2095:92;;;:::i;:::-;;;;;;;:::i;2195:86::-;;;:::i;1107:980::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;:::i;382:717::-;561:12;;512;;459:26;;548;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;535:39;;592:9;587:505;611:5;:12;607:1;:16;587:505;;;646:14;662:16;680:21;724:5;730:1;724:8;;;;;;;;;;;;;;:15;;;758:5;764:1;758:8;;;;;;;;;;;;;;:17;;;794:5;800:1;794:8;;;;;;;;;;;;;;:17;;;645:181;;;;;;843:21;867:9;843:33;;892:12;906:16;926:6;-1:-1:-1;;;;;926:11:0;943:8;953;926:36;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;891:71;;;;977:15;1011:9;995:13;:25;977:43;;1051:29;;;;;;;;1058:7;1051:29;;;;;;1067:7;1051:29;;;;1076:3;1051:29;;;1035:10;1046:1;1035:13;;;;;;;;;;;;;:45;;;;587:505;;;;;;;625:3;;;;;;;587:505;;;;382:717;;;:::o;2095:92::-;2165:14;2095:92;:::o;2195:86::-;2237:7;2264:9;2257:16;;2195:86;:::o;1107:980::-;1224:19;1245:26;1273:24;1324:12;1310:26;;1373:5;:12;1360:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;1347:39;;1404:9;1399:618;1423:5;:12;1419:1;:16;1399:618;;;1458:14;1474:16;1492:21;1536:5;1542:1;1536:8;;;;;;;;;;;;;;:15;;;1570:5;1576:1;1570:8;;;;;;;;;;;;;;:17;;;1606:5;1612:1;1606:8;;;;;;;;;;;;;;:17;;;1457:181;;;;;;1655:21;1679:9;1655:33;;1704:12;1718:16;1738:6;-1:-1:-1;;;;;1738:11:0;1755:8;1765;1738:36;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1703:71;;;;1789:15;1823:9;1807:13;:25;1789:43;;1863:29;;;;;;;;1870:7;1863:29;;;;;;1879:7;1863:29;;;;1888:3;1863:29;;;1847:10;1858:1;1847:13;;;;;;;;;;;;;:45;;;;1925:9;1913;:21;1909:97;;;-1:-1:-1;1988:1:0;;-1:-1:-1;1955:35:0;;-1:-1:-1;;;;;;1955:35:0;1909:97;-1:-1:-1;;1437:3:0;;;;;-1:-1:-1;1399:618:0;;-1:-1:-1;;;;1399:618:0;;-1:-1:-1;;2062:12:0;;-1:-1:-1;;2062:16:0;1107:980;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:1477:1:-;;132:3;125:4;117:6;113:17;109:27;99:2;;154:5;147;140:20;99:2;194:6;181:20;220:4;243:18;280:2;276;273:10;270:2;;;286:9;270:2;317:36;349:2;344;340;336:11;332:20;317:36;:::i;:::-;387:15;;;418:12;;;;450:15;;;483:5;497:965;511:2;508:1;505:9;497:965;;;591:3;578:17;570:6;566:30;619:4;671:2;665;661:7;656:2;651:3;647:12;643:26;639:35;636:2;;;691:5;684;677:20;636:2;722;757;751:9;803:2;795:6;791:15;860:6;848:10;845:22;840:2;828:10;825:18;822:46;819:2;;;871:9;819:2;895:22;;956:11;;;943:25;-1:-1:-1;;;;;1001:31:1;;991:42;;981:2;;1051:5;1044;1037:20;981:2;1072:21;;1143:11;;;1130:25;1113:15;;;1106:50;1198:11;;;1185:25;;1226:16;;;1223:2;;;1259:5;1252;1245:20;1223:2;1304:51;1351:3;1346:2;1335:8;1331:2;1327:17;1323:26;1304:51;:::i;:::-;1287:15;;;1280:76;;;;1369:19;;-1:-1:-1;;1408:12:1;;;;1440;;;;529:1;522:9;497:965;;;-1:-1:-1;1480:5:1;;89:1402;-1:-1:-1;;;;;;;;89:1402:1:o;1496:542::-;;1593:3;1586:4;1578:6;1574:17;1570:27;1560:2;;1615:5;1608;1601:20;1560:2;1655:6;1642:20;1681:18;1677:2;1674:26;1671:2;;;1703:9;1671:2;1738:54;1780:2;1761:13;;-1:-1:-1;;1757:27:1;1786:4;1753:38;1738:54;:::i;:::-;1817:2;1808:7;1801:19;1863:3;1856:4;1851:2;1843:6;1839:15;1835:26;1832:35;1829:2;;;1884:5;1877;1870:20;1829:2;1953;1946:4;1938:6;1934:17;1927:4;1918:7;1914:18;1901:55;1976:16;;;1994:4;1972:27;1965:42;;;;1980:7;1550:488;-1:-1:-1;;1550:488:1:o;2043:399::-;;2200:2;2188:9;2179:7;2175:23;2171:32;2168:2;;;2221:6;2213;2206:22;2168:2;2266:9;2253:23;2299:18;2291:6;2288:30;2285:2;;;2336:6;2328;2321:22;2285:2;2364:72;2428:7;2419:6;2408:9;2404:22;2364:72;:::i;:::-;2354:82;2158:284;-1:-1:-1;;;;2158:284:1:o;2447:467::-;;;2621:2;2609:9;2600:7;2596:23;2592:32;2589:2;;;2642:6;2634;2627:22;2589:2;2687:9;2674:23;2720:18;2712:6;2709:30;2706:2;;;2757:6;2749;2742:22;2706:2;2785:72;2849:7;2840:6;2829:9;2825:22;2785:72;:::i;:::-;2775:82;2904:2;2889:18;;;;2876:32;;-1:-1:-1;;;;2579:335:1:o;2919:1131::-;;3023:5;3017:12;3050:6;3045:3;3038:19;3076:4;3117:2;3112:3;3108:12;3142:11;3169;3162:18;;3224:2;3216:6;3212:15;3205:5;3201:27;3189:39;;3262:2;3255:5;3251:14;3283:3;3295:729;3309:6;3306:1;3303:13;3295:729;;;3370:16;;;3358:29;;3410:13;;3490:9;;3483:17;3476:25;3463:39;;3543:11;;;3537:18;3522:13;;;3515:41;3579:4;3622:11;;;3616:18;3446:4;3654:13;;;3647:25;;;3701:19;;3740:13;;;3733:31;;;3616:18;3787:3;;3803:69;3701:19;3848:13;;;3825:21;;;3803:69;:::i;:::-;4002:12;;;;3934:2;3911:17;-1:-1:-1;;3907:31:1;3897:42;;;;3893:51;;;;-1:-1:-1;3967:15:1;;;;3331:1;3324:9;3295:729;;;-1:-1:-1;4040:4:1;;2993:1057;-1:-1:-1;;;;;;;2993:1057:1:o;4055:274::-;;4222:6;4216:13;4238:53;4284:6;4279:3;4272:4;4264:6;4260:17;4238:53;:::i;:::-;4307:16;;;;;4192:137;-1:-1:-1;;4192:137:1:o;4334:177::-;4480:25;;;4468:2;4453:18;;4435:76::o;4516:389::-;;4767:6;4756:9;4749:25;4810:2;4805;4794:9;4790:18;4783:30;4830:69;4895:2;4884:9;4880:18;4872:6;4830:69;:::i;4910:460::-;;5189:6;5178:9;5171:25;5232:2;5227;5216:9;5212:18;5205:30;5252:69;5317:2;5306:9;5302:18;5294:6;5252:69;:::i;:::-;5244:77;;5357:6;5352:2;5341:9;5337:18;5330:34;5161:209;;;;;;:::o;5375:242::-;5445:2;5439:9;5475:17;;;5522:18;5507:34;;5543:22;;;5504:62;5501:2;;;5569:9;5501:2;5596;5589:22;5419:198;;-1:-1:-1;5419:198:1:o;5622:258::-;5694:1;5704:113;5718:6;5715:1;5712:13;5704:113;;;5794:11;;;5788:18;5775:11;;;5768:39;5740:2;5733:10;5704:113;;;5835:6;5832:1;5829:13;5826:2;;;5870:1;5861:6;5856:3;5852:16;5845:27;5826:2;;5675:205;;;:::o
Swarm Source
ipfs://5c3737742b534f6ed67a90cf91f0649ca38595d3af4f6075ed85cd779a71886c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.