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
addAsset
Add a new asset.
MUST revert if not called by owner.
MUST revert if asset with the same address exists.
Parameters
removeAsset
Remove an asset.
MUST revert if not called by owner.
Parameters
assets
Get a list of all registered assets.
MUST return assets in an order sorted by address.
Returns
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
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
_checkOraclePrice
Ensure oracle returns valid value and it's up to date.
Parameters
Returns
_checkUnderlyingAsset
Check whether the underlying asset is listed as an ERC20.
Will revert if underlying asset is an ERC4626.
Parameters
_insertAsset
Insert asset at the given index in an array of assets.
Parameters
_checkAssetRegistryOwner
Check that owner is not the vault or the guardian.
Parameters
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