ITellor
Title: ITellor
Author: Vendored minimal subset of Tellor (https://github.com/tellor-io).
Upstream license: MIT.
Minimal interface for the Tellor oracle (TellorFlex).
Vendored subset — do not add a usingtellor dependency. Tellor is a dispute-based oracle:
reporters post data permissionlessly and bad values are removed by dispute. Best practice is to
read data at least a dispute buffer old (e.g. 15-20 min) via getDataBefore so disputed values
are removed first. SpotPrice value is abi.encode(uint256) at 18 decimals (WAD). Tellor is a
SINGLE global oracle contract per chain.
Functions
getDataBefore
Returns the latest data before timestamp for queryId.
Reading data with a dispute buffer (block.timestamp - buffer) leaves time for disputed values
to be removed before they are consumed.
function getDataBefore(bytes32 queryId, uint256 timestamp)
external
view
returns (bool found, bytes memory value, uint256 timestampRetrieved);Parameters
| Name | Type | Description |
|---|---|---|
| queryId | bytes32 | The Tellor query id (keccak256(queryData)). |
| timestamp | uint256 | The exclusive upper-bound timestamp to read before. |
Returns
| Name | Type | Description |
|---|---|---|
| found | bool | True if a value was retrieved. |
| value | bytes | The reported value bytes (SpotPrice is abi.encode(uint256) at 18 decimals). |
| timestampRetrieved | uint256 | The timestamp the returned value was reported. |