PRICEv2
Inherits: ModuleWithSubmodules, IPRICEv2, IERC165
Author: Oighty
Abstract Bophades module for price resolution
Constants
_UNIT_OF_ACCOUNT
address internal constant _UNIT_OF_ACCOUNT = address(840);
State Variables
_observationFrequency
The frequency of price observations (in seconds)
uint48 internal _observationFrequency;
_decimals
The number of decimals to used in output values
uint8 internal _decimals;
assets
The addresses of tracked assets
address[] public assets;
_assetData
Maps asset addresses to configuration data
mapping(address => Asset) internal _assetData;
isNonContractAsset
Tracks registered non-contract assets
mapping(address => bool) public isNonContractAsset;
Functions
constructor
constructor(Kernel kernel_) Module(kernel_);
Parameters
| Name | Type | Description |
|---|---|---|
| kernel_ | Kernel |
observationFrequency
The frequency of price observations (in seconds)
function observationFrequency() external view virtual override returns (uint48);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint48 |
decimals
The number of decimals to used in output values
function decimals() external view virtual override returns (uint8);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint8 |
unitOfAccount
The reserved unit-of-account key
function unitOfAccount() external pure virtual override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
_validateAssetIsManageable
Reverts unless asset_ is a contract or a registered non-contract asset
Will revert if:
asset_is a non-contract address that is not registered
function _validateAssetIsManageable(address asset_) internal view;
Parameters
| Name | Type | Description |
|---|---|---|
| asset_ | address |
supportsInterface
function supportsInterface(bytes4 interfaceId_) public pure virtual returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId_ | bytes4 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |