Skip to main content

VaultState

Git Source ↗

Inherits: VaultImmutables →, Initializable ↗, VaultFee →, IVaultState

Defines Vault's state manipulation.

Events

CheckpointCreated

Event emitted on checkpoint creation

event CheckpointCreated(uint256 shares, uint256 assets);

Parameters

NameTypeDescription
sharesuint256The number of burned shares
assetsuint256The amount of exited assets

FeeSharesMinted

Event emitted on minting fee recipient shares

event FeeSharesMinted(address receiver, uint256 shares, uint256 assets);

Parameters

NameTypeDescription
receiveraddressThe address of the fee recipient
sharesuint256The number of minted shares
assetsuint256The amount of minted assets

ExitingAssetsPenalized

Event emitted when exiting assets are penalized (deprecated)

event ExitingAssetsPenalized(uint256 penalty);

Parameters

NameTypeDescription
penaltyuint256The total penalty amount

AssetsDonated

Event emitted when the assets are donated to the Vault

event AssetsDonated(address sender, uint256 assets);

Parameters

NameTypeDescription
senderaddressThe address of the sender
assetsuint256The amount of donated assets

Functions

totalShares

Function for retrieving total shares

function totalShares() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of shares in existence

totalAssets

Total assets in the Vault

function totalAssets() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The total amount of the underlying asset that is "managed" by Vault

getExitQueueData

Get exit queue data

function getExitQueueData()
external
view
override
returns (
uint128 queuedShares,
uint128 unclaimedAssets,
uint128 totalExitingTickets,
uint128 totalExitingAssets,
uint256 totalTickets
);

Returns

NameTypeDescription
queuedSharesuint128The number of shares in the exit queue
unclaimedAssetsuint128The amount of unclaimed assets in the exit queue
totalExitingTicketsuint128The total number of exiting tickets
totalExitingAssetsuint128The total amount of exiting assets
totalTicketsuint256The total number of tickets in the exit queue

getShares

Returns the number of shares held by an account

function getShares(address account) external view override returns (uint256);

Parameters

NameTypeDescription
accountaddressThe account for which to look up the number of shares it has, i.e. its balance

Returns

NameTypeDescription
<none>uint256The number of shares held by the account

convertToShares

Converts assets to shares

function convertToShares(uint256 assets) public view override returns (uint256 shares);

Parameters

NameTypeDescription
assetsuint256The amount of assets to convert to shares

Returns

NameTypeDescription
sharesuint256The amount of shares that the Vault would exchange for the amount of assets provided

convertToAssets

Converts shares to assets

function convertToAssets(uint256 shares) public view override returns (uint256 assets);

Parameters

NameTypeDescription
sharesuint256The amount of shares to convert to assets

Returns

NameTypeDescription
assetsuint256The amount of assets that the Vault would exchange for the amount of shares provided

capacity

The Vault's capacity

function capacity() public view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount after which the Vault stops accepting deposits

withdrawableAssets

Total assets available in the Vault. They can be staked or withdrawn.

function withdrawableAssets() public view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The total amount of withdrawable assets

isStateUpdateRequired

Check whether state update is required

function isStateUpdateRequired() external view virtual override returns (bool);

Returns

NameTypeDescription
<none>booltrue if state update is required, false otherwise

updateState

Updates the total amount of assets in the Vault and its exit queue

function updateState(IKeeperRewards.HarvestParams calldata harvestParams) public virtual override;

Parameters

NameTypeDescription
harvestParamsIKeeperRewards.HarvestParamsThe parameters for harvesting Keeper rewards