WithdrawalManager

Git Source

Inherits: WithdrawalManagerStorage, IWithdrawalManager, VersionedInitializable

State Variables

WITHDRAWAL_MANAGER_REVISION

uint256 public constant WITHDRAWAL_MANAGER_REVISION = 0x1;

ADDRESSES_PROVIDER

IPoolAddressesProvider public immutable ADDRESSES_PROVIDER;

Functions

onlyPoolAdmin

modifier onlyPoolAdmin();

onlyPoolConfigurator

modifier onlyPoolConfigurator();

whenProtocolNotPaused

getRevision

Returns the revision number of the contract

Needs to be defined in the inherited class as a constant.

Returns

Name
Type
Description

revision_

uint256

The revision number

constructor

initialize

Initializes the Withdrawal Manager.

Function is invoked by the proxy contract when the Withdrawal Manager Contract is added to the PoolAddressesProvider of the market.

Parameters

Name
Type
Description

provider_

IPoolAddressesProvider

The address of the PoolAddressesProvider.

cycleDuration_

uint256

The total duration of a withdrawal cycle.

windowDuration_

uint256

The duration of the withdrawal window.

setExitConfig

Pool admin sets a new configuration for the withdrawal manager.

Parameters

Name
Type
Description

cycleDuration_

uint256

The total duration of a withdrawal cycle.

windowDuration_

uint256

The total duration of a withdrawal window.

addShares

Add more shares for withdrawal.

Parameters

Name
Type
Description

shares_

uint256

The amount of shares to add.

owner_

address

The owner of the shares.

removeShares

Remove shares from withdrawal.

Parameters

Name
Type
Description

shares_

uint256

The amount of shares to remove from withdrawal.

owner_

address

The owner of the shares.

processExit

Process the exit of requested shares of a owner.

Parameters

Name
Type
Description

requestedShares_

uint256

The amount of shares to redeem.

owner_

address

The owner of the shares.

Returns

Name
Type
Description

redeemableShares_

uint256

The amount of redeemable shares.

resultingAssets_

uint256

The corresponding amount of assets with the redeemable shares.

isInExitWindow

Checks if the owner has a withdrawal request in the exit window.

Parameters

Name
Type
Description

owner_

address

The owner address to check.

Returns

Name
Type
Description

isInExitWindow_

bool

True if the owner has a withdrawal request in the exit window.

lockedLiquidity

Gets the total amount of liquidity locked in the current cycle.

Returns

Name
Type
Description

lockedLiquidity_

uint256

The total amount of liquidity locked in the current cycle.

previewRedeem

Previews the amount of shares and assets that can be redeemed.

Parameters

Name
Type
Description

owner_

address

The owner of the shares.

shares_

uint256

The amount of shares to redeem.

Returns

Name
Type
Description

redeemableShares_

uint256

The amount of redeemable shares.

resultingAssets_

uint256

The corresponding amount of assets with the redeemable shares.

getCycleConfig

Gets the configuration of a config id.

Parameters

Name
Type
Description

configId_

uint256

The id of the config.

Returns

Name
Type
Description

config_

WM.CycleConfig

The config.

getConfigAtId

Gets the configuration of a given cycle id.

Parameters

Name
Type
Description

cycleId_

uint256

The cycle id.

Returns

Name
Type
Description

config_

WM.CycleConfig

The configuration used at the cycle id.

getCurrentConfig

Gets the configuration of the current cycle id.

Returns

Name
Type
Description

config_

WM.CycleConfig

The configuration used at the current cycle id.

getCurrentCycleId

Gets the current cycle id.

Returns

Name
Type
Description

cycleId_

uint256

The id of the current cycle.

getWindowStart

Gets the starting time of a window for a given cycle id.

Parameters

Name
Type
Description

cycleId_

uint256

The id of the cycle.

Returns

Name
Type
Description

windowStart_

uint64

The starting time of the window.

getWindowAtId

Gets the start and end time of a window for a given cycle id.

Parameters

Name
Type
Description

cycleId_

uint256

The id of the cycle.

Returns

Name
Type
Description

windowStart_

uint64

The starting time of the window.

windowEnd_

uint64

The ending time of the window.

getRedeemableAmounts

_poolConfigurator

_poolAdmin

_globals

_asset

_pool

_emitUpdate

_emitProcess

_revertIfNotPoolAdmin

_revertIfNotPoolConfigurator

Last updated