ChainlinkOracleFactory
Inherits: BaseOracleFactory
Title: ChainlinkOracleFactory
Author: OlympusDAO
Factory contract for deploying ChainlinkOracle clones for base/quote token pairs
Uses ClonesWithImmutableArgs for gas-efficient oracle deployment
Constants
ORACLE_IMPLEMENTATION
Reference implementation for cloning
ChainlinkOracleCloneable public immutable ORACLE_IMPLEMENTATION;
Functions
constructor
Constructs a new ChainlinkOracleFactory
Reverts if priceCache_ is not a valid IPriceCache policy for this Kernel.
constructor(Kernel kernel_, address priceCache_) BaseOracleFactory(kernel_, priceCache_);
Parameters
| Name | Type | Description |
|---|---|---|
| kernel_ | Kernel | The Kernel address |
| priceCache_ | address | The price cache policy address |
_getOracleImplementation
Returns the Chainlink oracle implementation address for cloning
function _getOracleImplementation() internal view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address | The address of the ChainlinkOracleCloneable implementation |
_encodeOracleData
Encodes oracle-specific data for cloning
Generates oracle name and encodes immutable args.
function _encodeOracleData(
address baseToken_,
address quoteToken_,
uint48 maxAge_,
bytes calldata
) internal view override returns (bytes memory);
Parameters
| Name | Type | Description |
|---|---|---|
| baseToken_ | address | The base token address |
| quoteToken_ | address | The quote token address |
| maxAge_ | uint48 | The maximum age (in seconds) of cached prices used by the oracle |
| _ | bytes | Service-specific custom parameters (can be empty) |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes | bytes The encoded bytes for cloning |