Create resource with script


But I wish it were impossible to exchange below this price.
Then there is always:

To edit the script.


Yes, this line

case _ => true

allows you to edit the script later, because it would allow SetAssetScriptTransactions, among others.

Minimum exchange price is checked here:

e.price >= startPrice * (1 + years)

so it’d be impossible to exchange below this price.


I just did it in testnet.
Yesterday everything works.
I will investigate to see if the problem is due to me


I created new token in testnet with the same script.
It just doesn’t seem to work anymore.


This script only respects a minimum of 10 token units.
If you respect this quota the script allows you to buy sell at any price.
I am confused.


Sorry, I exchanged mainnet height for testnet.


In your script you have to assign the current blockchain height to startHeight:

let startHeight = 562376

The current testnet height can be found at

Because startHeight was too large, years = (height - startHeight) / interval was negative, and startPrice * (1 + years) was always less than any price