Skip to content

julianmrodri/rsk-oracle-POC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle POC - RIF Token Price

This Oracle retrieves the RIF token price in USD from an external data source and stores it on a public variable to be consumed by other contracts.

It implements the Provable API 0.5 and the Ownable contract by OpenZeppelin

Usage

RIF token is price stored in public variable rifTokenPriceInMillicents. 1 dollar = 10^5 millicents

To check when the value was last updated, read lastExecutionTimestamp public variable

An example client contract is included to show how the oracle can be consumed from within another contract. Please note this is just an example, it is not intended to be used in Production environments.

Disclaimer and limitations

  • RIFUSDOracle queries RIF token price from only one datasource (CoinGecko API).
  • Users should always check lastExecutionTimestamp from the oracle to know how old the price obtained is.
  • The oracle updates the RIF token price every minute, but if for any reason it stopped working then the returned price could be outdated.
  • Price obtained from the oracle is in millicents (1 dollar = 10^5 millicents).

Use at your own risk

Contract - TESTNET

https://explorer.testnet.rsk.co/address/0x1fe8b8e0c73fea8802b70d7f6d5c637d59a13ddd

  • Gas price: 0.06 gwei by default, can be changed by owner calling setGasPrice(uint price)
  • Gas limit: 140000 by default, can be changed by owner calling setCallbackGasLimit(uint gasLimit)
  • Time between executions: 60 seconds by default, can be changed by owner calling setSecondsBetweenExecutions(uint seconds)
  • In case of unreliable behaviour the Oracle can be terminated by owner calling kill(address payee)

Owner: 0x1beb4e01bc32279501d5eedf91ad5b2f7fe2f594

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published