Copy of SNIP-20 reference implementation.
Contract for buying FOOD tokens.
Contract for instancing and feeding pet.
Some of us still remember the times back when we had our first digital pets - Tamagochi. As kids it was very challenging to keep your pet fed, clean and happy.
Fast forward 20 years. Lets implement a basic Tamagochi logic.
-
Create a SNIP-20 token contract - called
FOOD
. -
Create a CosmWasm
Market
contract that gives the ability to the user to purchase SNIP-20 tokens to feed to their Pet. -
Create a CosmWasm
Pet
contract which implements a digital pet (Tamagochi like) interface, allowing one to feed the creature with SNIP-20/21/22/23 tokens.
FOOD
tokens can only be minted by the Market contract.FOOD
tokens can be purchased only with the native SCRT token in ratioSCRT/FOOD
-1:100
.- Feeding the
Pet
(sending thePet
contract aFOOD
token) should result in burningFOOD
tokens. Pet
should implement a countdown clock, which gets pushed4
hours ahead every time the pet gets fed.- If you miss feeding the
Pet
for more than 4 hours then thePet
will starve. - If a
Pet
starves to death then it cannot be fed any longer soFOOD
tokens shall be returned to the sender rather then burned.
- scrt.network
- https://github.com/SecretFoundation/SNIPs/blob/master/SNIP-20.md
- cosmwasm.com
- github.com/hackbg/fadroma