Skip to content

maxims94/solfit

Repository files navigation

SolFit

A gym with a built-in incentive to actually come and train.

Realized on the Solana blockchain.

Best explanation is here

Frontend

Screenshot

Solana program

What is stored on-chain per user?

{
  member_month: 7, // the last month the user paid for, 7 = July 2023
  num_avail: 4 // the number of available rewards for user in this month, range: 0-4, 1 reward = $10
}

What functions does the smart contract have?

  • start_membership
    • Simulates the user purchasing the membership for another month
    • Increments member_month
    • Resets num_avail to 4
    • The user must transfer $120 USDC to a PDA
    • Sample transaction
  • claim_reward
    • Only valid if num_avail is still > 0
    • In that case, it is decremented and $10 are sent back to the user as cashback
  • reset_user
    • For testing purposes
    • Sets member_month and num_avail to 0, essentially cancelling the membership
    • All of the USDC that is stored in the respective PDA is transferred back to them
  • Source code of the Solana Program

Deployment

  • On mainnet: 7bd3GWaR7h5X6ZAndStp9vD5NbQY5a7V9Q6UMMCm3tCd

Links

About

Pump & Earn! - The gym that incentivizes you to come

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published