RolloverVault
Inherits: LiquidityVault, IRolloverVault
Title: FulfillmentVault
Author: @SocksNFlops
The RolloverVault contract used to automatically rotate unused assets into origination pools.
State Variables
RolloverVaultStorageLocation
The storage location of the RolloverVault contract
keccak256(abi.encode(uint256(keccak256("buttonwood.storage.RolloverVault")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant RolloverVaultStorageLocation =
0x3f3d57a95a7cc1b3218bff2f60330bfeb789b9a101fe5e689535b16f8256e000
Functions
receive
Allow the contract to receive network native tokens (HYPE bridged from Core)
receive() external payable;
_getRolloverVaultStorage
Gets the storage location of the RolloverVault contract
function _getRolloverVaultStorage() private pure returns (RolloverVaultStorage storage $);
Returns
| Name | Type | Description |
|---|---|---|
$ | RolloverVaultStorage | The storage location of the RolloverVault contract |
__RolloverVault_init
Initializes the RolloverVault contract and calls parent initializers
function __RolloverVault_init(
string memory name,
string memory symbol,
uint8 _decimals,
uint8 _decimalsOffset,
address _generalManager
) internal onlyInitializing;
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the rollover vault |
symbol | string | The symbol of the rollover vault |
_decimals | uint8 | The decimals of the rollover vault |
_decimalsOffset | uint8 | The decimals offset for measuring internal precision of shares |
_generalManager | address | The address of the general manager |
__RolloverVault_init_unchained
Initializes the RolloverVault contract only
function __RolloverVault_init_unchained(address _generalManager) internal onlyInitializing;
Parameters
| Name | Type | Description |
|---|---|---|
_generalManager | address | The address of the general manager |
initialize
Initializes the RolloverVault contract
function initialize(
string memory name,
string memory symbol,
uint8 _decimals,
uint8 _decimalsOffset,
address _generalManager,
address admin
) external initializer;
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the rollover vault |
symbol | string | The symbol of the rollover vault |
_decimals | uint8 | The decimals of the rollover vault |
_decimalsOffset | uint8 | The decimals offset for measuring internal precision of shares |
_generalManager | address | The address of the general manager |
admin | address | The address of the admin for the rollover vault |
supportsInterface
Returns true if this contract implements the interface defined by
interfaceId. See the corresponding
https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
to learn more about how these ids are created.
This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) public view override(LiquidityVault) returns (bool);
_totalAssets
Calculates the total assets of the vault
function _totalAssets() internal view override returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The total assets of the vault |
usdx
Gets the address of the USDX token
function usdx() public view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The address of the USDX token |
consol
Gets the address of the consol token
function consol() public view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The address of the consol token |
generalManager
Gets the address of the general manager
function generalManager() public view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The address of the general manager |
originationPoolScheduler
Gets the address of the origination pool scheduler
function originationPoolScheduler() public view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The address of the origination pool scheduler |
originationPools
Gets the addresses of the origination pools the rollover vault currently has a balance in
function originationPools() external view override returns (address[] memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | The addresses of the origination pools the rollover vault currently has a balance in |
isTracked
Checks if the given origination pool is being tracked by the rollover vault
function isTracked(address originationPool) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
originationPool | address | The address of the origination pool to check if it is being tracked |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if the origination pool is being tracked, false otherwise |
depositOriginationPool
Deposits the given amount of the given origination pool into the rollover vault
function depositOriginationPool(address originationPool, uint256 amount) external onlyRole(KEEPER_ROLE) whenPaused;
Parameters
| Name | Type | Description |
|---|---|---|
originationPool | address | The address of the origination pool to deposit into |
amount | uint256 | The amount of the origination pool to deposit |
redeemOriginationPool
Redeems the entire balance of the given origination pool from the rollover vault
function redeemOriginationPool(address originationPool) external onlyRole(KEEPER_ROLE) whenPaused;
Parameters
| Name | Type | Description |
|---|---|---|
originationPool | address | The address of the origination pool to redeem from |
Structs
RolloverVaultStorage
The storage for the RolloverVault contract
Note: storage-location: erc7201:buttonwood.storage.RolloverVault
struct RolloverVaultStorage {
address _usdx;
address _consol;
address _generalManager;
address[] _originationPools;
mapping(address => uint256) _poolIndex;
}
Properties
| Name | Type | Description |
|---|---|---|
_usdx | address | The address of the USDX token |
_consol | address | The address of the consol token |
_generalManager | address | The address of the general manager |
_originationPools | address[] | The addresses of the origination pools the rollover vault currently has a balance in |
_poolIndex | mapping(address => uint256) | Mapping of origination pool addresses to their index in the _originationPools array (offset by 1) |