Ethereum smart contracts cannot access off-chain data. If your smart contract relies on off-chain (e.g. internet) data to evaluate or execute a function, you either have to manually feed the data to your contract, incentivize users to do it, or rely on a centralized party to provide the data.
The Tellor oracle is a decentralized oracle. It provides an option for contracts to securely interact with and obtain data from off-chain.
For more indepth information about Tellor checkout our documenation, whitepaper and FAQ page.
Quick references are included below:
- Implement Tellor into your project
- Use npm to install the usingTellor repo.
npm install usingtellor
-
Import UsingTellor.sol into your smart contract and ensure your contract inherits from it by adding "is UsingTellor".
-
Pass through the user contract address ( 0x09459fdafD6Fdce14E04B3487A656FBca0b953ea ) in your constructor. See example below:
pragma solidity ^0.5.0;
import './UsingTellor.sol';
contract YourContract is UsingTellor{
...
constructor(address _userContract) UsingTellor(_userContract) public{
}
/**
* @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 bool true if it is able to retreive a value, the value, and the value's timestamp
*/
function getLastValue(uint256 _requestId) public view returns (bool ifRetrieve, uint256 value, uint256 _timestampRetrieved) {
return getCurrentValue(_requestId);
}
...
}
-
Miner Documentation
-
General Tellor Developer's Documentation
This repository is maintained by the Tellor team
Check out our issues log here on Github or contribute to our future plans to build a better miner and more examples of data secured by Tellor.
Tellor Inc. 2019