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:
- Connect a wallet.
- Create a custom logic Task and specify a contract and a function to execute.
- Add custom logic.
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 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:
- Visit Ankr Automation Dashboard (opens in a new tab).
- Click Create Task.
- Enter Task details: a name, address of a compatible contract, custom data, and gas limit. When done, click Continue.
- Read the information message about the function check and 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.