Quick start
OpenOracle (OO) - Guide
getPrice - function
The getPrice function is designed to dynamically retrieve the latest price from a price oracle for a given feed ID, using the OpenOracle (OO) Address and Feed ID. Below is a detailed guide on its implementation and usage.
Usage
How to integrate OpenOracle (OO) into your contracts to get dynamic pricing in 1-4 easy steps.
1. import
interface OpenOracle {
function getPrice(uint256 feedID) external view returns (uint256);
}2. variable
OpenOracle public openoracle;3. constructor
openoracle = OpenOracle(OO_ADDRESS); // edit: address4. use (build in your function (payable))
uint256 price = openoracle.getPrice(FEED_ID); // edit: number
require(msg.value >= price, "Insufficient funds");Check out the OpenOracle (OO) for NFT, Token examples on GitHub for more information.
Note
This beta version is not recommended for integration into long-term functions. Additionally consider implementing functionality to update the OO_ADDRESS and FEED_ID as needed. (OpenOracle (OO) Address and Feed ID)