1

How to auto-execute smart contract based on certain conditions ?

For example:

The contract period has exceeded the deadline -> auto-execute pay without interfering from user

1 Answer 1

2

There is no way to automate smart contract functions solely from within a smart contract.

The smart contract requires a transaction that supplies it with gas (CPU Time / Storage fees), which allows it to perform operations. Without the gas, the smart contract is just a set of instructions on-chain.

You need to create an external service that calls your contract at set periods. The call should execute pay if the deadline is passed.

There may be Oracle services that do this for you but I don't know of any.

2
  • I know it is possible for use oracle to control the automation transaction (ex: Chainlink Automation in evm-compatible ). Do we have any oracle providers support ink! smart contract ?
    – CocDap
    Commented Oct 25, 2023 at 10:10
  • Potentially Kylin as they have contracts written in ink! and they are developing an oracle service. Seems they are live on Rococo and Kusama
    – forgetso
    Commented Oct 25, 2023 at 15:00

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.