Skip to main content

EthFoxVault

Git Source

Inherits: VaultImmutables, Initializable, VaultAdmin, VaultVersion, VaultFee, VaultState, VaultValidators, VaultEnterExit, VaultMev, VaultEthStaking, VaultBlocklist, Multicall, IEthFoxVault

Author: StakeWise

Custom Ethereum non-ERC20 vault with blocklist, own MEV and without osToken minting.

State Variables

_version

uint8 private constant _version = 2;

__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(
address keeper,
address vaultsRegistry,
address validatorsRegistry,
address validatorsWithdrawals,
address validatorsConsolidations,
address consolidationsChecker,
address sharedMevEscrow,
address depositDataRegistry,
uint256 exitingAssetsClaimDelay
)
VaultImmutables(keeper, vaultsRegistry)
VaultValidators(
depositDataRegistry,
validatorsRegistry,
validatorsWithdrawals,
validatorsConsolidations,
consolidationsChecker
)
VaultEnterExit(exitingAssetsClaimDelay)
VaultMev(sharedMevEscrow);

Parameters

NameTypeDescription
keeperaddressThe address of the Keeper contract
vaultsRegistryaddressThe address of the VaultsRegistry contract
validatorsRegistryaddressThe contract address used for registering validators in beacon chain
validatorsWithdrawalsaddressThe contract address used for withdrawing validators in beacon chain
validatorsConsolidationsaddressThe contract address used for consolidating validators in beacon chain
consolidationsCheckeraddressThe contract address used for checking consolidations
sharedMevEscrowaddressThe address of the shared MEV escrow
depositDataRegistryaddressThe address of the DepositDataRegistry contract
exitingAssetsClaimDelayuint256The delay after which the assets can be claimed after exiting from staking

initialize

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

function initialize(bytes calldata) external payable virtual override reinitializer(_version);

Parameters

NameTypeDescription
<none>bytes

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

ejectUser

Ejects user from the Vault. Can only be called by the blocklist manager. The ejected user will be added to the blocklist and all his shares will be sent to the exit queue.

function ejectUser(address user) external override;

Parameters

NameTypeDescription
useraddressThe address of the user to eject

receive

Function for depositing using fallback function

receive() external payable virtual override;

vaultId

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

version

Version

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

Returns

NameTypeDescription
<none>uint8The version of the Vault implementation contract

_checkCanWithdrawValidators

Internal function for checking whether the caller can withdraw validators

function _checkCanWithdrawValidators(bytes calldata validators, bytes calldata validatorsManagerSignature)
internal
override;

Parameters

NameTypeDescription
validatorsbytesThe concatenated validators data
validatorsManagerSignaturebytesThe optional signature from the validators manager