Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x45ADe1Bc...eaBa48F38 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Counter
Compiler Version
v0.8.0+commit.c7dfd78e
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-06-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IGmpReceiver { function onGmpReceived( bytes32 id, uint128 network, bytes32 source, bytes calldata payload ) external payable returns (bytes32); } contract Counter is IGmpReceiver { address private immutable _gateway; uint256 public number; constructor(address gateway) { _gateway = gateway; } function onGmpReceived( bytes32 id, uint128 network, bytes32 source, bytes calldata payload ) external payable override returns (bytes32) { require(msg.sender == _gateway, "unauthorized"); number++; return bytes32(number); } }
[{"inputs":[{"internalType":"address","name":"gateway","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"number","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"uint128","name":"network","type":"uint128"},{"internalType":"bytes32","name":"source","type":"bytes32"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"onGmpReceived","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"}]
Deployed Bytecode
0x6080604052600436106100295760003560e01c8063019009371461002e5780638381f58a1461005e575b600080fd5b610048600480360381019061004391906101bb565b610089565b6040516100559190610299565b60405180910390f35b34801561006a57600080fd5b50610073610141565b60405161008091906102d4565b60405180910390f35b60007f000000000000000000000000000000007f56768de3133034fa730a909003a16573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610119576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610110906102b4565b60405180910390fd5b60008081548092919061012b90610330565b919050555060005460001b905095945050505050565b60005481565b600081359050610156816103a8565b92915050565b60008083601f84011261016e57600080fd5b8235905067ffffffffffffffff81111561018757600080fd5b60208301915083600182028301111561019f57600080fd5b9250929050565b6000813590506101b5816103bf565b92915050565b6000806000806000608086880312156101d357600080fd5b60006101e188828901610147565b95505060206101f2888289016101a6565b945050604061020388828901610147565b935050606086013567ffffffffffffffff81111561022057600080fd5b61022c8882890161015c565b92509250509295509295909350565b61024481610300565b82525050565b6000610257600c836102ef565b91507f756e617574686f72697a656400000000000000000000000000000000000000006000830152602082019050919050565b61029381610326565b82525050565b60006020820190506102ae600083018461023b565b92915050565b600060208201905081810360008301526102cd8161024a565b9050919050565b60006020820190506102e9600083018461028a565b92915050565b600082825260208201905092915050565b6000819050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061033b82610326565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561036e5761036d610379565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6103b181610300565b81146103bc57600080fd5b50565b6103c88161030a565b81146103d357600080fd5b5056fea2646970667358221220c6581961b7446a3c3d4921db51047d7c2a06bd8830cd68e7fc853a45715b765664736f6c63430008000033
Deployed Bytecode Sourcemap
267:485:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;452:297;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;348:21;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;452:297;622:7;664:8;650:22;;:10;:22;;;642:47;;;;;;;;;;;;:::i;:::-;;;;;;;;;700:6;;:8;;;;;;;;;:::i;:::-;;;;;;734:6;;726:15;;719:22;;452:297;;;;;;;:::o;348:21::-;;;;:::o;7:139:1:-;;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;59:87;;;;:::o;165:351::-;;;282:3;275:4;267:6;263:17;259:27;249:2;;300:1;297;290:12;249:2;336:6;323:20;313:30;;366:18;358:6;355:30;352:2;;;398:1;395;388:12;352:2;435:4;427:6;423:17;411:29;;489:3;481:4;473:6;469:17;459:8;455:32;452:41;449:2;;;506:1;503;496:12;449:2;239:277;;;;;:::o;522:139::-;;606:6;593:20;584:29;;622:33;649:5;622:33;:::i;:::-;574:87;;;;:::o;667:829::-;;;;;;845:3;833:9;824:7;820:23;816:33;813:2;;;862:1;859;852:12;813:2;905:1;930:53;975:7;966:6;955:9;951:22;930:53;:::i;:::-;920:63;;876:117;1032:2;1058:53;1103:7;1094:6;1083:9;1079:22;1058:53;:::i;:::-;1048:63;;1003:118;1160:2;1186:53;1231:7;1222:6;1211:9;1207:22;1186:53;:::i;:::-;1176:63;;1131:118;1316:2;1305:9;1301:18;1288:32;1347:18;1339:6;1336:30;1333:2;;;1379:1;1376;1369:12;1333:2;1415:64;1471:7;1462:6;1451:9;1447:22;1415:64;:::i;:::-;1397:82;;;;1259:230;803:693;;;;;;;;:::o;1502:118::-;1589:24;1607:5;1589:24;:::i;:::-;1584:3;1577:37;1567:53;;:::o;1626:310::-;;1789:67;1853:2;1848:3;1789:67;:::i;:::-;1782:74;;1886:14;1882:1;1877:3;1873:11;1866:35;1927:2;1922:3;1918:12;1911:19;;1772:164;;;:::o;1942:118::-;2029:24;2047:5;2029:24;:::i;:::-;2024:3;2017:37;2007:53;;:::o;2066:222::-;;2197:2;2186:9;2182:18;2174:26;;2210:71;2278:1;2267:9;2263:17;2254:6;2210:71;:::i;:::-;2164:124;;;;:::o;2294:419::-;;2498:2;2487:9;2483:18;2475:26;;2547:9;2541:4;2537:20;2533:1;2522:9;2518:17;2511:47;2575:131;2701:4;2575:131;:::i;:::-;2567:139;;2465:248;;;:::o;2719:222::-;;2850:2;2839:9;2835:18;2827:26;;2863:71;2931:1;2920:9;2916:17;2907:6;2863:71;:::i;:::-;2817:124;;;;:::o;2947:169::-;;3065:6;3060:3;3053:19;3105:4;3100:3;3096:14;3081:29;;3043:73;;;;:::o;3122:77::-;;3188:5;3177:16;;3167:32;;;:::o;3205:118::-;;3282:34;3275:5;3271:46;3260:57;;3250:73;;;:::o;3329:77::-;;3395:5;3384:16;;3374:32;;;:::o;3412:233::-;;3474:24;3492:5;3474:24;:::i;:::-;3465:33;;3520:66;3513:5;3510:77;3507:2;;;3590:18;;:::i;:::-;3507:2;3637:1;3630:5;3626:13;3619:20;;3455:190;;;:::o;3651:180::-;3699:77;3696:1;3689:88;3796:4;3793:1;3786:15;3820:4;3817:1;3810:15;3837:122;3910:24;3928:5;3910:24;:::i;:::-;3903:5;3900:35;3890:2;;3949:1;3946;3939:12;3890:2;3880:79;:::o;3965:122::-;4038:24;4056:5;4038:24;:::i;:::-;4031:5;4028:35;4018:2;;4077:1;4074;4067:12;4018:2;4008:79;:::o
Swarm Source
ipfs://c6581961b7446a3c3d4921db51047d7c2a06bd8830cd68e7fc853a45715b7656
Loading...
Loading
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.