How To Use Witnet Price Feeds
Witnet price feeds can be integrated into your own Celo Mainnet contracts in two different ways:- Integrate through proxy Recommended for testing and upgradability. This is the preferred way to consume the Witnet-powered price feeds. Through using the Price Feeds Router.
- Integrate directly Optimized for gas cost and decentralization
Reading multiple price pairs from the router
WitnetProxy- Alfajores: 0x1111AbA2164AcdC6D291b08DfB374280035E1111
- Mainnet: 0x1111AbA2164AcdC6D291b08DfB374280035E1111
Solidity example
The example below shows how to read the price of two different assets from the Witnet Price Router:Javascript example
You may also read the latest price of supported currency pairs from your Web3 application by interacting directly with the Price Router contract:Feeds supported
A complete list of publicly available Witnet data feeds on Celo can be found in the Witnet Data Feeds website: https://feeds.witnet.io/celo Request a new price feed on Celo or Create your own data feed.How to use WitnetRandomness
Witnet provides secure, unbiased, on-chain randomness on EVM-compatible chains (including Celo) via its WitnetRandomness contract.âď¸ How It Works
Crowdâwitnessed random seed generation A randomized subset of Witnet nodes each generate secret random bytes, commit and later reveal them. These are deterministically aggregated into a tamperâproof seedâunbiased and unpredictable as long as at least one witness is honest. The WitnetRandomness contract is already deployed on Celo and other supported chains. It exposes a simple interface via IWitnetRandomness, available in the witnetâsolidityâbridge npm package- Alfajores: 0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB
- Mainnet: 0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB