Time-based automation
Time-based automation Tasks allow you to automate calling a contract function on a schedule of your choice.
To create a time-based automation task, you need to:
- Connect a wallet.
- Create a time-based Task and specify a contract and a function to execute.
- Specify a time schedule.
Connect a wallet
We recommend MetaMask as the most adopted and tested-out wallet and use it throughout our documentation.
To connect a wallet:
- Visit Ankr Automation Dashboard (opens in a new tab).
- Click Connect wallet.
- Choose a wallet.
- Connect the wallet.
- Successful wallet connection is indicated in the top-right corner, on the dashboard.
Create a time-based Task
Before creating a task, make sure your wallet address has some BNB to deposit. Your automation will need BNB to pay the gas fees.
To create a time-based Task:
- Visit Ankr Automation Dashboard (opens in a new tab).
- Click Create Task.
- Enter Task details: a name, contract address, contract function to be executed, and gas limit. When done, click Continue.
Your contract doesn't have to be compatible with the Ankr Automation interface.
If your contract hasn't been verified, it will need the ABI. If no ABI is fetched from the contract, click Switch to custom ABI and copy&paste the ABI code into the corresponding text box. - Choose days and a time interval to execute the function: use a built-in scheduler or switch to CRON expression and provide a custom expression. Set a date and time for the task to initially start. When done, click Continue.
- Top up your Ankr Automation account: click Deposit and add some BNB for the gas fees, then click Continue.
- Click Create Task to finish the process.
- Confirm in MetMask deployment of your automation to the Ankr Automation registrar. You may be also asked to confirm a CRON wrapping transaction, so that makes up 2 txs in total.
- You'll be redirected to Ankr Automation Dashboard (opens in a new tab) to view and manage created Tasks.