Skip to main content

EthPrivMetaVault

Git Source ↗

Inherits: Initializable ↗, EthMetaVault, VaultWhitelist, IEthPrivMetaVault

Defines the Meta Vault functionality with whitelist on Ethereum

State Variables

_version

uint8 private constant _version = 7

__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(EthMetaVaultConstructorArgs memory args) EthMetaVault(args);

Parameters

NameTypeDescription
argsEthMetaVaultConstructorArgsThe arguments for initializing the EthMetaVault contract

initialize

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

function initialize(bytes calldata params)
external
payable
virtual
override(IEthMetaVault, EthMetaVault)
reinitializer(_version);

Parameters

NameTypeDescription
paramsbytesThe encoded parameters for initializing the EthMetaVault contract

deposit

Deposit ETH to the Vault

function deposit(address receiver, address referrer)
public
payable
virtual
override(IEthMetaVault, EthMetaVault)
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, EthMetaVault) returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The unique identifier of the Vault

version

Version

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

Returns

NameTypeDescription
<none>uint8The version of the Vault implementation contract