1

is there way to set a fixed block interval in WASM based chains?

e.g. call a tick() function every 10 seconds.

in particular, i need a way of calculating elapsed time since X

let tick = 0;

func1 { tick = now(); }

func2 { if now() > tick + 10 { do xyz } }```

0xZiyad
  • 41
  • 2

1 Answers1

2

Usually, smart contracts require an external trigger whatever VM it may be or you might run out of funds pretty quick if left unchecked.

Ani
  • 261
  • 1
  • 6