Contract errors

This section contains selected, most frequently occurring errors the protocol may revert with.

Router

ROUTER: EXPIRED

Thrown when the current block's timestamp is greater than the provided _deadline of a swap.

require(block.timestamp <= _deadline, "ROUTER: EXPIRED");

ROUTER: BELOW_MINIMUM

Thrown when the minimum acceptable output amount _amountOutMin of a swap is not met.

require(_amountOut >= _amountOutMin, "ROUTER: BELOW_MINIMUM");

SwapPool

withdraw: MINIMUM_AMOUNT

Thrown when the withdraw amount _payoutAmount is less than the accepted minimum amount _minimumAmount.

require(_payoutAmount >= _minimumAmount, "withdraw: MINIMUM_AMOUNT");

SwapPool#backstopBurn: TIMELOCK

Thrown when the number of blocks that have passed since the last deposit by the user _owner is less than the specified timelock period insuranceWithdrawalTimelock.

require(
    block.number - latestDepositAtBlockNo[_owner] >=
        insuranceWithdrawalTimelock,
    "SwapPool#backstopBurn: TIMELOCK"
);

SwapPool#backstopBurn():INSUFFICIENT_COVERAGE

Thrown when the coverage ratio of the swap pool is more or would still be greater than 100% for the amount of swap pool LP shares to be redeemed for backstop pool liquidity.

require(
    reserve + _amount <= totalLiabilities,
    "SwapPool#backstopBurn():INSUFFICIENT_COVERAGE"
);

SwapPool#backstopDrain():INSUFFICIENT_COVERAGE

Thrown when the coverage ratio of the swap pool is less or would become lower than 100% for the amount of backstop pool LP shares to be withdrawn for swap pool liquidity.

require(
    reserve >= totalLiabilities + _amount,
    "SwapPool#backstopDrain():INSUFFICIENT_COVERAGE"
);

SwapPool: EXCEEDS_MAX_COVERAGE_RATIO

Thrown when the coverage ratio of the swap pool would exceed 200% after swap in.

require(
    (reserve + _effectiveAmount) <=
        (maxCoverageRatioForSwapIn * totalLiabilities) / 100,
    "SwapPool: EXCEEDS_MAX_COVERAGE_RATIO"
);

BackstopPool

withdraw():MINIMUM_AMOUNT

Thrown when the withdraw amount _payoutAmount is less than the accepted minimum amount _minimumAmount.

require(_payoutAmount >= _minimumAmount, "withdraw():MINIMUM_AMOUNT");

redeemSwapPoolShares():MIN_AMOUNT

Thrown when the amount of the to be withdrawn backstop pool LP shares for swap pool liquidity is less the accepted minimum amount _minAmount.

require(_netAmount >= _minAmount, "redeemSwapPoolShares():MIN_AMOUNT");

Last updated