0

I want to be able to call a function of a contract every 60-120 seconds, in my JavaScript code I have a set timer that runs for down a timer from 120 seconds down to 0 by subtracting 0.01 every 10 milliseconds, when the timer hits 0 it should be able to call a function from my solidity code then set timer variable to 120 again. Is this possible ? Tried using async await but it seems like it is ignoring that and calling the contract multiple times.

1
  • Yes, it is possible. The information that you posted, however, makes it impossible for anyone here to help you with it. Commented Feb 26, 2019 at 19:01

1 Answer 1

0

If you want to schedule a contract call to be performed every 60 seconds in javascript use the following:

setInterval(callContract, 60000);
function callContract() {
  // Contract call logic here
}

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.