Chainlink Oracle
This contract is in charge or reading the information from a Chainlink Oracle. TCAP contracts read the price directly from this contract. More information can be found on Chainlink Documentation.
Code
Contract Addresses
Mainnet
Pair | Address |
---|---|
ETH/USD | 0x2cFeaf282FE9ae050b210e7BDa65D288C40c6104 |
DAI/USD | 0x6b5a75f38BeA1Ef59Bc43A5d9602e77Bcbe65e46 |
Total Market Cap | 0xa4e581BD159B869e8290707A7FBF841fe7FE97b6 |
Rinkeby
Pair | Address |
---|---|
ETH/USD | 0xc122B95f6Bcd2ba83fEfDcAD84f57e38Ca9daecf |
DAI/USD | 0x71263D4DBd31e57E334c7045e46eB781B9Db3386 |
Total Market Cap | 0x199e26325b1ebC1F736536f4FaeeddC4bb4D10a2 |
ERC165 Introspection
The computed interface ID according to ERC-165. The interface ID is a XOR of all interface method selectors.
Private Variables
The address of the chainlink aggregator contract.
The computed interface ID according to ERC-165. Indicates if this contract supports the chainlink oracle functions.
The computed interface ID according to ERC-165. Indicates if this contract supports the ERC165 interface.
Read-Only Functions
getLatestAnswer
Returns the latest answer from the reference contract.
getLatestTimestamp
Returns the last time the Oracle was updated.
getLatestRound
Returns the all the information from the latest round update on aggregator.
getPreviousAnswer
Returns a previous answer updated on the Oracle with given _id.
getPreviousTimestamp
Returns a previous time the Oracle was updated.
getRound
Returns a given round from the reference contract with the _id
.
supportsInterface
ERC165 Standard for support of interfaces.
State-Changing Functions
constructor
Called once the contract it's deployed. Set the Chainlink Oracle as an aggregator.
setReferenceContract
Changes the reference contract used to read the information from Chainlink Oracle. Only owner can call it.