Source Code
Overview
S Balance
S Value
$0.00Latest 25 from a total of 36,205 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| On Chain GM | 37730543 | 199 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 34746532 | 219 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 34574352 | 220 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 34384589 | 221 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 33646499 | 225 days ago | IN | 0.2 S | 0.00234432 | ||||
| On Chain GM | 33131991 | 227 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 33108632 | 228 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 33091523 | 228 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32958314 | 228 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32889766 | 229 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32835317 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32801496 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32768527 | 229 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32767725 | 229 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32749373 | 229 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32715250 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32714135 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32697807 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32697155 | 229 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32658433 | 230 days ago | IN | 0.2 S | 0.00214935 | ||||
| On Chain GM | 32653899 | 230 days ago | IN | 0.2 S | 0.0018602 | ||||
| On Chain GM | 32635746 | 230 days ago | IN | 0.2 S | 0.00313705 | ||||
| On Chain GM | 32633304 | 230 days ago | IN | 0.2 S | 0.00313705 | ||||
| On Chain GM | 32627912 | 230 days ago | IN | 0.2 S | 0.00221342 | ||||
| On Chain GM | 32620698 | 230 days ago | IN | 0.2 S | 0.00214935 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 37730543 | 199 days ago | 0.2 S | ||||
| 34746532 | 219 days ago | 0.2 S | ||||
| 34574352 | 220 days ago | 0.2 S | ||||
| 34384589 | 221 days ago | 0.2 S | ||||
| 33646499 | 225 days ago | 0.2 S | ||||
| 33131991 | 227 days ago | 0.2 S | ||||
| 33108632 | 228 days ago | 0.2 S | ||||
| 33091523 | 228 days ago | 0.2 S | ||||
| 32958314 | 228 days ago | 0.2 S | ||||
| 32889766 | 229 days ago | 0.2 S | ||||
| 32835317 | 229 days ago | 0.2 S | ||||
| 32801496 | 229 days ago | 0.2 S | ||||
| 32768527 | 229 days ago | 0.2 S | ||||
| 32767725 | 229 days ago | 0.2 S | ||||
| 32749373 | 229 days ago | 0.2 S | ||||
| 32715250 | 229 days ago | 0.2 S | ||||
| 32714135 | 229 days ago | 0.2 S | ||||
| 32697807 | 229 days ago | 0.2 S | ||||
| 32697155 | 229 days ago | 0.2 S | ||||
| 32658433 | 230 days ago | 0.2 S | ||||
| 32653899 | 230 days ago | 0.2 S | ||||
| 32635746 | 230 days ago | 0.2 S | ||||
| 32633304 | 230 days ago | 0.2 S | ||||
| 32627912 | 230 days ago | 0.2 S | ||||
| 32620698 | 230 days ago | 0.2 S |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OnChainGM
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/**
*Submitted for verification at SonicScan.org on 2025-03-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
contract OnChainGM {
// Immutable variables don't use storage slots
address public immutable feeRecipient;
uint256 public immutable GM_FEE;
uint256 public constant TIME_LIMIT = 24 hours;
// Mapping to store last GM timestamp for each user
mapping(address => uint256) public lastGMTimestamp;
// Event for tracking GMs
event OnChainGMEvent(address indexed sender);
constructor() {
feeRecipient = 0x7500A83DF2aF99B2755c47B6B321a8217d876a85;
GM_FEE = 0.2 ether;
}
// Gas optimized GM function with timestamp check
function onChainGM() external payable {
if (msg.value != GM_FEE) {
revert("Incorrect ETH fee");
}
// Check if 24 hours have passed since last GM
if (!(block.timestamp >= lastGMTimestamp[msg.sender] + TIME_LIMIT || lastGMTimestamp[msg.sender] == 0)) {
revert("Wait 24 hours");
}
// Update last GM timestamp
lastGMTimestamp[msg.sender] = block.timestamp;
// Transfer fee after all checks
(bool success,) = feeRecipient.call{value: msg.value}("");
if (!success) {
revert("Fee transfer failed");
}
emit OnChainGMEvent(msg.sender);
}
// View function to check remaining time
function timeUntilNextGM(address user) external view returns (uint256) {
if (lastGMTimestamp[user] == 0) return 0;
uint256 timePassed = block.timestamp - lastGMTimestamp[user];
if (timePassed >= TIME_LIMIT) return 0;
return TIME_LIMIT - timePassed;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"OnChainGMEvent","type":"event"},{"inputs":[],"name":"GM_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIME_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastGMTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onChainGM","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"timeUntilNextGM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c0604052348015600e575f5ffd5b50737500a83df2af99b2755c47b6b321a8217d876a856080526702c68af0bb14000060a05260805160a0516105056100615f395f818161014d015261017101525f8181607801526102c401526105055ff3fe608060405260043610610063575f3560e01c80636bb6979f116100415780636bb6979f146100f25780638928a1d614610111578063e3ea4c4d1461013c575f5ffd5b806346904840146100675780635011b71c146100c4578063698224ae146100ce575b5f5ffd5b348015610072575f5ffd5b5061009a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100cc61016f565b005b3480156100d9575f5ffd5b506100e46201518081565b6040519081526020016100bb565b3480156100fd575f5ffd5b506100e461010c366004610443565b6103ba565b34801561011c575f5ffd5b506100e461012b366004610443565b5f6020819052908152604090205481565b348015610147575f5ffd5b506100e47f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000034146101fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e636f7272656374204554482066656500000000000000000000000000000060448201526064015b60405180910390fd5b335f9081526020819052604090205461021a9062015180906104a3565b421015806102345750335f90815260208190526040902054155b61029a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5761697420323420686f7572730000000000000000000000000000000000000060448201526064016101f4565b335f908152602081905260408082204290555173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169034908381818185875af1925050503d805f811461031d576040519150601f19603f3d011682016040523d82523d5f602084013e610322565b606091505b505090508061038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f466565207472616e73666572206661696c65640000000000000000000000000060448201526064016101f4565b60405133907f2c87d8ee91bb31c46c18656ab95c2c8175461ed9884084ef1ac6d7d029ac815b905f90a250565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526020819052604081205481036103ec57505f919050565b73ffffffffffffffffffffffffffffffffffffffff82165f9081526020819052604081205461041b90426104bc565b905062015180811061042f57505f92915050565b61043c81620151806104bc565b9392505050565b5f60208284031215610453575f5ffd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043c575f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156104b6576104b6610476565b92915050565b818103818111156104b6576104b661047656fea26469706673582212208c543df6ca3b8e4853107bf634103fbad48a778c99f176219279b6d7fbe7c38f64736f6c634300081c0033
Deployed Bytecode
0x608060405260043610610063575f3560e01c80636bb6979f116100415780636bb6979f146100f25780638928a1d614610111578063e3ea4c4d1461013c575f5ffd5b806346904840146100675780635011b71c146100c4578063698224ae146100ce575b5f5ffd5b348015610072575f5ffd5b5061009a7f0000000000000000000000007500a83df2af99b2755c47b6b321a8217d876a8581565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100cc61016f565b005b3480156100d9575f5ffd5b506100e46201518081565b6040519081526020016100bb565b3480156100fd575f5ffd5b506100e461010c366004610443565b6103ba565b34801561011c575f5ffd5b506100e461012b366004610443565b5f6020819052908152604090205481565b348015610147575f5ffd5b506100e47f00000000000000000000000000000000000000000000000002c68af0bb14000081565b7f00000000000000000000000000000000000000000000000002c68af0bb14000034146101fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e636f7272656374204554482066656500000000000000000000000000000060448201526064015b60405180910390fd5b335f9081526020819052604090205461021a9062015180906104a3565b421015806102345750335f90815260208190526040902054155b61029a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5761697420323420686f7572730000000000000000000000000000000000000060448201526064016101f4565b335f908152602081905260408082204290555173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007500a83df2af99b2755c47b6b321a8217d876a85169034908381818185875af1925050503d805f811461031d576040519150601f19603f3d011682016040523d82523d5f602084013e610322565b606091505b505090508061038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f466565207472616e73666572206661696c65640000000000000000000000000060448201526064016101f4565b60405133907f2c87d8ee91bb31c46c18656ab95c2c8175461ed9884084ef1ac6d7d029ac815b905f90a250565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526020819052604081205481036103ec57505f919050565b73ffffffffffffffffffffffffffffffffffffffff82165f9081526020819052604081205461041b90426104bc565b905062015180811061042f57505f92915050565b61043c81620151806104bc565b9392505050565b5f60208284031215610453575f5ffd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043c575f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156104b6576104b6610476565b92915050565b818103818111156104b6576104b661047656fea26469706673582212208c543df6ca3b8e4853107bf634103fbad48a778c99f176219279b6d7fbe7c38f64736f6c634300081c0033
Deployed Bytecode Sourcemap
61:1704:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;139:37;;;;;;;;;;;;;;;;;;190:42:1;178:55;;;160:74;;148:2;133:18;139:37:0;;;;;;;;673:720;;;:::i;:::-;;221:45;;;;;;;;;;;;258:8;221:45;;;;;391:25:1;;;379:2;364:18;221:45:0;245:177:1;1451:311:0;;;;;;;;;;-1:-1:-1;1451:311:0;;;;;:::i;:::-;;:::i;336:50::-;;;;;;;;;;-1:-1:-1;336:50:0;;;;;:::i;:::-;;;;;;;;;;;;;;;183:31;;;;;;;;;;;;;;;673:720;739:6;726:9;:19;722:79;;762:27;;;;;943:2:1;762:27:0;;;925:21:1;982:2;962:18;;;955:30;1021:19;1001:18;;;994:47;1058:18;;762:27:0;;;;;;;;722:79;918:10;902:15;:27;;;;;;;;;;;:40;;258:8;;902:40;:::i;:::-;883:15;:59;;:95;;;-1:-1:-1;962:10:0;946:15;:27;;;;;;;;;;;:32;883:95;877:154;;996:23;;;;;1608:2:1;996:23:0;;;1590:21:1;1647:2;1627:18;;;1620:30;1686:15;1666:18;;;1659:43;1719:18;;996:23:0;1406:337:1;877:154:0;1104:10;1088:15;:27;;;;;;;;;;;1118:15;1088:45;;1214:39;1088:27;1214:12;:17;;1239:9;;1088:15;1214:39;1088:15;1214:39;1239:9;1214:17;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1196:57;;;1269:7;1264:70;;1293:29;;;;;2160:2:1;1293:29:0;;;2142:21:1;2199:2;2179:18;;;2172:30;2238:21;2218:18;;;2211:49;2277:18;;1293:29:0;1958:343:1;1264:70:0;1359:26;;1374:10;;1359:26;;;;;711:682;673:720::o;1451:311::-;1537:21;;;1513:7;1537:21;;;;;;;;;;;:26;;1533:40;;-1:-1:-1;1572:1:0;;1451:311;-1:-1:-1;1451:311:0:o;1533:40::-;1633:21;;;1594:18;1633:21;;;;;;;;;;;1615:39;;:15;:39;:::i;:::-;1594:60;;258:8;1669:10;:24;1665:38;;-1:-1:-1;1702:1:0;;1451:311;-1:-1:-1;;1451:311:0:o;1665:38::-;1731:23;1744:10;258:8;1731:23;:::i;:::-;1724:30;1451:311;-1:-1:-1;;;1451:311:0:o;427:309:1:-;486:6;539:2;527:9;518:7;514:23;510:32;507:52;;;555:1;552;545:12;507:52;594:9;581:23;644:42;637:5;633:54;626:5;623:65;613:93;;702:1;699;692:12;1087:184;1139:77;1136:1;1129:88;1236:4;1233:1;1226:15;1260:4;1257:1;1250:15;1276:125;1341:9;;;1362:10;;;1359:36;;;1375:18;;:::i;:::-;1276:125;;;;:::o;2306:128::-;2373:9;;;2394:11;;;2391:37;;;2408:18;;:::i
Swarm Source
ipfs://8c543df6ca3b8e4853107bf634103fbad48a778c99f176219279b6d7fbe7c38f
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
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.