I have issued some tokens base on eosio.token in jungle testnet, and I am able to transfer the tokens between accounts. Now if I want to enforce some control to the tokens sent ( for example, time lock, I do not want the receiver to transfer the tokens to someone else in 2 years). How should I program this function? Thank you for the help!

You cannot enforce time lock on eosio.token contract because you do not have ownership over the contract and you can't modify the logic in the contract.

However, you can create your own token contract based on eosio.token and add the time lock logic in your transfer function.

You will need to save the timestamp when the recipient receives the token into a vector or multi-index table depending on your requirements.

You can do that by slightly modifying your token contract.

Things what you need to do is add one more variable for timestamp in your account table or anything else that tracks users.

After that add timestamp by increasing it to two year when user purchase token.

Modify transfer function accordingly that every time checks that timestamp and allow users to transfer tokens after varification.

  • Thank you. Is there any code example that can show me how to create the lock ? – JackyZhang Sep 14 at 14:56

Hope this will be helpful for you!!! https://github.com/yashbhavsar007/tokentime

  • do you think you could paste here some of the relevant bits just in case the link won't point to an existing resource later on when others visit the question? – confused00 Sep 19 at 13:06
  • it cannot be understood from a little bit of code..but i will try to put it here if i manage to do so..and i will also manage not to remove code from my repo – Mr.Y Sep 19 at 13:11

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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