📕
Yagi Finance
  • Yagi Finance Introduction
  • Contact Us
  • Products
    • 🔀Vaults
      • Introduction
      • How to use Yagi Vaults
      • ERC4626
  • Developers
    • 🤖Automation
      • Introduction
      • How it Works
      • How to Create a Task
      • How to View Existing Tasks
      • ITask.cairo
      • Fee Model
      • Security
      • Tasks
      • Keepers
      • For Vaults and Bridges
      • For Order Books and Lenders
      • For AMMs
      • For Derivatives Platforms
      • For Games
    • 🔧Build a Yagi Vault
  • Additional Resources
    • How to contribute
    • Roadmap
    • Discord
    • Twitter
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Automation

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
PreviousHow to View Existing TasksNextFee Model

Last updated 3 years ago

Was this helpful?

🤖