TellorToo, allows users to access numerical data with the option to challenge the validity of any data point with proof from Tellor's decentralized oracle on Ethereum's mainnet.
Get data on your smart contract by reading from TellorToo by calling the function a single function:
- getCurrentValue
getCurrentValue(uint256 _requestId)
Here is the list with the definitions of each requestId: https://docs.tellor.io/dev-documentation/reference-page/data-request-ids-1
If the data needed is not available, please submit a Tellor Improvement Plan(TIP) to have your data supported.
Allow your contract to read from TellorToo
import "./TellorToo.sol";
contract YourContract is TellorToo {
TellorToo tellor;
/*Constructor*/
/**
* @dev the constructor sets the storage address and owner
* @param _tellor is the TellorToo address
*/
constructor(address payable _TellorToo) public {
tellor = TellorToo(_TellorToo);
}
/**
* @dev Allows the user to get the latest value for the requestId specified
* @param _requestId is the requestId to look up the value for
* @return ifRetrieve bool true if it is able to retreive a value, the value, and the value's timestamp
* @return value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getCurrentValue(uint256 _requestId) public view returns (bool ifRetrieve, uint256 value, uint256 _timestampRetrieved) {
return tellor.getCurrentValue(_requestId);
}
}
Mainnets:
-
Matic TellorToo : 0x77352E8f026cb5D880AcFe06F9Acc215E0711F85
-
Ethereum TellorSender: 0xb9516057dc40c92f91b6ebb2e3d04288cd0446f1
Testnets:
-
Mumbai (Matic's testnet) TellorToo : 0xBf8a66DeC65A004B6D89950079B66013A4ac9f0D
-
Goerli (Ethereum's testnet)TellorSender: 0x050514e7d074F670758114AaCcE776943A95E105
Challenge invalid data and automatically fall back to Tellor's Ethereum's data. A fee to intiate a challenge is charged to incentivize pushing Ethereum's data and to disincentivize spaming the network with irrelevant challenges. The challenge fee is paid out to the party that runs the Sender.retrieveDataAndSend or Sender.getCurrentValueAndSend functions on Ethereum's mainnet to send over data to settle the challenge on the side chain.
function challengeData(uint256 _requestId, uint256 _timestamp)
Once a challenge is initiated, there is a 1 hour wait time before it can be settled to Tellor's mainnet. The wait time allows for data to be requested on Tellor mainnet, in the event that it has not been mined in the allowed timeframe(data can be too old). To allow enough time for disputes on mainnet data, once the data is available on mainnet there is also a 1 hour wait time before the challenge can be settled.
function settleChallenge(uint256 _requestId, uint256 _timestamp)