ChainGreets — Docs

Architecture · Smart Contracts · Integration · SC Deployment Guide

Table of Contents
Overview
ChainGreets v1.1
Multi-chain · EVM · No backend

ChainGreets is a multi-chain EVM DApp for sending daily on-chain greetings (GM / GN) across testnets and mainnets. Each action is limited to 1 per chain per day per wallet.

GM and GN calls go directly to the deployed smart contract via gm() or gn(). The daily limit is enforced onchain via a dayIndex (block.timestamp / 86400, UTC). A GM or GN event is emitted and indexed by Blockscout. Currently 8 testnets and 15 mainnets have SCs deployed.

Deployed SCs — testnets GM & GN
Chain ChainId SC Address Deploy Block GM SC GN SC
Ethereum Sepolia
111551110xcF9c…8FA / 0x5De3…66D77 800 000
Base Sepolia
845320x5117…300 / 0xcF9c…8FA22 000 000
Arb Sepolia
4216140xb691…635 / 0xa5c8…C77120 000 000
OP Sepolia
111554200xb691…635 / 0xa5c8…C7724 000 000
Soneium Minato
19460x84A7…C10 / 0xc716…b7A7 500 000
Robinhood Testnet
460030x5117…300 / 0xcF9c…8FA50 000
Arc Testnet
51845420xa5c8…C77 / 0x73A3…e2330 000 000
MegaETH Testnet v2
63430xb691…635 / 0x84A7…C1013 521 901
Tempo Testnet
0xa5bf not deployed pending pending
🌐
Deployed SCs — mainnets
GM 0xb691…635 · GN 0xAC39…6Db
ChainChainIdGM BlockGN BlockGM SCGN SC
Base
845343 357 63443 359 071
Arbitrum
42161441 763 485441 766 590
Ethereum
124 657 01724 657 073
Soneium
186820 186 11020 186 452
MegaETH
432610 710 02110 710 692
Unichain
13042 758 72742 759 393
Ink
5707340 008 73040 009 391
OP
10148 954 205148 954 537
Katana
73560726 764 42326 765 140
Linea
5914429 704 15629 704 318
HyperEVM
99929 741 26829 741 904
Monad
14361 410 45461 411 446
Plume
9886654 376 50754 376 639
Superposition
552442 884 8792 884 883
Polygon
13784 195 36584 195 266
Pending deployments — next steps
PriorityActionChainsFiles impacted
Planned GM + GN SC Tempo Testnet actions.jsgm-feed.jsgm-dashboard.html
Next Leaderboard multi-chain All chains gm-dashboard.html
Next NFT Mint on GM/GN TBD New contract + UI
SC Integration Guide — adding a new chain
⚠️
After each SC deployment, retrieve the exact contract creation block from the explorer (Contract Creator → block #). Never leave deployBlock: 0 in production.
☀️
Add GM SC on a testnet
e.g. Tempo Testnet
1
js/actions.js — GM_CONTRACTS Add to the GM_CONTRACTS object:
'0xa5bf': '0xADRESSE_SC', // Tempo Testnet
2
js/gm-feed.js — TESTNET_SC Add to the TESTNET_SC object (key = decimal ethChainId):
CHAIN_ID_DEC: { contract, blockscoutBase, explorerTxBase, deployBlock, rpcUrl, rpcBlockWindow }
3
js/gm-feed-events.js — GM_EVENT_CHAINS Add an entry to the GM_EVENT_CHAINS array with enabled: true.
4
gm-dashboard.html — CHAINS Add to the local CHAINS array in the dashboard.
5
js/chains-feed.js — FEED_CHAINS Add the testnet entry (with test:true and Blockscout URL in exp).
Transaction Anatomy
GM / GN via Smart Contract
testnets & mainnets
FieldValue
toDeployed SC address for the chain
valueProtocol fee in native token — see fee table below
data (GM)Selector gm() = 0xc0129d43
data (GN)Selector gn() = 0x3118f543
event GMGM(address indexed sender, uint256 indexed dayIndex, uint256 timestamp, uint256 feePaid)
event GNGN(address indexed sender, uint256 indexed dayIndex, uint256 timestamp, uint256 feePaid)
dayIndexblock.timestamp / 86400 — UTC, resets at midnight
limit1 GM and 1 GN per wallet per chain per day — enforced onchain
Feed & Dashboard — data sources
📡
Fetch strategy by mode
SituationPrimary sourceFallbackAPI Key
GM / GN SC events (testnets) Blockscout getLogs (topic0+topic2+dayIndex) ethers.js RPC Not required
Dashboard — chains with Blockscout Blockscout API v2 /addresses/{SC}/transactions Not required
Dashboard — chains without Blockscout API RPC eth_getLogs direct Not required
In-memory cache

Each fetch is cached in memory for 45 seconds, keyed by chainId:msgFilter:timeFilter (gm-feed) or chainKey (gm-feed-events). The cache is invalidated on chain or period change.

For long periods (1 month, all time), fetches are batched in groups of 5 dayIndex in parallel with progress display.

Protocol Fees
💰
Per-chain config — FEE_CONFIG
chains-index.js
Chain(s)TokenAmount~USD
ETH testnetsETH (testnet)0.0000123 ETH
ETH mainnets (Base, Arb, ETH, OP, Linea…)ETH0.00000123 ETH~$0.003
HyperEVMHYPE0.000123 HYPE<$0.01
PlumePLUME0.123 PLUME<$0.01
MonadMON0.123 MON<$0.01
Arc TestnetUSDC (native)0.0123 USDC
Tempo TestnetpathUSD0.0123 pathUSD

All mainnet fees are set to stay under $0.01 — approximately the cost of gas alone. Fees cover hosting, domain, and development tooling costs.

File Structure
FileRoleSC update needed
js/chains-index.jsCHAINS, FEE_CONFIG, faucets — home pageYes — feeConfig + remove chain
js/actions.jsGM/GN SC routing, GM_CONTRACTS + GN_CONTRACTSYes — always
js/gm-feed.jsGM/GN SC event feed via Blockscout getLogs + RPC fallbackYes — TESTNET_SC
js/gm-feed-events.jsSC events feed, D3 graph, period filtersYes — GM_EVENT_CHAINS
js/chains-feed.jsFEED_CHAINS for gm-feed + dashboardYes — add testnet/mainnet
gm-dashboard.htmlSC events analytics dashboard (D3, Chart.js)Yes — local CHAINS
js/ui.jsChain card rendering, Done today badgeNo
js/wallet.jsEIP-6963, connect, switch, add chainNo
js/state.jslocalStorage: streak, TX history, daily limitsNo
js/modal.jsSuccess modal after GM/GNNo
css/style.cssGlobal design system (tokens, components)No
css/gm-feed.cssFeed-specific stylesNo