Overview
PermissionedChainlinkOracle is a minimal, owner-controlled price feed that implements the latestRoundData() part of Chainlink’s AggregatorV3 interface. It provides prices for assets that have no native Chainlink feed.
Its main use is as a price source for custom AaveOracle deployments. The SwapModule reads those AaveOracle deployments to value assets and enforce minimum swap output.
Constructor parameters
The constructor reverts with
InvalidDecimals if decimals_ > 36, and with InvalidAllowedRange if minAllowedAnswer_ is negative or greater than maxAllowedAnswer_. The price bounds are immutable.
Functions
latestRoundData()
Returns (0, latestAnswer, latestTimestamp, latestTimestamp, 0). roundId and answeredInRound are always 0. getRoundData and historical rounds are not implemented.
updatePrice(int256 newAnswer)
Owner only. Stores a new price and sets latestTimestamp to the current block time. Reverts with InvalidPrice if newAnswer is outside [minAllowedAnswer, maxAllowedAnswer].
Public state
Events
roundId is always 0.
Deployment
Mellow deploys instances deterministically with aPermissionedOracleFactory using CREATE2. The same initialization parameters always produce the same feed address.