TermPriceConsumerV3.sol
This contract operates at the protocol level and governs all instances of a Term Repo. This contract is a centralized price oracle contract that feeds pricing data to all Term Repos.
TermPriceConsumerV3
This contract is a centralized price oracle contract that feeds pricing data to all Term Repos
This contract operates at the protocol level and governs all instances of a Term Repo
DEVOPS_ROLE
bytes32 DEVOPS_ROLE
priceFeeds
mapping(address => contract AggregatorV3Interface) priceFeeds
constructor
constructor() public
initialize
function initialize(address devopsWallet_) external
Intializes with an array of token addresses, followed with an array of Chainlink aggregator addresses https://docs.chain.link/docs/ethereum-addresses/
addNewTokenPriceFeed
function addNewTokenPriceFeed(address token, address tokenPriceAggregator) external
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The proxy price aggregator address for token to be added
removeTokenPriceFeed
function removeTokenPriceFeed(address token) external
Parameters
token
address
The address of the token whose price feed needs to be removed
usdValueOfTokens
function usdValueOfTokens(address token, uint256 amount) external view returns (struct ExponentialNoError.Exp)
A function to return current market value given a token address and an amount
Parameters
token
address
The address of the token to query
amount
uint256
The amount tokens to value
Return Values
[0]
struct ExponentialNoError.Exp
The current market value of tokens at the specified amount, in USD
_getLatestPrice
function _getLatestPrice(address token) internal view returns (int256)
Return Values
[0]
int256
The latest price from price aggregator
_getDecimals
function _getDecimals(address token) internal view returns (uint8)
Return Values
[0]
uint8
The decimal places in price feed
_authorizeUpgrade
function _authorizeUpgrade(address) internal view
required override by the OpenZeppelin UUPS module
Last updated