IProvisioner

Interface for the contract that can mint and burn vault units in exchange for tokens

Functions

deposit

Deposit tokens directly into the vault

MUST revert if tokensIn is 0, minUnitsOut is 0, or sync deposits are disabled

function deposit(IERC20 token, uint256 tokensIn, uint256 minUnitsOut) external returns (uint256 unitsOut);

Parameters

Name
Type
Description

token

IERC20

The token to deposit

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

Returns

Name
Type
Description

unitsOut

uint256

The amount of shares minted to the receiver

mint

Mint exact amount of units by depositing required tokens

function mint(IERC20 token, uint256 unitsOut, uint256 maxTokensIn) external returns (uint256 tokensIn);

Parameters

Name
Type
Description

token

IERC20

The token to deposit

unitsOut

uint256

The exact amount of units to mint

maxTokensIn

uint256

Maximum amount of tokens willing to deposit

Returns

Name
Type
Description

tokensIn

uint256

The amount of tokens used to mint the requested shares

refundDeposit

Refund a deposit within the refund period

Only callable by authorized addresses

function refundDeposit(address sender, IERC20 token, uint256 tokenAmount, uint256 unitsAmount, uint256 refundableUntil)
    external;

Parameters

Name
Type
Description

sender

address

The original depositor

token

IERC20

The deposited token

tokenAmount

uint256

The amount of tokens deposited

unitsAmount

uint256

The amount of units minted

refundableUntil

uint256

Timestamp until which refund is possible

refundRequest

Refund an expired deposit or redeem request

Can only be called after request deadline has passed

function refundRequest(IERC20 token, Request calldata request) external;

Parameters

Name
Type
Description

token

IERC20

The token involved in the request

request

Request

The request to refund

requestDeposit

Create a new deposit request to be solved by solvers

function requestDeposit(
    IERC20 token,
    uint256 tokensIn,
    uint256 minUnitsOut,
    uint256 solverTip,
    uint256 deadline,
    uint256 maxPriceAge,
    bool isFixedPrice
) external;

Parameters

Name
Type
Description

token

IERC20

The token to deposit

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Duration in seconds for which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

requestRedeem

Create a new redeem request to be solved by solvers

function requestRedeem(
    IERC20 token,
    uint256 unitsIn,
    uint256 minTokensOut,
    uint256 solverTip,
    uint256 deadline,
    uint256 maxPriceAge,
    bool isFixedPrice
) external;

Parameters

Name
Type
Description

token

IERC20

The token to receive

unitsIn

uint256

The amount of units to redeem

minTokensOut

uint256

The minimum amount of tokens expected

solverTip

uint256

The tip offered to the solver

deadline

uint256

Duration in seconds for which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

solveRequestsVault

Solve multiple requests using vault's liquidity

Only callable by authorized addresses

function solveRequestsVault(IERC20 token, Request[] calldata requests) external;

Parameters

Name
Type
Description

token

IERC20

The token for which to solve requests

requests

Request[]

Array of requests to solve

solveRequestsDirect

Solve multiple requests using solver's own liquidity

function solveRequestsDirect(IERC20 token, Request[] calldata requests) external;

Parameters

Name
Type
Description

token

IERC20

The token for which to solve requests

requests

Request[]

Array of requests to solve

setTokenDetails

Update token parameters

function setTokenDetails(IERC20 token, TokenDetails calldata tokensDetails) external;

Parameters

Name
Type
Description

token

IERC20

The token to update

tokensDetails

TokenDetails

The new token details

removeToken

Removes token from provisioner

function removeToken(IERC20 token) external;

Parameters

Name
Type
Description

token

IERC20

The token to be removed

setDepositDetails

Update deposit parameters

function setDepositDetails(uint256 depositCap_, uint256 depositRefundTimeout_) external;

Parameters

Name
Type
Description

depositCap_

uint256

New maximum total value that can be deposited

depositRefundTimeout_

uint256

New time window for deposit refunds

maxDeposit

Return maximum amount that can still be deposited

function maxDeposit() external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

Amount of deposit capacity remaining

areUserUnitsLocked

Check if a user's units are currently locked

function areUserUnitsLocked(address user) external view returns (bool);

Parameters

Name
Type
Description

user

address

The address to check

Returns

Name
Type
Description

<none>

bool

True if user's units are locked, false otherwise

getDepositHash

Computes the hash for a sync deposit

function getDepositHash(address user, IERC20 token, uint256 tokenAmount, uint256 unitsAmount, uint256 refundableUntil)
    external
    pure
    returns (bytes32);

Parameters

Name
Type
Description

user

address

The address making the deposit

