Polygon Fund Flow Controller

PolygonFundFlowController manages deposits and withdrawals for Polygon staking vaults, including unbonding, restaking, and reward management. It coordinates with the strategy and withdrawal pool contracts and exposes functions for vault and reward state queries.

View Functions

strategy

Returns the address of the staking strategy contract.

function strategy() public view returns (address)
Name
Type
Description

strategy

address

Staking strategy address

withdrawalPool

Returns the address of the withdrawal pool contract.

function withdrawalPool() public view returns (address)
Name
Type
Description

withdrawalPool

address

Withdrawal pool address

depositController

Returns the address authorized to deposit queued tokens into vaults.

function depositController() public view returns (address)
Name
Type
Description

depositController

address

Deposit controller address

minTimeBetweenUnbonding

Returns the minimum number of seconds between unbonding calls.

Name
Type
Description

minTimeBetweenUnbonding

uint64

Minimum seconds between unbonding

timeOfLastUnbond

Returns the time of the last unbonding call.

Name
Type
Description

timeOfLastUnbond

uint64

Time of last unbonding

canDepositQueuedTokens

Returns whether tokens can be deposited.

Return Values

Name
Type
Description

canDeposit

bool

true if deposit is allowed

shouldUnbondVaults

Returns whether vaults should be unbonded.

Return Values

Name
Type
Description

shouldUnbond

bool

true if unbonding is needed

shouldWithdrawVaults

Returns whether vaults are unbonded and ready to be withdrawn from, and the list of withdrawable vaults.

Return Values

Name
Type
Description

canWithdraw

bool

true if withdrawal is possible

vaultIds

uint256[]

List of withdrawable vault IDs

getVaultDeposits

Returns a list of total deposits for all vaults.

Return Values

Name
Type
Description

deposits

uint256[]

List of vault deposits

getVaultRewards

Returns a list of unclaimed rewards for all vaults.

Return Values

Name
Type
Description

rewards

uint256[]

List of vault rewards

getUnbondingVaults

Returns a list of currently unbonding vaults (excluding those queued for removal).

Return Values

Name
Type
Description

vaultIds

uint256[]

List of unbonding vaults

getWithdrawableVaults

Returns a list of currently withdrawable vaults (excluding those queued for removal).

Return Values

Name
Type
Description

vaultIds

uint256[]

List of withdrawable vaults

Write Functions

depositQueuedTokens

Deposits queued tokens into vaults.

Name
Type
Description

_vaultIds

uint256[]

List of vault IDs

_amounts

uint256[]

Amounts to deposit per vault

unbondVaults

Unbonds vaults if needed.

forceUnbondVaults

Unbonds vaults to rebalance deposits between vaults.

Name
Type
Description

_vaultIds

uint256[]

List of vault IDs

_amounts

uint256[]

Amounts to unbond per vault

withdrawVaults

Withdraws from vaults and triggers withdrawal pool upkeep if needed.

Name
Type
Description

_vaultIds

uint256[]

List of vault IDs

restakeRewards

Restakes vault rewards for given vaults.

Name
Type
Description

_vaultIds

uint256[]

List of vault IDs

setDepositController

Sets the address authorized to deposit queued tokens.

Name
Type
Description

_depositController

address

Deposit controller address

setMinTimeBetweenUnbonding

Sets the minimum time between unbonding calls.

Name
Type
Description

_minTimeBetweenUnbonding

uint64

Minimum seconds between unbonding

Last updated