AeraVaultAssetRegistry
AeraVaultAssetRegistry
Inherits: IAssetRegistry, Sweepable, ERC165
Maintains a list of registered assets and their oracles (when applicable).
State Variables
MAX_ASSETS
Maximum number of assets.
GRACE_PERIOD_TIME
Time to pass before accepting answers when sequencer comes back up.
vault
Vault address.
numeraireToken
Numeraire token.
feeToken
Fee token.
wrappedNativeToken
Wrapped native token.
sequencer
Sequencer Uptime Feed address for L2.
_assets
STORAGE ///
List of currently registered assets.
numYieldAssets
Number of ERC4626 assets. Maintained for more efficient calculation of spotPrices.
Functions
constructor
FUNCTIONS ///
Parameters
Name | Type | Description |
---|---|---|
|
| Initial owner address. |
|
| Vault address. |
|
| Initial list of registered assets. |
|
| Numeraire token address. |
|
| Fee token address. |
|
| Wrapped native token address. |
|
| Sequencer Uptime Feed address for L2. |
addAsset
Add a new asset.
MUST revert if not called by owner.
MUST revert if asset with the same address exists.
Parameters
Name | Type | Description |
---|---|---|
|
| Asset information for new asset. |
removeAsset
Remove an asset.
MUST revert if not called by owner.
Parameters
Name | Type | Description |
---|---|---|
|
| An asset to remove. |
assets
Get a list of all registered assets.
MUST return assets in an order sorted by address.
Returns
Name | Type | Description |
---|---|---|
|
| assets List of assets. |
spotPrices
Calculate spot prices of non-ERC4626 assets.
MUST return assets in the same order as in assets but with ERC4626 assets filtered out.
Returns
Name | Type | Description |
---|---|---|
|
| spotPrices Spot prices of non-ERC4626 assets in 18 decimals. |
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[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
_checkAssetOracle
INTERNAL FUNCTIONS ///
Ensure non-zero oracle address for ERC20 and zero oracle address for ERC4626.
Parameters
Name | Type | Description |
---|---|---|
|
| Asset details to check |
_checkOraclePrice
Ensure oracle returns valid value and it's up to date.
Parameters
Name | Type | Description |
---|---|---|
|
| Asset details to check. |
Returns
Name | Type | Description |
---|---|---|
|
| Valid oracle price. |
_checkUnderlyingAsset
Check whether the underlying asset is listed as an ERC20.
Will revert if underlying asset is an ERC4626.
Parameters
Name | Type | Description |
---|---|---|
|
| ERC4626 asset to check underlying asset. |
|
| Array of assets. |
_insertAsset
Insert asset at the given index in an array of assets.
Parameters
Name | Type | Description |
---|---|---|
|
| New asset details. |
|
| Index of the new asset in the asset array. |
_checkAssetRegistryOwner
Check that owner is not the vault or the guardian.
Parameters
Name | Type | Description |
---|---|---|
|
| Asset registry owner address. |
|
| Vault address. |
transferOwnership
Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.
Events
AssetAdded
EVENTS ///
Emitted when a new asset is added.
AssetRemoved
Emitted when an asset is removed.
Created
Emitted in constructor.
Errors
Aera__NumberOfAssetsExceedsMaximum
ERRORS ///
Aera__NumeraireTokenIsNotRegistered
Aera__NumeraireTokenIsERC4626
Aera__NumeraireOracleIsNotZeroAddress
Aera__FeeTokenIsNotRegistered
Aera__FeeTokenIsERC4626
Aera__WrappedNativeTokenIsNotRegistered
Aera__WrappedNativeTokenIsERC4626
Aera__AssetOrderIsIncorrect
Aera__AssetRegistryInitialOwnerIsZeroAddress
Aera__AssetRegistryOwnerIsGuardian
Aera__AssetRegistryOwnerIsVault
Aera__ERC20OracleIsZeroAddress
Aera__ERC4626OracleIsNotZeroAddress
Aera__UnderlyingAssetIsNotRegistered
Aera__UnderlyingAssetIsItselfERC4626
Aera__AssetIsUnderlyingAssetOfERC4626
Aera__AssetIsAlreadyRegistered
Aera__AssetNotRegistered
Aera__CannotRemoveNumeraireToken
Aera__CannotRemoveFeeToken
Aera__CannotRemoveWrappedNativeToken
Aera__VaultIsZeroAddress
Aera__SequencerIsDown
Aera__GracePeriodNotOver
Aera__OraclePriceIsInvalid
Aera__OraclePriceIsTooOld
Last updated