Executor

An overview of the intermediary executor contract that routes all Warlock pushes and liquidations.

Unlike other oracles, Warlock bundles liquidations with oracle updates — requiring both temporary proprietary access to oracle update flow, as well as interfaces to perform liquidations.

Executor.sol serves as Warlock’s intermediary contract to push permissioned oracle flow, execute liquidations, and provide kickbacks to partners.

More specifically, the Executor owns all temporarily permissioned flow granted by Warlock’s DataFeed. We are then able to execute liquidations through any given external protocol with a generic multicall, while returning value to partners without requiring unnecessary transfers on each liquidation.


Technical Documentation

Executor

Git Source

Inherits: Multicall2


State Variables

admin

The admin which is authorized to change other static variables.

address public admin;

updater

The external address priveliged to execute price data updates.

address public updater;

dataFeed

The address of the Sauron dataFeed contract.

address public dataFeed;

USDC

IERC20 public immutable USDC;

kickbacks

A mapping of USDC kickbacks owed to a given partner.

mapping(address => uint256) public kickbacks;

Functions

constructor

constructor(address _updater);

push

Allows the authorized address to push a price update.

function push(Hash.SubmittedData calldata submitted, Sig.Components calldata sig) external authorized(updater);

Parameters

pushLiquidate

Allows the authorized address to push a price update then batch calls.

function pushLiquidate(Hash.SubmittedData calldata submitted, Sig.Components calldata sig, Call[] calldata encodedCalls)
    external
    authorized(updater);

Parameters

pushLiquidateKickback

Allows the authorized address to push a price update then batch calls (with internal kickbacks).

function pushLiquidateKickback(
    Hash.SubmittedData calldata submitted,
    Sig.Components calldata sig,
    Call[] calldata encodedCalls,
    address recipient
) external authorized(admin);

Parameters

withdrawKickback

Allows the admin to withdraw kickbacks.

function withdrawKickback(address to) external;

Parameters

setDataFeed

function setDataFeed(address _dataFeed) public authorized(admin);

authorized

Allows only the authorized contract to execute the method.

modifier authorized(address a);

Errors

Exception

A single custom error capable of indicating a wide range of detected errors by providing an error code value whose string representation is documented , and any possible other values that are pertinent to the error.

error Exception(uint8, uint256, uint256, address, address);

Last updated