1

I'm asking because I would like certain KT1 addresses return the funds back to the owner after a certain amount of blocks

2

No, there is no built-in function for this. However, it can be accomplished with a smart contract, that when called by the owner after a certain deadline returns its balance. Currently, the deadline must be specified as a timestamp, but future versions of Michelson may include a LEVEL instruction (see this merge request). It returns the block level of the current transactions, and so could be used to implement the behavior your describing.

However, there is currently now way of "expiring" or "suiciding" a contract in Michelson. Deployed contracts stay on the block chain forever. However, you can implement the contract so that after a certain deadline (specified using a timestamp or the LEVEL instruction described above), all incoming calls are rejected.

  • Thank you for your answer. Say you reach that timestamp and there are still coins on the KT1 address, will those coins become untouchable in this scenerio? – Mack Baise Dec 2 '19 at 9:45
  • If you write the contract so that it always fails after the given timestamp, yes the tokens will be locked forever. – Julien Dec 2 '19 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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