Skip to main content

VaultAdmin

Git Source

Inherits: Initializable, IVaultAdmin

Author: StakeWise

Defines the admin functionality for the Vault

State Variables

admin

The Vault admin

address public override admin;

__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

setMetadata

Function for updating the metadata IPFS hash. Can only be called by Vault admin.

function setMetadata(string calldata metadataIpfsHash) external override;

Parameters

NameTypeDescription
metadataIpfsHashstringThe new metadata IPFS hash

setAdmin

Function for updating the admin address. Can only be called by Vault current admin.

function setAdmin(address newAdmin) external override;

Parameters

NameTypeDescription
newAdminaddressThe new admin address

_checkAdmin

Internal method for checking whether the caller is admin

function _checkAdmin() internal view;

_setAdmin

Internal method for updating the admin

function _setAdmin(address newAdmin) private;

Parameters

NameTypeDescription
newAdminaddressThe address of the new admin

__VaultAdmin_init

Initializes the VaultAdmin contract

function __VaultAdmin_init(address _admin, string memory metadataIpfsHash) internal onlyInitializing;

Parameters

NameTypeDescription
_adminaddressThe address of the Vault admin
metadataIpfsHashstring