Skip to main content

RolloverVault

Git Source

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

NameTypeDescription
$RolloverVaultStorageThe 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

NameTypeDescription
namestringThe name of the rollover vault
symbolstringThe symbol of the rollover vault
_decimalsuint8The decimals of the rollover vault
_decimalsOffsetuint8The decimals offset for measuring internal precision of shares
_generalManageraddressThe address of the general manager

__RolloverVault_init_unchained

Initializes the RolloverVault contract only

function __RolloverVault_init_unchained(address _generalManager) internal onlyInitializing;

Parameters

NameTypeDescription
_generalManageraddressThe 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

NameTypeDescription
namestringThe name of the rollover vault
symbolstringThe symbol of the rollover vault
_decimalsuint8The decimals of the rollover vault
_decimalsOffsetuint8The decimals offset for measuring internal precision of shares
_generalManageraddressThe address of the general manager
adminaddressThe 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

NameTypeDescription
<none>uint256The total assets of the vault

usdx

Gets the address of the USDX token

function usdx() public view override returns (address);

Returns

NameTypeDescription
<none>addressThe address of the USDX token

consol

Gets the address of the consol token

function consol() public view override returns (address);

Returns

NameTypeDescription
<none>addressThe address of the consol token

generalManager

Gets the address of the general manager

function generalManager() public view override returns (address);

Returns

NameTypeDescription
<none>addressThe address of the general manager

originationPoolScheduler

Gets the address of the origination pool scheduler

function originationPoolScheduler() public view returns (address);

Returns

NameTypeDescription
<none>addressThe 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

NameTypeDescription
<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

NameTypeDescription
originationPooladdressThe address of the origination pool to check if it is being tracked

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
originationPooladdressThe address of the origination pool to deposit into
amountuint256The 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

NameTypeDescription
originationPooladdressThe 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

NameTypeDescription
_usdxaddressThe address of the USDX token
_consoladdressThe address of the consol token
_generalManageraddressThe address of the general manager
_originationPoolsaddress[]The addresses of the origination pools the rollover vault currently has a balance in
_poolIndexmapping(address => uint256)Mapping of origination pool addresses to their index in the _originationPools array (offset by 1)