token

IERC20

The token being deposited

tokenAmount

uint256

The amount of tokens to deposit

unitsAmount

uint256

Minimum amount of units to receive

refundableUntil

uint256

The timestamp until which the deposit is refundable

Returns

Name
Type
Description

<none>

bytes32

The hash of the deposit

getRequestHash

Computes the hash for a generic request

function getRequestHash(IERC20 token, Request calldata request) external pure returns (bytes32);

Parameters

Name
Type
Description

token

IERC20

The token involved in the request

request

Request

The request struct

Returns

Name
Type
Description

<none>

bytes32

The hash of the request

Events

Deposited

Emitted when a user deposits tokens directly into the vault

event Deposited(address indexed user, IERC20 indexed token, uint256 tokensIn, uint256 unitsOut, bytes32 depositHash);

Parameters

Name
Type
Description

user

address

The address of the depositor

token

IERC20

The token being deposited

tokensIn

uint256

The amount of tokens deposited

unitsOut

uint256

The amount of units minted

depositHash

bytes32

Unique identifier for this deposit

DepositRefunded

Emitted when a deposit is refunded

event DepositRefunded(bytes32 indexed depositHash);

Parameters

Name
Type
Description

depositHash

bytes32

The hash of the deposit being refunded

DirectDepositRefunded

Emitted when a direct (sync) deposit is refunded

event DirectDepositRefunded(bytes32 indexed depositHash);

Parameters

Name
Type
Description

depositHash

bytes32

The hash of the deposit being refunded

DepositRequested

Emitted when a user creates a deposit request

event DepositRequested(
    address indexed user,
    IERC20 indexed token,
    uint256 tokensIn,
    uint256 minUnitsOut,
    uint256 solverTip,
    uint256 deadline,
    uint256 maxPriceAge,
    bool isFixedPrice,
    bytes32 depositRequestHash
);

Parameters

Name
Type
Description

user

address

The address requesting the deposit

token

IERC20

The token being deposited

tokensIn

uint256

The amount of tokens to deposit

minUnitsOut

uint256

The minimum amount of units expected

solverTip

uint256

The tip offered to the solver in deposit token terms

deadline

uint256

Timestamp until which the request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

depositRequestHash

bytes32

The hash of the deposit request

RedeemRequested

Emitted when a user creates a redeem request

event RedeemRequested(
    address indexed user,
    IERC20 indexed token,
    uint256 minTokensOut,
    uint256 unitsIn,
    uint256 solverTip,
    uint256 deadline,
    uint256 maxPriceAge,
    bool isFixedPrice,
    bytes32 redeemRequestHash
);

Parameters

Name
Type
Description

user

address

The address requesting the redemption

token

IERC20

The token requested in return for units

minTokensOut

uint256

The minimum amount of tokens the user expects to receive

unitsIn

uint256

The amount of units being redeemed

solverTip

uint256

The tip offered to the solver in redeem token terms

deadline

uint256

The timestamp until which this request is valid

maxPriceAge

uint256

Maximum age of price data that solver can use

isFixedPrice

bool

Whether the request is a fixed price request

redeemRequestHash

bytes32

The hash of the redeem request

DepositSolved

Emitted when a deposit request is solved successfully

event DepositSolved(bytes32 indexed depositHash);

Parameters

Name
Type
Description

depositHash

bytes32

The unique identifier of the deposit request that was solved

RedeemSolved

Emitted when a redeem request is solved successfully

event RedeemSolved(bytes32 indexed redeemHash);

Parameters

Name
Type
Description

redeemHash

bytes32

The unique identifier of the redeem request that was solved

InvalidRequestHash

Emitted when an unrecognized async deposit hash is used

event InvalidRequestHash(bytes32 indexed depositHash);

Parameters

Name
Type
Description

depositHash

bytes32

The deposit hash that was not found in async records

AsyncDepositDisabled

Emitted when async deposits are disabled and a deposit request cannot be processed

event AsyncDepositDisabled(uint256 indexed index);

Parameters

Name
Type
Description

index

uint256

The index of the deposit request that was rejected

AsyncRedeemDisabled

Emitted when async redeems are disabled and a redeem request cannot be processed

event AsyncRedeemDisabled(uint256 indexed index);

Parameters

Name
Type
Description

index

uint256

The index of the redeem request that was rejected

PriceAgeExceeded

Emitted when the price age exceeds the maximum allowed for a request

event PriceAgeExceeded(uint256 indexed index);

Parameters

Name
Type
Description

index

uint256

The index of the request that was rejected

DepositCapExceeded

Emitted when a deposit exceeds the vault's configured deposit cap

