How it Works
The protocol defines a task interface
ITask.cairothat consists of two functions:
probeTask– defines conditions for task execution, returns
1if task is ready to be executed and
executeTask– executes task.
The task author creates a task contract that conforms to this interface and deploys it to StarkNet. Once deployed, the task smart contract's address is whitelisted by the Yagi team and keepers begin to execute.
Each keeper will first call
probeTaskto see if task is ready for execution and upon receiving a
1(ready) will invoke
executeTask. Keepers do this by running dedicated software (see example below).
The task interface model is very flexible and can accomodate several different use cases:
- Regular timed execution (by using
- Conditioned execution (by manually checking for certain conditions)
- Deploying a task separately from the contract (by "authorizing" the task to perform certain contract actions).