Writing your own task logic
Developers can register custom conditions and actions by submitting encoded payloads to the AutomationRegistry
.
Task Registration Call:
function registerTask(bytes calldata condition, bytes calldata action) external returns (uint256)
Use ABI encoding tools like ethers.js:
const iface = new ethers.utils.Interface(["function swap(address tokenIn, address tokenOut, uint amount)"]);
const actionData = iface.encodeFunctionData("swap", [tokenIn, tokenOut, amount]);
Last updated