Skip to main content

EthPrivVault

Git Source ↗

Inherits: Initializable ↗, EthVault, VaultWhitelist, IEthPrivVault

Defines the Ethereum staking Vault with whitelist

State Variables​

_version​

uint8 private constant _version = 5

__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(EthVaultConstructorArgs memory args) EthVault(args);

Parameters

NameTypeDescription
argsEthVaultConstructorArgsThe arguments for initializing the EthVault contract

initialize​

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

function initialize(bytes calldata params)
external
payable
virtual
override(IEthVault, EthVault)
reinitializer(_version);

Parameters

NameTypeDescription
paramsbytesThe encoded parameters for initializing the EthVault contract

deposit​

Deposit ETH to the Vault

function deposit(address receiver, address referrer)
public
payable
virtual
override(IVaultEthStaking, VaultEthStaking)
returns (uint256 shares);

Parameters

NameTypeDescription
receiveraddressThe address that will receive Vault's shares
referreraddressThe address of the referrer. Set to zero address if not used.

Returns

NameTypeDescription
sharesuint256The number of shares minted

receive​

Function for depositing using fallback function

receive() external payable virtual override;

mintOsToken​

Mints OsToken shares

function mintOsToken(address receiver, uint256 osTokenShares, address referrer)
public
virtual
override(IVaultOsToken, VaultOsToken)
returns (uint256 assets);

Parameters

NameTypeDescription
receiveraddressThe address that will receive the minted OsToken shares
osTokenSharesuint256The number of OsToken shares to mint to the receiver. To mint the maximum amount of shares, use 2^256 - 1.
referreraddressThe address of the referrer

Returns

NameTypeDescription
assetsuint256The number of assets minted to the receiver

vaultId​

Vault Unique Identifier

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

Returns

NameTypeDescription
<none>bytes32The unique identifier of the Vault

version​

Version

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

Returns

NameTypeDescription
<none>uint8The version of the Vault implementation contract