I am looking for ways to automatically execute a function call every 24 hours in my smart contract and came across this answer. Is the solution here asynchronous, i.e. can the contract execute other functions while it's waiting for the callback?


The contract doesn't execute anything.

You (or others) may execute any of the functions exposed in the contract (public and external) at any time, by submitting a transaction which contains the encoded function-call.

When you submit such transaction, it will go into one of the next blocks (the higher the gas-price you state, the faster it will be selected by one of the miners).

The execution will be regardless of your 24-hour automation job, so in that sense you could say that the function will execute asynchronously to it.

But generally speaking, everything on the blockchain is eventually executed in a synchronous manner. If data-integrity is violated (i.e., any transaction within the resulting block is in conflict with any of the other transactions in this block or in any of the previous blocks), then the entire block will eventually be rejected by the participants on the blockchain.

| improve this answer | |

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.