Skip to content
View OnChainGM's full-sized avatar

Block or report OnChainGM

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
OnChainGM/README.md

OnChainGM - Your Daily Web3 Ritual

OnChainGM is a smart contract that enables users to send a "GM" (Good Morning) transaction once every 24 hours on-chain. Each GM transaction requires a small ETH fee and is recorded on the blockchain. The project supports a referral-based reward system and tracks user activity on multiple networks.

🌞 OnChainGM

OnChainGM is a minimalist Ethereum smart contract that lets users send an on-chain β€œGM” (Good Morning) message once per day, optionally rewarding the person who referred them.


πŸš€ Features

  • βœ… Daily GM β€” only once per day per address
  • πŸ’Έ Optional referral reward (10% of the fee)
  • πŸ“¦ Emits events for every GM and failed referral
  • πŸ” Fully on-chain and permissionless

πŸ“„ Contract Info

  • Name: OnChainGM
  • Language: Solidity ^0.8.0
  • License: MIT
  • Fee: 0.000029 ETH (29,000 Gwei)

πŸ’Έ Fee Breakdown

Purpose Amount
Total Fee 0.000029 ETH
Referral Reward (10%) 0.0000029 ETH
Sent to Fee Recipient 0.0000261 ETH

βš™οΈ Functions

onChainGM(address referrer)

Send your daily GM and optionally specify a referrer.

  • Requires exactly 0.000029 ETH as msg.value
  • Emits OnChainGMEvent(sender, referrer)
  • If referrer is non-zero and transfer succeeds β†’ sends 10% of fee
  • If transfer fails β†’ logs ReferralFailed

timeUntilNextGM(address user) β†’ uint256

Returns how many seconds remain until the specified user can GM again.


🧾 Events

event OnChainGMEvent(address indexed sender, address indexed referrer);
event ReferralFailed(address indexed referrer, uint256 amount);

πŸ” How It Works

  1. User sends exactly 0.000029 ETH by calling onChainGM(referrer)
  2. Contract checks if msg.sender has already GMed today (based on UTC)
  3. If not:
    • Attempts to send 10% of fee to referrer
    • Sends remaining ETH to feeRecipient
    • Emits OnChainGMEvent
  4. If referral payment fails, logs ReferralFailed but does not revert

πŸ§ͺ Example (Remix / Etherscan)

onChainGM("0xYourReferrersAddress")

πŸ”” Be sure to send exactly 0.000029 ETH as value.


πŸ›  Deployment

The contract can be deployed to any EVM-compatible chain.
There is no owner, no upgradeability, and no admin β€” it's fully immutable.


🧭 License

MIT License β€” feel free to build on it, fork it, or integrate it into your dApp.


πŸ” Verified Deployment

This contract is deployed and verified on Optimism:

πŸ‘‰ View on Blockscout


- Network: **Optimism**
- Address: `0x98F935ed6BD5b749AdeA581B50aF2ff0C1F89dEC`
- Verified Source Code: βœ…

You can interact with it directly via Blockscout, Etherscan-compatible tools, or use it in your own dApps.

Popular repositories Loading

  1. OnChainGM OnChainGM Public

    Onchaingm contrats

    Solidity 5 1

  2. OnChainGM-Deploy OnChainGM-Deploy Public

    Solidity 3 1

  3. web web Public

    Forked from base/web

    base eco

    TypeScript 2

  4. OnChainGM-Cario OnChainGM-Cario Public

    2

  5. OnChainGMV2 OnChainGMV2 Public

    Solidity 1 1