event DepositCapExceeded(uint256 indexed index);

Parameters

Name
Type
Description

index

uint256

The index of the request that was rejected

InsufficientTokensForTip

Emitted when there are not enough tokens to cover the required solver tip

event InsufficientTokensForTip(uint256 indexed index);

Parameters

Name
Type
Description

index

uint256

The index of the request that was rejected

AmountBoundExceeded

Emitted when the output units are less than the amount requested

event AmountBoundExceeded(uint256 indexed index, uint256 amount, uint256 bound);

Parameters

Name
Type
Description

index

uint256

The index of the request that was rejected

amount

uint256

The actual amount

bound

uint256

The minimum amount

RedeemRefunded

Emitted when a redeem request is refunded due to expiration or cancellation

event RedeemRefunded(bytes32 indexed redeemHash);

Parameters

Name
Type
Description

redeemHash

bytes32

The unique identifier of the redeem request that was refunded

DepositDetailsUpdated

Emitted when the vault's deposit limits are updated

event DepositDetailsUpdated(uint256 depositCap, uint256 depositRefundTimeout);

Parameters

Name
Type
Description

depositCap

uint256

The new maximum total value that can be deposited into the vault

depositRefundTimeout

uint256

The new time window during which deposits can be refunded

TokenDetailsSet

Emitted when a token's deposit/withdrawal settings are updated

event TokenDetailsSet(IERC20 indexed token, TokenDetails tokensDetails);

Parameters

Name
Type
Description

token

IERC20

The token whose settings are being updated

tokensDetails

TokenDetails

The new token details

TokenRemoved

Emitted when a token is removed from the provisioner

event TokenRemoved(IERC20 indexed token);

Parameters

Name
Type
Description

token

IERC20

The token that was removed

Errors

Aera__SyncDepositDisabled

error Aera__SyncDepositDisabled();

Aera__AsyncDepositDisabled

error Aera__AsyncDepositDisabled();

Aera__AsyncRedeemDisabled

error Aera__AsyncRedeemDisabled();

Aera__DepositCapExceeded

error Aera__DepositCapExceeded();

Aera__MinUnitsOutNotMet

error Aera__MinUnitsOutNotMet();

Aera__TokensInZero

error Aera__TokensInZero();

Aera__UnitsInZero

error Aera__UnitsInZero();

Aera__UnitsOutZero

error Aera__UnitsOutZero();

Aera__MinUnitsOutZero

error Aera__MinUnitsOutZero();

Aera__MaxTokensInZero

error Aera__MaxTokensInZero();

Aera__MaxTokensInExceeded

error Aera__MaxTokensInExceeded();

Aera__MaxDepositRefundTimeoutExceeded

error Aera__MaxDepositRefundTimeoutExceeded();

Aera__DepositHashNotFound

error Aera__DepositHashNotFound();

Aera__HashNotFound

error Aera__HashNotFound();

Aera__RefundPeriodExpired

error Aera__RefundPeriodExpired();

Aera__DeadlineInPast

error Aera__DeadlineInPast();

Aera__DeadlineTooFarInFuture

error Aera__DeadlineTooFarInFuture();

Aera__DeadlineInFutureAndUnauthorized

error Aera__DeadlineInFutureAndUnauthorized();

Aera__MinTokenOutZero

error Aera__MinTokenOutZero();

Aera__HashCollision

error Aera__HashCollision();

Aera__ZeroAddressPriceAndFeeCalculator

error Aera__ZeroAddressPriceAndFeeCalculator();

Aera__ZeroAddressMultiDepositorVault

error Aera__ZeroAddressMultiDepositorVault();

Aera__DepositMultiplierTooLow

error Aera__DepositMultiplierTooLow();

Aera__DepositMultiplierTooHigh

error Aera__DepositMultiplierTooHigh();

Aera__RedeemMultiplierTooLow

error Aera__RedeemMultiplierTooLow();

Aera__RedeemMultiplierTooHigh

error Aera__RedeemMultiplierTooHigh();

Aera__DepositCapZero

error Aera__DepositCapZero();

Aera__PriceAndFeeCalculatorVaultPaused

error Aera__PriceAndFeeCalculatorVaultPaused();

Aera__AutoPriceSolveNotAllowed

error Aera__AutoPriceSolveNotAllowed();

Aera__FixedPriceSolverTipNotAllowed

error Aera__FixedPriceSolverTipNotAllowed();

Aera__TokenCantBePriced

error Aera__TokenCantBePriced();

Aera__CallerIsVault

error Aera__CallerIsVault();

Aera__InvalidToken

error Aera__InvalidToken();

Last updated