Skip to main content

GnoGenesisVault

Git Source ↗

Inherits: Initializable ↗, GnoVault, IGnoGenesisVault

Defines the Genesis Vault for Gnosis staking migrated from StakeWise Legacy

State Variables​

_version​

uint8 private constant _version = 4

_poolEscrow​

Note: oz-upgrades-unsafe-allow: state-variable-immutable

IGnoPoolEscrow private immutable _poolEscrow

_rewardGnoToken​

Note: oz-upgrades-unsafe-allow: state-variable-immutable

IRewardGnoToken private immutable _rewardGnoToken

__gap​

This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps

uint256[50] private __gap

Functions​

constructor​

Constructor

Since the immutable variable value is stored in the bytecode, its value would be shared among all proxies pointing to a given contract instead of each proxy’s storage.

Note: oz-upgrades-unsafe-allow: constructor

constructor(GnoVaultConstructorArgs memory args, address poolEscrow, address rewardGnoToken) GnoVault(args);

Parameters

NameTypeDescription
argsGnoVaultConstructorArgsThe arguments for initializing the GnoVault contract
poolEscrowaddressThe address of the pool escrow from StakeWise Legacy
rewardGnoTokenaddressThe address of the rGNO token from StakeWise Legacy

initialize​

Initializes or upgrades the GnoVault contract. Must transfer security deposit during the deployment.

function initialize(bytes calldata) external virtual override(IGnoVault, GnoVault) reinitializer(_version);

Parameters

NameTypeDescription
<none>bytes

vaultId​

Vault Unique Identifier

function vaultId() public pure virtual override(IVaultVersion, GnoVault) returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The unique identifier of the Vault

version​

Version

function version() public pure virtual override(IVaultVersion, GnoVault) returns (uint8);

Returns

NameTypeDescription
<none>uint8The version of the Vault implementation contract

migrate​

Function for migrating from StakeWise Legacy. Can be called only by RewardGnoToken contract.

function migrate(address receiver, uint256 assets) external override returns (uint256 shares);

Parameters

NameTypeDescription
receiveraddressThe address of the receiver
assetsuint256The amount of assets migrated

Returns

NameTypeDescription
sharesuint256The amount of shares minted

_calcMaxMintOsTokenShares​

Internal function for calculating the maximum amount of osToken shares that can be minted based on the current user balance

function _calcMaxMintOsTokenShares(address user) private view returns (uint256);

Parameters

NameTypeDescription
useraddressThe address of the user

Returns

NameTypeDescription
<none>uint256The maximum amount of osToken shares that can be minted

_vaultAssets​

Internal function for retrieving the total assets stored in the Vault. NB! Assets can be forcibly sent to the vault, the returned value must be used with caution

function _vaultAssets() internal view virtual override(VaultState, VaultGnoStaking) returns (uint256);

Returns

NameTypeDescription
<none>uint256The total amount of assets stored in the Vault

_pullWithdrawals​

Pulls assets from withdrawal contract

function _pullWithdrawals() internal override;

Errors​

InvalidInitialHarvest​

error InvalidInitialHarvest();