Create resource with script


#21

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

To edit the script.


#22

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.


#23

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


#24

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


#25

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.


#26

Sorry, I exchanged mainnet height for testnet.


#27

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

let startHeight = 562376

The current testnet height can be found at https://testnodes.wavesnodes.com/blocks/height

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