MasterPriceOracle
Inherits: Ownable, IOracle
Author: Sperax Foundation
Communicates with different price feeds to get the price
State Variables
tokenPriceFeed
Store price feed data for tokens.
Functions
updateTokenPriceFeed
Add/Update price feed for _token
Have to be extra cautious while updating the price feed.
Parameters
_token
address
address of the desired token.
_source
address
price feed source.
_data
bytes
call data for fetching the price feed.
removeTokenPriceFeed
Remove an existing price feed for _token
.
Parameters
_token
address
address of the token.
getPrice
Gets the price feed for _token
.
Function reverts if the price feed does not exists.
Parameters
_token
address
address of the desired token.
Returns
PriceData
(uint256 price, uint256 precision).
priceFeedExists
Validates if price feed exists for a _token
Function reverts if price feed not set.
Parameters
_token
address
address of the desired token.
Returns
bool
bool if price feed exists.
_getPriceFeed
Gets the price feed for a _token
given the feed data.
Parameters
_token
address
address of the desired token.
_source
address
price feed source.
_msgData
bytes
call data for fetching feed.
Returns
priceData
PriceData
(uint256 price, uint256 precision).
Events
PriceFeedUpdated
PriceFeedRemoved
Errors
InvalidAddress
UnableToFetchPriceFeed
InvalidPriceFeed
PriceFeedNotFound
Last updated