ITask.cairo

This is the contract interface that all task authors should follow when creating a task.

## SPDX-License-Identifier: AGPL-3.0-or-later

%lang starknet

## @title Automation task interface.
## @description Implements a task that will be called automatically by keepers.
## @dev We recommend keeping this contract separate from your core protocols and instead
## giving it permissions to call into your core protocol. This will give you the most
## flexibility in using and modifying tasks going forward.
## @author Peteris <github.com/Pet3ris>

@contract_interface
namespace ITask:

    ## @notice Called by task automators to see if task needs to be executed.
    ## @dev Do not return other values as keeper behavior is undefined.
    ## @return taskReady Assumes the value 1 if automation is ready to be called and 0 otherwise.
    func probeTask() -> (taskReady: felt):
    end

    ## @notice Main endpoint for task execution. Task automators call this to execute your task.
    ## @dev This function should not have access restrictions. However, this function could
    ## still be called even if `probeTask` returns 0 and needs to be protected accordingly.
    func executeTask() -> ():
    end

end

Last updated