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
  }
}```

1 Answer 1

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.

2
  • is this because of the on-tangle root commitment fees?
    – 0xZiyad
    Feb 7, 2023 at 17:55
  • No. That's how every decentralised network works. This was long solved on Ethereum and every network follows it since.
    – Ani
    Apr 11, 2023 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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