Contract Automation
Custom Logic Automation

Custom logic automation

Custom logic automation Tasks allow you to automate calling a contract function on an event of your choice. For example, when a certain function in another contract has been executed.

To create a custom logic automation task, you need to:

  1. Connect a wallet.
  2. Create a custom logic Task and specify a contract and a function to execute.
  3. Add custom logic.

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 custom logic 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, address of a compatible contract, custom data, and gas limit. When done, click Continue.
    Enter task details
  4. Read the information message about the function check and 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