VaultGnoStaking
Inherits: Initializable ↗, VaultAdmin, VaultState, VaultValidators, VaultEnterExit, IVaultGnoStaking
Defines the Gnosis staking functionality for the Vault
State Variables
_securityDeposit
uint256 private constant _securityDeposit = 1e9
_gnoToken
IERC20 internal immutable _gnoToken
_tokensConverterFactory
ITokensConverterFactory private immutable _tokensConverterFactory
_tokensConverter
IGnoTokensConverter internal _tokensConverter
__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[49] 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 gnoToken, address tokensConverterFactory) ;
Parameters
| Name | Type | Description |
|---|---|---|
gnoToken | address | The address of the GNO token |
tokensConverterFactory | address | The address of the tokens converter factory |
deposit
Deposit GNO to the Vault
function deposit(uint256 assets, address receiver, address referrer)
public
virtual
override
returns (uint256 shares);
Parameters
| Name | Type | Description |
|---|---|---|
assets | uint256 | The amount of GNO to deposit |
receiver | address | The address that will receive Vault's shares |
referrer | address | The address of the referrer. Set to zero address if not used. |
Returns
| Name | Type | Description |
|---|---|---|
shares | uint256 | The number of shares minted |
donateAssets
Donate assets to the Vault. Must approve GNO transfer before the call.
function donateAssets(uint256 amount) external override;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | The amount of GNO to donate |
receive
Function for receiving xDAI and forwarding it to the tokens converter
receive() external payable;
_registerValidators
Internal function for registering validators
function _registerValidators(ValidatorUtils.ValidatorDeposit[] memory deposits) internal virtual override;
Parameters
| Name | Type | Description |
|---|---|---|
deposits | ValidatorUtils.ValidatorDeposit[] | The validators registration data |
_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 returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The total amount of assets stored in the Vault |
_transferVaultAssets
Internal function for transferring assets from the Vault to the receiver
function _transferVaultAssets(address receiver, uint256 assets) internal virtual override nonReentrant;
Parameters
| Name | Type | Description |
|---|---|---|
receiver | address | The address that will receive the assets |
assets | uint256 | The number of assets to transfer |
_pullWithdrawals
Pulls assets from withdrawal contract
function _pullWithdrawals() internal virtual;
__VaultGnoStaking_upgrade
Upgrades the VaultGnoStaking contract
function __VaultGnoStaking_upgrade() internal onlyInitializing;
__VaultGnoStaking_init
Initializes the VaultGnoStaking contract
function __VaultGnoStaking_init() internal onlyInitializing;
__VaultGnoStaking_init_common
Common initialization for gas optimization
function __VaultGnoStaking_init_common() private;