Recipe Executor
Recipe Executor is the main entry point of execution of recipes; it can be called directly (when a user manually executes a set of actions) or is called through StrategyExecutor
when the Recipe is part of a strategy. The contract checks if the first action is a special flash loan action type and adequately sets up the code to execute the flash loan.
Recipe Executor is always called through a user's wallet (Safe/DSProxy) and can't hold any state. executeRecipe()
is used when the recipe is executed manually and executeRecipeFromStrategy()
is called by StrategyExecutor
when it's part of a strategy.
When the recipe is called through the StrategyExecutor
there are additional checks if the triggers are executed correctly. All triggers must return true for the execution to continue. After that, from the Strategy data a new Recipe object is created and goes through the same flow as a manually executed recipe.
Triggers can be changeable! If Trigger returns true to a isChangeable()
call after the trigger is checked, the sub-data of that trigger can be updated. Useful for strategies, for example, where on every five days some recipe happens, trigger adds five days from the last execution as the next trigger date.
Recipe Executor also handles a particular type of actions Flash loan
actions. Flash loan actions are always sent first, and they callback the Recipe Executor through the _executeActionsFromFL
function.
Below is the interface of the contract:
Last updated