Skip to main content

VaultVersion

Git Source

Inherits: VaultImmutables, Initializable, UUPSUpgradeable, VaultAdmin, IVaultVersion

Author: StakeWise

Defines the versioning functionality for the Vault

State Variables

_initSelector

bytes4 private constant _initSelector = bytes4(keccak256("initialize(bytes)"));

__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

implementation

Implementation

function implementation() external view override returns (address);

Returns

NameTypeDescription
<none>addressThe address of the Vault implementation contract

upgradeToAndCall

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls _authorizeUpgrade. Emits an Upgraded event.

Note: oz-upgrades-unsafe-allow-reachable: delegatecall

function upgradeToAndCall(address newImplementation, bytes memory data) public payable override onlyProxy;

_authorizeUpgrade

*Function that should revert when msg.sender is not authorized to upgrade the contract. Called by upgradeToAndCall. Normally, this function will use an xref:access.adoc[access control] modifier such as Ownable-onlyOwner.

function _authorizeUpgrade(address) internal onlyOwner {}
```*


```solidity
function _authorizeUpgrade(address newImplementation) internal view override;

vaultId

Vault Unique Identifier

function vaultId() public pure virtual override returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The unique identifier of the Vault

version

Version

function version() public pure virtual override returns (uint8);

Returns

NameTypeDescription
<none>uint8The version of the Vault implementation contract