Conversation
|
Looks good 👍 Will leave it to @ahnaguib to give final approval. |
contracts/TellorProvider.sol
Outdated
| function pushTellor() external { | ||
| (bool retrieved, uint256 value, uint256 _time) = getTellorData(); | ||
|
|
||
| require(_time > now - medianOracle.reportExpirationTimeSec() && retrieved, "Tellor value too old"); |
There was a problem hiding this comment.
What's the reason for not relying on pushData() failing instead of checking here?
There was a problem hiding this comment.
The issue is that getData() relies on the time that the payload was added to the market-oracle contract, while here we check the time the data was added to the Tellor system. We could theoretically take an old Tellor value and push a report, which will be accepted on getData.
It's another layer of protection to ensure the data is fresh.
|
|
||
| function verifyTellorReports() external { | ||
| //most recent tellor report is in dispute, so let's purge it | ||
| if(tellor.retrieveData(TellorID, tellorReport.time0) == 0 || tellor.retrieveData(TellorID,tellorReport.time1) == 0){ |
There was a problem hiding this comment.
How about if one of them is valid, it pushes it after purging?
There was a problem hiding this comment.
We will add that to the job. After we purge a report, we'll check if we have a valid value and push it again
contracts/IMedianOracle.sol
Outdated
| function reportExpirationTimeSec() external returns(uint256); | ||
| function pushReport(uint256 payload) external; | ||
| function purgeReports() external; | ||
| } No newline at end of file |
There was a problem hiding this comment.
can you add new lines to all the files to keep the linters happy?
|
|
||
| function pushTellor() external { | ||
| (bool retrieved, uint256 value, uint256 _time) = getTellorData(); | ||
| //Saving _time in a storage value to quickly verify disputes later |
There was a problem hiding this comment.
Hey am I missing something or should the report only get pushed if retrieved is true?
There was a problem hiding this comment.
retrieved is true if the value count is greater than 0. TellorID 10 has months of data with a value count of over 4500, so retrieved will always be true when using the current Tellor contracts.
Hello!
I just set the truffle project and created the basic contracts for the conector.