This deploys a smart contract on Solana to enable people to earn GM coin by just wishing "GM" on Solana blockchain. Smart contract enforces a cool off period so one has to wait before earning rewards.
init_associated_token
: Used to create a de-facto associated token for the mint for a given public key.initialize
: Initalize global variables for smart contract (e.g.cooloff_seconds
).fund
: Fund the vault from the original treasury/mint so it can be used to give GM tokens by the program.first_visit
: Every GM user must make a "first visit". This initializes user-specific PDA to track user visits.visit_again
: Every subsequent visit (1) records the visit count, (2) records the last timestamp of visit, (3) Ifcooloff_seconds
have elapsed since last visit, reward user with10 GM
coins.
See frontend repo.
anchor build
anchor test
DM me for any questions on twitter.