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.

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

I you want to schedule a contract call 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, privacy policy and cookie policy

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