Contract Automation
Time-based Automation

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:

  1. Connect a wallet.
  2. Create a time-based Task and specify a contract and a function to execute.
  3. Specify a time schedule.

Connect a wallet

We recommend MetaMask as a most adopted and tested-out wallet and use it throughout our documentation.

To connect a wallet:

  1. Visit Ankr Automation Dashboard (opens in a new tab).
  2. Click Connect wallet. Click the connect wallet button
  3. Choose a wallet. Choose a wallet
  4. Connect the wallet. Connect the wallet
  5. Successful wallet connection is indicated in the top-right corner, on the dashboard. Successful wallet connection

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:

  1. Visit Ankr Automation Dashboard (opens in a new tab).
  2. Click Create Task. Click Create Task
  3. 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. Enter task details
  4. 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. Set up the schedule
  5. Top up your Ankr Automation account: click Deposit and add some BNB for the gas fees, then click Continue. Enter task details
  6. Click Create Task to finish the process. Finish creating the Task
  7. 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. Confirm deployment of automation
  8. You'll be redirected to Ankr Automation Dashboard (opens in a new tab) to view and manage created Tasks. Check created task on Ankr Automation Dashboard

Next read