Skip to content

Latest commit

 

History

History
111 lines (72 loc) · 4.21 KB

README.md

File metadata and controls

111 lines (72 loc) · 4.21 KB

TellorToo

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.

Getting data

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.

Code example

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);
    }

}

Addresses

Mainnets:

Testnets:

Challenge Data

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)

Settle challenge

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)