I'm searching for an example Smart Contract snippet for staking and unstaking a token, for example how KARMA / POKER / DICE are working.

If I stake the token, I'm able to collect dividends. If I unstake, I don't get dividends anymore, and the unstaking takes - for example - 24 hours.

Any example contract for staking / unstaking a custom token?


1 Answer 1


You can find the contract used by eos for this purpose in the github repository.

In this file you can find, for instance, the 72 hours delay defined as static constexpr time refund_delay = 3*24*3600; and all the actions and structure needed to stake and unstake the resources.

Look also at this article from eoscanada.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.