Skip to content

esp staking contracts

EspressoFundFlowController: ESP Unbonding and Rewards

EspressoFundFlowController manages deposits and withdrawals for Espresso 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.

Returns the address of the staking strategy contract.

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

Returns the address of the withdrawal pool contract.

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

Returns the address authorized to deposit queued tokens into vaults.

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

Returns the minimum number of seconds between unbonding calls.

function minTimeBetweenUnbonding() public view returns (uint64)
Name Type Description
minTimeBetweenUnbonding uint64 Minimum seconds between unbonding

Returns the time of the last unbonding call.

function timeOfLastUnbond() public view returns (uint64)
Name Type Description
timeOfLastUnbond uint64 Time of last unbonding

Returns whether tokens should be deposited and the amount available for deposit.

function shouldDepositQueuedTokens() external view returns (bool, uint256)
Name Type Description
canDeposit bool true if deposit is allowed
amount uint256 Amount of tokens available to deposit

Returns whether vaults should be unbonded.

function shouldUnbondVaults() external view returns (bool)
Name Type Description
shouldUnbond bool true if unbonding is needed

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

function shouldWithdrawVaults() external view returns (bool, uint256[] memory)
Name Type Description
canWithdraw bool true if withdrawal is possible
vaultIds uint256[] List of withdrawable vault IDs

Returns a list of total deposits for all vaults.

function getVaultDeposits() external view returns (uint256[] memory)
Name Type Description
deposits uint256[] List of vault deposits

Returns a list of unclaimed rewards for all vaults.

function getVaultRewards() external view returns (uint256[] memory)
Name Type Description
rewards uint256[] List of vault rewards

Returns a list of currently unbonding vaults.

function getUnbondingVaults() external view returns (uint256[] memory)
Name Type Description
vaultIds uint256[] List of unbonding vaults

Returns a list of currently withdrawable vaults.

function getWithdrawableVaults() public view returns (uint256[] memory)
Name Type Description
vaultIds uint256[] List of withdrawable vaults

Returns a list of inactive vaults (validators that have exited).

function getInactiveVaults() public view returns (uint256[] memory)
Name Type Description
vaultIds uint256[] List of inactive vaults

Returns a list of inactive and currently withdrawable vaults.

function getInactiveWithdrawableVaults() public view returns (uint256[] memory)
Name Type Description
vaultIds uint256[] List of inactive withdrawable vaults

Deposits queued tokens into vaults.

function depositQueuedTokens(uint256[] calldata _vaultIds, uint256[] calldata _amounts) external
Name Type Description
_vaultIds uint256[] List of vault IDs
_amounts uint256[] Amounts to deposit per vault

Unbonds vaults if needed.

function unbondVaults() external

Unbonds vaults to rebalance deposits between vaults.

function forceUnbondVaults(uint256[] calldata _vaultIds, uint256[] calldata _amounts) external
Name Type Description
_vaultIds uint256[] List of vault IDs
_amounts uint256[] Amounts to unbond per vault

Withdraws from vaults and triggers withdrawal pool upkeep if needed.

function withdrawVaults(uint256[] calldata _vaultIds) external
Name Type Description
_vaultIds uint256[] List of vault IDs

Restakes vault rewards for given vaults.

function restakeRewards(uint256[] calldata _vaultIds, uint256[] calldata _lifetimeRewards, bytes[] calldata _authData) external
Name Type Description
_vaultIds uint256[] List of vault IDs
_lifetimeRewards uint256[] Lifetime rewards values for each vault
_authData bytes[] Authorization data for each vault

Withdraws vault rewards for given vaults.

function withdrawRewards(uint256[] calldata _vaultIds, uint256[] calldata _lifetimeRewards, bytes[] calldata _authData) external
Name Type Description
_vaultIds uint256[] List of vault IDs
_lifetimeRewards uint256[] Lifetime rewards values for each vault
_authData bytes[] Authorization data for each vault

Sets the address authorized to deposit queued tokens.

function setDepositController(address _depositController) external
Name Type Description
_depositController address Deposit controller address

Sets the minimum time between unbonding calls.

function setMinTimeBetweenUnbonding(uint64 _minTimeBetweenUnbonding) external
Name Type Description
_minTimeBetweenUnbonding uint64 Minimum seconds between unbonding