VaultCore
VaultCore
MAX_INT
uint256 MAX_INT
MAX_UINT
uint256 MAX_UINT
whenNotRebasePaused
modifier whenNotRebasePaused()
Verifies that the rebasing is not paused.
whenNotCapitalPaused
modifier whenNotCapitalPaused()
Verifies that the deposits are not paused.
onlyOusdMetaStrategy
modifier onlyOusdMetaStrategy()
mint
function mint(address _asset, uint256 _amount, uint256 _minimumOusdAmount) external
Deposit a supported asset and mint OTokens.
Parameters
Name | Type | Description |
---|---|---|
_asset | address | Address of the asset being deposited |
_amount | uint256 | Amount of the asset being deposited |
_minimumOusdAmount | uint256 | Minimum OTokens to mint |
mintForStrategy
function mintForStrategy(uint256 _amount) external
Mint OTokens for a Metapool Strategy
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount of the asset being deposited Notice: can't use nonReentrant modifier since the mint function can call allocate , and that can trigger ConvexOUSDMetaStrategy to call this function while the execution of the mint has not yet completed -> causing a nonReentrant collision. Also important to understand is that this is a limitation imposed by the test suite. Production / mainnet contracts should never be configured in a way where mint/redeem functions that are moving funds between the Vault and end user wallets can influence strategies utilizing this function. |
redeem
function redeem(uint256 _amount, uint256 _minimumUnitAmount) external
Withdraw a supported asset and burn OTokens.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount of OTokens to burn |
_minimumUnitAmount | uint256 | Minimum stablecoin units to receive in return |
_redeem
function _redeem(uint256 _amount, uint256 _minimumUnitAmount) internal
Withdraw a supported asset and burn OTokens.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount of OTokens to burn |
_minimumUnitAmount | uint256 | Minimum stablecoin units to receive in return |
burnForStrategy
function burnForStrategy(uint256 _amount) external
Burn OTokens for Metapool Strategy
Notice: can't use nonReentrant
modifier since the redeem
function could
require withdrawal on ConvexOUSDMetaStrategy
and that one can call burnForStrategy
while the execution of the redeem
has not yet completed -> causing a nonReentrant
collision.
Also important to understand is that this is a limitation imposed by the test suite. Production / mainnet contracts should never be configured in a way where mint/redeem functions that are moving funds between the Vault and end user wallets can influence strategies utilizing this function.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount of OUSD to burn |
redeemAll
function redeemAll(uint256 _minimumUnitAmount) external
Withdraw a supported asset and burn all OTokens.
Parameters
Name | Type | Description |
---|---|---|
_minimumUnitAmount | uint256 | Minimum stablecoin units to receive in return |
allocate
function allocate() external
Allocate unallocated funds on Vault to strategies.
_allocate
function _allocate() internal
Allocate unallocated funds on Vault to strategies.
rebase
function rebase() external virtual
Calculate the total value of assets held by the Vault and all strategies and update the supply of OTokens.
_rebase
function _rebase() internal returns (uint256)
Calculate the total value of assets held by the Vault and all strategies and update the supply of OTokens, optionally sending a portion of the yield to the trustee.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | totalUnits Total balance of Vault in units |
totalValue
function totalValue() external view virtual returns (uint256 value)
Determine the total value of assets held by the vault and its strategies.
Return Values
Name | Type | Description |
---|---|---|
value | uint256 | Total value in USD/ETH (1e18) |
_totalValue
function _totalValue() internal view virtual returns (uint256 value)
Internal Calculate the total value of the assets held by the vault and its strategies.
Return Values
Name | Type | Description |
---|---|---|
value | uint256 | Total value in USD/ETH (1e18) |
_totalValueInVault
function _totalValueInVault() internal view returns (uint256 value)
Internal to calculate total value of all assets held in Vault.
Return Values
Name | Type | Description |
---|---|---|
value | uint256 | Total value in USD/ETH (1e18) |