LogarithmOracle

Inherits: UUPSUpgradeable, Ownable2StepUpgradeable, IOracle Author: Logarithm Labs

The LogarithmOracle is a price oracle contract that provides price feeds for various assets using Chainlink price feeds. It implements the UUPS upgradeable pattern and includes ownership controls. The contract serves as a centralized price oracle that manages price feeds for different assets, handles price feed heartbeat monitoring, provides price conversion between different assets, and maintains asset decimal information.

State Variables

LogarithmOracleStorageLocation

bytes32 private constant LogarithmOracleStorageLocation =
    0x2c93e30cf348944d3203d68cfbfc99aa913023170c5de2049def7c26b25c6400;

Functions

_getLogarithmOracleStorage

function _getLogarithmOracleStorage() private pure returns (LogarithmOracleStorage storage $)

initialize

function initialize(address owner_) external initializer

setPriceFeeds

Updates price feeds for multiple assets.

function setPriceFeeds(address[] calldata assets, address[] calldata feeds) external onlyOwner

setAssetDecimals

Sets decimals of non-existing assets on this chain.

setHeartbeats

Configures heartbeat durations for price feeds.

getPriceFeed

Returns the price feed address for an asset.

getAssetPrice

Returns the normalized price of an asset (30 decimals).

convertTokenAmount

Converts amount between different assets.

assetDecimals

Returns the decimal places for an asset.

_setAssetDecimal

Internal function to set asset decimals.

Events

PriceFeedUpdated

Emitted when a price feed is updated.

HeartBeatUpdated

Emitted when a heartbeat duration is updated.

AssetDecimalInitiated

Emitted when asset decimals are set.

Structs

LogarithmOracleStorage

Last updated