From a356ed538e9b1fd0c9d6541a3c1e63055d47a20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Fri, 10 Sep 2021 14:05:46 +0200 Subject: [PATCH 1/4] feat: add boba networks section --- docs/chains/boba/addresses.md | 33 +++++++++++++++++++++++ docs/chains/boba/price-feeds.md | 48 +++++++++++++++++++++++++++++++++ mkdocs.yml | 5 +++- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 docs/chains/boba/addresses.md create mode 100644 docs/chains/boba/price-feeds.md diff --git a/docs/chains/boba/addresses.md b/docs/chains/boba/addresses.md new file mode 100644 index 00000000..0a360f36 --- /dev/null +++ b/docs/chains/boba/addresses.md @@ -0,0 +1,33 @@ +# Witnet Addresses on BOBA networks + +Smart contracts deployed into Boba's Layer-2 OVM can send oracle queries (aka _data requests_) to the Witnet decentralized oracle using the [Witnet Solidity Bridge] library. + +The most convenient way to use the [Witnet Solidity Bridge] library is through the [Witnet Truffle Box], because it +allows writing Witnet data requests using Javascript, which is automatically compiled to Witnet bytecode and then +wrapped in a Solidity contract that you can easily import from your own contracts. + +The [Witnet Truffle Box] also abstracts away the complexity of having to instantiate or link the Witnet contracts +listed here. + +These addresses are provided for reference, just in case someone prefers not to use the [Witnet Truffle Box] and +rather talk to the Witnet Request Board and other contracts directly using the interfaces in the [Witnet Solidity Bridge]. + +## BOBA Mainnet + +Witnet is not live yet on BOBA mainnet, but will be deployed soon. Stay tuned! + +## BOBA Rinkeby + +### Witnet entrypoint addresses +* WitnetRequestBoard: [``]() +* WitnetParserLib: [``]() + +### Published Price Feed contracts +* OMG/BTC: [``]() +* OMG/ETH: [``]() +* OMG/USDT: [``]() +* BTC/USD: [``]() +* ETH/USD: [``]() + +[Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge +[Witnet Truffle Box]: /try/use-from-ethereum diff --git a/docs/chains/boba/price-feeds.md b/docs/chains/boba/price-feeds.md new file mode 100644 index 00000000..24e34329 --- /dev/null +++ b/docs/chains/boba/price-feeds.md @@ -0,0 +1,48 @@ +# Witnet Price Feeds on BOBA Networks + +Witnet Foundation operates a series of public price feeds in cooperation with BOBA Network both for showcasing the +capabilities of the Witnet oracle, and as a public service for the broader BOBA community. + +All Witnet price feeds comply with the [ERC-2362] interface: a standard interface for price feeds, cooperatively +envisioned by Witnet, Tellor, Band, Razor and other oracles. All price feeds are deployed based on the same template[Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeedBoba.sol). + +Therefore, using any of these already deployed price feeds is as simple as: + +```solidity +pragma solidity >=0.5.0 <0.9.0; + +/// @dev EIP-2362 Interface for pull oracles +/// https://github.com/adoracles/EIPs/blob/erc-2362/EIPS/eip-2362.md +interface IERC2362 { + /// @dev Exposed function pertaining to EIP standards + /// @param _id bytes32 ID of the query + /// @return int,uint,uint returns the value, timestamp, and status code of query + function valueFor(bytes32 _id) external view returns (int256, uint256, uint256); +} + +contract MyContract { + function readFromPriceFeed() external view returns (int256 _value) { + IERC2362 priceFeed = IERC2362(
); + bytes32 assetID = bytes32(hex""); + (_value,, ) = priceFeed.valueFor(assetID); + } +} +``` + +The available asset IDs for each of the public price feeds are also listed down below. A full list of asset IDs can +be found in [ADOIP-0010]. + +!!! tip "Floats and decimal digits" + As Solidity does not currently support `float` types, all prices are provided as `int256`, with a specific number + of decimal digits. For example, if the BTC/USD price is `31371.21456`, the BTC/USD contract below will give`31371214560` because it is using 6 decimal digits. + +| | Decimals | Asset ID | BOBA.Rinkeby | BOBA.Mainnet | +| ----------- | :------: | :------- | :----------- | :----------- | +| **OMG/BTC** | 9 | `c4ec7fbc6384f83dad668488519c7195acafd67645ebcc7f76a8d747feaca2fb` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-btc_9) | Stay tuned! +| **OMG/ETH** | 9 | `e2960cc030131ae6ce0d14aea9ecfa937461aa22d2d55a36b44b27737a11bd75` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-eth_9) | Stay tuned! +| **OMG/USDT** | 6 | `fb2c779532e89f660244ccdd71749e8d75b3e53a8fc0d5531ef814f8b8300eef` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-usdt_6) | Stay tuned! +| **BTC/USD** | 6 | `24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_btc-usd_6) | Stay tuned! +| **ETH/USD** | 6 | `3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_eth-usd_6) | Stay tuned! + +[ERC-2362]: https://github.com/adoracles/ado-contracts/blob/master/contracts/interfaces/IERC2362.sol +[ADOIP-0010]: https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md#registered-ids \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 1cf77d28..2ba70ab7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,7 +30,10 @@ nav: - 7. Deploy: tutorials/bitcoin-price-feed/migrations.md - Recap: tutorials/bitcoin-price-feed/recap.md - Other chains: - - Conflux Network: + - Boba Networks: + - Price Feeds: chains/boba/price-feeds.md + - Addresses: chains/boba/addresses.md + - Conflux Networks: - Price Feeds: chains/conflux/price-feeds.md - Addresses: chains/conflux/addresses.md - Witnet-Rust Docs: From cab1149e5d3bd85acc750d165c096ed2a661ccf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Fri, 10 Sep 2021 14:07:00 +0200 Subject: [PATCH 2/4] chore: unify address layout style --- docs/chains/conflux/addresses.md | 22 ++++---- docs/chains/conflux/price-feeds.md | 88 ++++++++---------------------- docs/ethereum/addresses.md | 75 +++++-------------------- docs/ethereum/price-feeds.md | 77 +++++++------------------- 4 files changed, 66 insertions(+), 196 deletions(-) diff --git a/docs/chains/conflux/addresses.md b/docs/chains/conflux/addresses.md index 6653383b..3b0acb52 100644 --- a/docs/chains/conflux/addresses.md +++ b/docs/chains/conflux/addresses.md @@ -1,17 +1,17 @@ -# Witnet Addresses on Conflux Network +# Witnet Addresses on Conflux networks Conflux smart contracts can send oracle queries (aka _data requests_) to the Witnet decentralized oracle using the -[witnet-ethereum-bridge] Solidity library. +[Witnet Solidity Bridge] library. -The most convenient way to use the [witnet-ethereum-bridge] library is through the [Witnet Truffle Box], because it -allows writing Witnet data requests using Javascript, which is automatically compiled to Witnet byte code and then +The most convenient way to use the [Witnet Solidity Bridge] library is through the [Witnet Truffle Box], because it +allows writing Witnet data requests using Javascript, which is automatically compiled to Witnet bytecode and then wrapped in a Solidity contract that you can easily import from your own contracts. The [Witnet Truffle Box] also abstracts away the complexity of having to instantiate or link the Witnet contracts -listed here. +listed here. These addresses are provided for reference, just in case someone prefers not to use the [Witnet Truffle Box] and -rather talk to the Witnet Request Board and other contracts directly using the interfaces in [witnet-ethereum-bridge]. +rather talk to the Witnet Request Board and other contracts directly using the interfaces in the [Witnet Solidity Bridge]. ## Conflux Mainnet - Tethys @@ -19,16 +19,14 @@ Witnet is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned ## Conflux Testnet -### Main contracts -* WitnetProxy: [`cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt`](https://testnet.confluxscan.io/address/cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt) -* WitnetRequestBoard: [`cfxtest:acemtza4zjn1fcutzwn6p8ekdbf2x8dczy4teesnh8`](https://testnet.confluxscan.io/address/cfxtest:acemtza4zjn1fcutzwn6p8ekdbf2x8dczy4teesnh8) -* WitnetDecoderLib: [`cfxtest:acav8atw8uttetu0ty1aemvy52rjp705wyddb2fyty`](https://testnet.confluxscan.io/address/cfxtest:acav8atw8uttetu0ty1aemvy52rjp705wyddb2fyty) +### Witnet entrypoint addresses +* WitnetRequestBoard: [`cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt`](https://testnet.confluxscan.io/address/cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt) * WitnetParserLib: [`cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7`](https://testnet.confluxscan.io/address/cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7) -### Public price feeds +### Published Price Feed contracts * CFX/USDT: [`cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8`](https://testnet.confluxscan.io/address/cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8) * BTC/USD: [`cfxtest:acg28k0yppzj5gc0dc1gazy6wt34m6ak5j5t12htkn`](https://testnet.confluxscan.io/address/cfxtest:acexkt9t0dm7tzhv9t1znbnc83ehtb703u9pyvd0cd) * ETH/USD: [`cfxtest:ach8fz1axbh6p000u6xmsxpcfcawumvuyau4ac8tu5`](https://testnet.confluxscan.io/address/cfxtest:achf22mnyxrkt4bd4xb9b1fufwdw3bhg2pe445me8s) -[witnet-ethereum-bridge]: https://github.com/witnet/witnet-ethereum-bridge +[Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge [Witnet Truffle Box]: /try/use-from-ethereum diff --git a/docs/chains/conflux/price-feeds.md b/docs/chains/conflux/price-feeds.md index 900190aa..b765e9fd 100644 --- a/docs/chains/conflux/price-feeds.md +++ b/docs/chains/conflux/price-feeds.md @@ -1,28 +1,31 @@ -# Witnet Price Feeds on Conflux Network +# Witnet Price Feeds on Conflux Networks Witnet Foundation operates a series of public price feeds in cooperation with Conflux Network both for showcasing the -capabilities of the Witnet oracle,and as a public service for the broader Conflux community. +capabilities of the Witnet oracle, and as a public service for the broader Conflux community. All Witnet price feeds comply with the [ERC-2362] interface: a standard interface for price feeds, cooperatively -envisioned by Witnet, Tellor, Band, Razor and other oracles. +envisioned by Witnet, Tellor, Band, Razor and other oracles. All price feeds are deployed based on the same template[Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeed.sol). -Therefore, using any of these price feeds is as simple as: +Therefore, using any of these already deployed price feeds is as simple as: ```solidity pragma solidity >=0.5.0 <0.9.0; -import "ado-contracts/contracts/interfaces/IERC2362.sol"; +/// @dev EIP-2362 Interface for pull oracles +/// https://github.com/adoracles/EIPs/blob/erc-2362/EIPS/eip-2362.md +interface IERC2362 { + /// @dev Exposed function pertaining to EIP standards + /// @param _id bytes32 ID of the query + /// @return int,uint,uint returns the value, timestamp, and status code of query + function valueFor(bytes32 _id) external view returns (int256, uint256, uint256); +} contract MyContract { - - function readFromPriceFeed() external view returns(int256) { - IERC2362 priceFeed = IERC2362("
"); - bytes32 assetID = bytes32(hex("")); - int256 value = priceFeed.valueFor(assetID); - - return value; + function readFromPriceFeed() external view returns (int256 _value) { + IERC2362 priceFeed = IERC2362(
); + bytes32 assetID = bytes32(hex""); + (_value,, ) = priceFeed.valueFor(assetID); } - } ``` @@ -31,60 +34,15 @@ be found in [ADOIP-0010]. !!! tip "Floats and decimal digits" As Solidity does not currently support `float` types, all prices are provided as `int256`, with a specific number - of decimal digits. For example, if the BTC/USD price is `31371.21`, the BTC/USD contract below will give`31371210` - because it is using 3 decimal digits. - -## CFX/USDT - -* Source code: - * [Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeed.sol) - * [Witnet data request](https://github.com/witnet/witnet-price-feed-examples/blob/master/requests/CfxUsdtPrice.js) -* Asset ID: `65784185a07d3add5e7a99a6ddd4477e3c8caad717bac3ba3c3361d99a978c29` -* Decimal digits: 6 - -##### Conflux Mainnet - Tethys - -This price feed is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned! - -##### Conflux Testnet - -* Data explorer: [feeds.witnet.io/feeds/conflux-testnet_cfx-usdt_6](https://feeds.witnet.io/feeds/conflux-testnet_cfx-usdt_6) -* Contract address: [`cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8`](https://testnet.confluxscan.io/address/cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8) - -## ETH/USD - -* Source code: - * [Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeed.sol) - * [Witnet data request](https://github.com/witnet/witnet-price-feed-examples/blob/master/requests/EthUsdPrice.js) -* Asset ID: `dfaa6f747f0f012e8f2069d6ecacff25f5cdf0258702051747439949737fc0b5` -* Decimal digits: 3 - -##### Conflux Mainnet - Tethys - -This price feed is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned! - -##### Conflux Testnet - -* Data explorer: [feeds.witnet.io/feeds/conflux-testnet_eth-usd_3](https://feeds.witnet.io/feeds/conflux-testnet_eth-usd_3) -* Contract address: [`cfxtest:ach8fz1axbh6p000u6xmsxpcfcawumvuyau4ac8tu5`](https://testnet.confluxscan.io/address/cfxtest:ach8fz1axbh6p000u6xmsxpcfcawumvuyau4ac8tu5) - - -## BTC/USD - -* Source code: - * [Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeed.sol) - * [Witnet data request](https://github.com/witnet/witnet-price-feed-examples/blob/master/requests/BtcUsdPrice.js) -* Asset ID: `637b7efb6b620736c247aaa282f3898914c0bef6c12faff0d3fe9d4bea783020` -* Decimal digits: 3 - -##### Conflux Mainnet - Tethys - -This price feed is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned! + of decimal digits. For example, if the BTC/USD price is `31371.21456`, the BTC/USD contract below will give`31371214560` because it is using 6 decimal digits. -##### Conflux Testnet +## Data Explorer links -* Data explorer: [feeds.witnet.io/feeds/conflux-testnet_btc-usd_3](https://feeds.witnet.io/feeds/conflux-testnet_btc-usd_3) -* Contract address: [`cfxtest:acg28k0yppzj5gc0dc1gazy6wt34m6ak5j5t12htkn`](https://testnet.confluxscan.io/address/cfxtest:acg28k0yppzj5gc0dc1gazy6wt34m6ak5j5t12htkn) +| | Decimals | Asset ID | Conflux.Testnet | Conflux.Mainnet | +| ------------ | :------: | :------- | :-------------- | :-------------- | +| **CFX/USDT** | 6 | `65784185a07d3add5e7a99a6ddd4477e3c8caad717bac3ba3c3361d99a978c29` | [`0x89e0b86eEC97Bc24F44e3eB206b22b235Db58C1E`](https://feeds.witnet.io/feeds/conflux-testnet_cfx-usdt_6) | Stay tuned! +| **BTC/USD** | 6 | `637b7efb6b620736c247aaa282f3898914c0bef6c12faff0d3fe9d4bea783020` | [`0x8D8f26d4632A8d985618Ae60569C93f3a57009Da`](https://feeds.witnet.io/feeds/conflux-testnet_btc-usd_6) | Stay tuned! +| **ETH/USD** | 6 | `dfaa6f747f0f012e8f2069d6ecacff25f5cdf0258702051747439949737fc0b5` | [`0x8fe2d6e0984fc65Ad68726A74d822881282A30A0`](https://feeds.witnet.io/feeds/conflux-testnet_eth-usd_6) | Stay tuned! [ERC-2362]: https://github.com/adoracles/ado-contracts/blob/master/contracts/interfaces/IERC2362.sol [ADOIP-0010]: https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md#registered-ids diff --git a/docs/ethereum/addresses.md b/docs/ethereum/addresses.md index c5c7c6d2..d90a1c49 100644 --- a/docs/ethereum/addresses.md +++ b/docs/ethereum/addresses.md @@ -1,74 +1,25 @@ -# Witnet Addresses on Ethereum +# Witnet Addresses on Ethereum networks -Ethereum smart contracts can send oracle queries (aka _data requests_) to the Witnet decentralized oracle using the -[witnet-ethereum-bridge] Solidity library. +Ethereum smart contracts can send oracle queries (aka _data requests_) to the Witnet decentralized oracle using the [Witnet Solidity Bridge] library. -The most convenient way to use the [witnet-ethereum-bridge] library is through the [Witnet Truffle Box], because it -allows writing Witnet data requests using Javascript, which is automatically compiled to Witnet byte code and then +The most convenient way to use the [Witnet Solidity Bridge] library is through the [Witnet Truffle Box], because it +allows writing Witnet data requests using Javascript, which is automatically compiled to Witnet bytecode and then wrapped in a Solidity contract that you can easily import from your own contracts. The [Witnet Truffle Box] also abstracts away the complexity of having to instantiate or link the Witnet contracts listed here. These addresses are provided for reference, just in case someone prefers not to use the [Witnet Truffle Box] and -rather talk to the Witnet Request Board and other contracts directly using the interfaces in [witnet-ethereum-bridge]. +rather talk to the Witnet Request Board and other contracts directly using the interfaces in the [Witnet Solidity Bridge]. -## Mainnet +## Witnet-provided addresses (verified) -### Main contracts -* CBOR: [`0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079`](https://etherscan.io/address/0x1D9c4a8f8B7b5F9B8e2641D81927f8F8Cc7fF079) -* Witnet: [`0x916aC9636F4Ea9f54f07c9De8fDCd828e1b32c9B`](https://etherscan.io/address/0x916aC9636F4Ea9f54f07c9De8fDCd828e1b32c9B) -* WitnetRequestBoard: [`0xd653fbd7c736838289262F0F41A458f35393C88a`](https://etherscan.io/address/0xd653fbd7c736838289262F0F41A458f35393C88a) -* WitnetRequestBoardProxy: [`0x400DbF3645b345823124aaB22D04013A46D9ceD5`](https://etherscan.io/address/0x400DbF3645b345823124aaB22D04013A46D9ceD5) +| Contract | Mainnet | Goerli | Rinkeby | +| :------- | :------ | :----- | :------ | +| **WitnetRequestBoard** | [`0x400DbF3645b345823124aaB22D04013A46D9ceD5`](https://etherscan.io/address/0x400DbF3645b345823124aaB22D04013A46D9ceD5) | [`0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8`](https://goerli.etherscan.io/address/0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8#code) | [`0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4`](https://rinkeby.etherscan.io/address/0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4#code) +| **WitnetParserLib** | [`0x916aC9636F4Ea9f54f07c9De8fDCd828e1b32c9B`](https://etherscan.io/address/0x916aC9636F4Ea9f54f07c9De8fDCd828e1b32c9B) | [`0x46cF0c52f7B2e76F1E95fe163B98F92413f1d5A4`](https://goerli.etherscan.io/address/0x46cF0c52f7B2e76F1E95fe163B98F92413f1d5A4#code) | [`0x14b5cAC222d55Cb11CC9fE5Fbf6793177B3048F6`](https://rinkeby.etherscan.io/address/0x14b5cAC222d55Cb11CC9fE5Fbf6793177B3048F6#code) +| **BtcUsdPriceFeed** | [`0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9`](https://etherscan.io/address/0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9) | [`0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c`](https://goerli.etherscan.io/address/0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c#code) | [`0xa7C971149AdfdFB237A0F78D7d317B916FFCE093`](https://rinkeby.etherscan.io/address/0xa7C971149AdfdFB237A0F78D7d317B916FFCE093#code) +| **EthUsdPriceFeed** | [`0x1ebD93231a7fE551E1d6405404Df34909eff4c2C`](https://etherscan.io/address/0x1ebD93231a7fE551E1d6405404Df34909eff4c2C) | [`0x031699240f710B47e92Df7766C06ee6C22A75df1`](https://goerli.etherscan.io/address/0x031699240f710B47e92Df7766C06ee6C22A75df1#code) | [`0x1320C130Fc5361ced969Ca737d692a30e1142a13`](https://rinkeby.etherscan.io/address/0x1320C130Fc5361ced969Ca737d692a30e1142a13#code) -### Public price feeds -* EthUsdPriceFeed: [`0x1ebD93231a7fE551E1d6405404Df34909eff4c2C`](https://etherscan.io/address/0x1ebD93231a7fE551E1d6405404Df34909eff4c2C) -* BtcUsdPriceFeed: [`0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9`](https://etherscan.io/address/0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9) - -!!! warning - These addresses may change soon as the latest version of the Witnet bridge is deployed on Ethereum mainnet in the - coming days. - -## Rinkeby - -### Main contracts -* WitnetProxy: [`0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4`](https://rinkeby.etherscan.io/address/0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4#code) -* WitnetRequestBoard: [`0xA15D02007f979108653B43089ee25cF653CF8B22`](https://rinkeby.etherscan.io/address/0xA15D02007f979108653B43089ee25cF653CF8B22#code) -* WitnetDecoderLib: [`0x87312848B4d67A9545e563c75fb5C54CA364Fcef`](https://rinkeby.etherscan.io/address/0x87312848B4d67A9545e563c75fb5C54CA364Fcef#code) -* WitnetParserLib: [`0x14b5cAC222d55Cb11CC9fE5Fbf6793177B3048F6`](https://rinkeby.etherscan.io/address/0x14b5cAC222d55Cb11CC9fE5Fbf6793177B3048F6#code) - -### Public price feeds -* EthUsdPriceFeed: [`0x1320C130Fc5361ced969Ca737d692a30e1142a13`](https://rinkeby.etherscan.io/address/0x1320C130Fc5361ced969Ca737d692a30e1142a13#code) -* BtcUsdPriceFeed: [`0xa7C971149AdfdFB237A0F78D7d317B916FFCE093`](https://rinkeby.etherscan.io/address/0xa7C971149AdfdFB237A0F78D7d317B916FFCE093#code) - -## Goerli - -### Main contracts -* WitnetProxy: [`0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8`](https://goerli.etherscan.io/address/0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8#code) -* WitnetRequestBoard: [`0x035B8CE1e6ec21A8BfEfa82635A01BF2A172E3E0`](https://goerli.etherscan.io/address/0x035B8CE1e6ec21A8BfEfa82635A01BF2A172E3E0#code) -* WitnetDecoderLib: [`0x8b90dDB14ce8604df484e9a37B996719881439BC`](https://goerli.etherscan.io/address/0x8b90dDB14ce8604df484e9a37B996719881439BC#code) -* WitnetParserLib: [`0x46cF0c52f7B2e76F1E95fe163B98F92413f1d5A4`](https://goerli.etherscan.io/address/0x46cF0c52f7B2e76F1E95fe163B98F92413f1d5A4#code) - -### Public price feeds -* EthUsdPriceFeed: [`0x031699240f710B47e92Df7766C06ee6C22A75df1`](https://goerli.etherscan.io/address/0x031699240f710B47e92Df7766C06ee6C22A75df1#code) -* BtcUsdPriceFeed: [`0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c`](https://goerli.etherscan.io/address/0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c#code) - -## Kovan - -### Main contracts -* CBOR: [`0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f`](https://kovan.etherscan.io/address/0xB4B2E2e00e9d6E5490d55623E4F403EC84c6D33f#contracts) -* Witnet: [`0xD9465D38f50f364b3263Cb219e58d4dB2D584530`](https://kovan.etherscan.io/address/0xD9465D38f50f364b3263Cb219e58d4dB2D584530#contracts) -* WitnetRequestBoard: [`0x7D8A488BACB56dA2De17628e26a21fFd97792b81`](https://kovan.etherscan.io/address/0x7D8A488BACB56dA2De17628e26a21fFd97792b81#contracts) -* WitnetRequestBoardProxy: [`0xD9a6d1Ea0d0f4795985725C7Bd40C31a667c033d`](https://kovan.etherscan.io/address/0xD9a6d1Ea0d0f4795985725C7Bd40C31a667c033d#contracts) - -### Public price feeds -* EthUsdPriceFeed: [`0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8`](https://kovan.etherscan.io/address/0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8#contracts) -* BtcUsdPriceFeed: [`0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E`](https://kovan.etherscan.io/address/0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E#contracts) - -!!! warning - The contracts currently deployed on Kovan belong to an older version of the Witnet bridge and we cannot guarantee - their liveness or update period. They will be upgraded soon, but in the meantime, please use some other Ethereum - testnet (`rinkeby` or `goerli`). - -[witnet-ethereum-bridge]: https://github.com/witnet/witnet-ethereum-bridge +[Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge [Witnet Truffle Box]: /try/use-from-ethereum diff --git a/docs/ethereum/price-feeds.md b/docs/ethereum/price-feeds.md index 0af5fc54..9916c15e 100644 --- a/docs/ethereum/price-feeds.md +++ b/docs/ethereum/price-feeds.md @@ -4,25 +4,28 @@ Witnet Foundation operates a series of public price feeds both for showcasing th and as a public service for the broader Ethereum community. All Witnet price feeds comply with the [ERC-2362] interface: a standard interface for price feeds, cooperatively -envisioned by Witnet, Tellor, Band, Razor and other oracles. +envisioned by Witnet, Tellor, Band, Razor and other oracles. All price feeds are deployed based on the same template[Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/ERC2362PriceFeed.sol). -Therefore, using any of these price feeds is as simple as: +Therefore, using any of these already deployed price feeds is as simple as: ```solidity pragma solidity >=0.5.0 <0.9.0; -import "ado-contracts/contracts/interfaces/IERC2362.sol"; +/// @dev EIP-2362 Interface for pull oracles +/// https://github.com/adoracles/EIPs/blob/erc-2362/EIPS/eip-2362.md +interface IERC2362 { + /// @dev Exposed function pertaining to EIP standards + /// @param _id bytes32 ID of the query + /// @return int,uint,uint returns the value, timestamp, and status code of query + function valueFor(bytes32 _id) external view returns (int256, uint256, uint256); +} contract MyContract { - - function readFromPriceFeed() external view returns(int256) { - IERC2362 priceFeed = IERC2362("
"); - bytes32 assetID = bytes32(hex("")); - int256 value = priceFeed.valueFor(assetID); - - return value; + function readFromPriceFeed() external view returns (int256 _value) { + IERC2362 priceFeed = IERC2362(
); + bytes32 assetID = bytes32(hex""); + (_value,, ) = priceFeed.valueFor(assetID); } - } ``` @@ -31,54 +34,14 @@ be found in [ADOIP-0010]. !!! tip "Floats and decimal digits" As Solidity does not currently support `float` types, all prices are provided as `int256`, with a specific number - of decimal digits. For example, if the BTC/USD price is `31371.21`, the BTC/USD contract below will give`31371210` - because it is using 3 decimal digits. - -## ETH/USD - -* Source code: - * [Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/EthUsdPriceFeed.sol) - * [Witnet data request](https://github.com/witnet/witnet-price-feed-examples/blob/master/requests/EthPrice.js) -* Asset ID: `dfaa6f747f0f012e8f2069d6ecacff25f5cdf0258702051747439949737fc0b5` -* Decimal digits: 3 - -##### Mainnet -* Data explorer: [feeds.witnet.io/feeds/ethereum-mainnet_eth-usd_3](https://feeds.witnet.io/feeds/ethereum-mainnet_eth-usd_3) -* Contract address: [0x1ebD93231a7fE551E1d6405404Df34909eff4c2C](https://etherscan.io/address/0x1ebD93231a7fE551E1d6405404Df34909eff4c2C) - -##### Rinkeby -* Data explorer: [feeds.witnet.io/feeds/ethereum-rinkeby_eth-usd_3](https://feeds.witnet.io/feeds/ethereum-rinkeby_eth-usd_3) -* Contract address: [0x1320C130Fc5361ced969Ca737d692a30e1142a13](https://rinkeby.etherscan.io/address/0x1320C130Fc5361ced969Ca737d692a30e1142a13) - -##### Goerli -* Data explorer: [feeds.witnet.io/feeds/ethereum-goerli_eth-usd_3](https://feeds.witnet.io/feeds/ethereum-goerli_eth-usd_3) -* Contract address: [0x031699240f710B47e92Df7766C06ee6C22A75df1](https://goerli.etherscan.io/address/0x031699240f710B47e92Df7766C06ee6C22A75df1) - -##### Kovan -* Contract address: [0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8](https://kovan.etherscan.io/address/0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8) - -## BTC/USD - -* Source code: - * [Solidity contract](https://github.com/witnet/witnet-price-feed-examples/blob/master/contracts/BtcUsdPriceFeed.sol) - * [Witnet data request](https://github.com/witnet/witnet-price-feed-examples/blob/master/requests/BitcoinPrice.js) -* Asset ID: `637b7efb6b620736c247aaa282f3898914c0bef6c12faff0d3fe9d4bea783020` -* Decimal digits: 3 - -##### Mainnet -* Data explorer: [feeds.witnet.io/feeds/ethereum-mainnet_btc-usd_3](https://feeds.witnet.io/feeds/ethereum-mainnet_btc-usd_3) -* Contract address: [0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9](https://etherscan.io/address/0xF2712e7114A237625EFC8bBA6a6ed1Bb8b6029c9) - -##### Rinkeby -* Data explorer: [feeds.witnet.io/feeds/ethereum-rinkeby_btc-usd_3](https://feeds.witnet.io/feeds/ethereum-rinkeby_btc-usd_3) -* Contract address: [0xa7C971149AdfdFB237A0F78D7d317B916FFCE093](https://rinkeby.etherscan.io/address/0xa7C971149AdfdFB237A0F78D7d317B916FFCE093) + of decimal digits. For example, if the BTC/USD price is `31371.21456`, the BTC/USD contract below will give`31371214560` because it is using 6 decimal digits. -##### Goerli -* Data explorer: [feeds.witnet.io/feeds/ethereum-goerli_btc-usd_3](https://feeds.witnet.io/feeds/ethereum-goerli_btc-usd_3) -* Contract address: [0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c](https://goerli.etherscan.io/address/0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c) +## Data Explorer links -##### Kovan -* Contract address: [0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E](https://kovan.etherscan.io/address/0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E) +| | Decimals | Asset ID | Mainnet | Goerli | Rinkeby +| ------------ | :------: | :------- | :------ | :------ | :------ +| **BTC/USD** | 6 | `24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946` | [Stay tuned!](https://feeds.witnet.io/feeds/ethereum-mainnet_btc-usd_6) | [`0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c`](https://feeds.witnet.io/feeds/ethereum-goerli_btc-usd_6) | [`0xa7C971149AdfdFB237A0F78D7d317B916FFCE093`](https://feeds.witnet.io/feeds/ethereum-rinkeby_btc-usd_6) +| **ETH/USD** | 6 | `3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8` | [Stay tuned!](https://feeds.witnet.io/feeds/ethereum-mainnet_eth-usd_6) | [`0x031699240f710B47e92Df7766C06ee6C22A75df1`](https://feeds.witnet.io/feeds/ethereum-goerli_eth-usd_6) | [`0x1320C130Fc5361ced969Ca737d692a30e1142a13`](https://feeds.witnet.io/feeds/ethereum-rinkeby_eth-usd_6) [ERC-2362]: https://github.com/adoracles/ado-contracts/blob/master/contracts/interfaces/IERC2362.sol [ADOIP-0010]: https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md#registered-ids From d0be66e67743c7a7f0b4cfdda5801289909ce1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Fri, 10 Sep 2021 14:07:51 +0200 Subject: [PATCH 3/4] fix: make truffle tutorial suitable to all networks --- .../tutorials/bitcoin-price-feed/compiling.md | 12 +-- docs/tutorials/bitcoin-price-feed/contract.md | 87 ++++++++++--------- .../bitcoin-price-feed/migrations.md | 7 +- 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/docs/tutorials/bitcoin-price-feed/compiling.md b/docs/tutorials/bitcoin-price-feed/compiling.md index 413c4984..e9b4a2c8 100644 --- a/docs/tutorials/bitcoin-price-feed/compiling.md +++ b/docs/tutorials/bitcoin-price-feed/compiling.md @@ -1,4 +1,4 @@ -# 5. Compile and try the request +# 5. Compile and try the request !!! note "" *This article is part of the [beginner tutorial on creating a totally @@ -34,13 +34,15 @@ new file called `BitcoinPrice.sol`. It will contain something like this: ```solidity pragma solidity >=0.7.0 <0.9.0; -import "witnet-ethereum-bridge/contracts/requests/WitnetRequest.sol"; +import "witnet-solidity-bridge/contracts/requests/WitnetRequestInitializableBase.sol"; // The bytecode of the BitcoinPrice request that will be sent to Witnet -contract BitcoinPriceRequest is WitnetRequest { - constructor () WitnetRequest(hex"0abf0108f3b5988906123b122468747470733a2f2f7777772e6269747374616d702e6e65742f6170692f7469636b65722f1a13841877821864646c6173748218571903e8185b125c123168747470733a2f2f6170692e636f696e6465736b2e636f6d2f76312f6270692f63757272656e7470726963652e6a736f6e1a2786187782186663627069821866635553448218646a726174655f666c6f61748218571903e8185b1a0d0a0908051205fa3fc000001003220d0a0908051205fa3fc000001003100a186420012846308094ebdc03") { } +contract BitcoinPriceRequest is WitnetRequestInitializableBase { + constructor () {} + function initialize() public { + WitnetRequestInitializableBase.initialize(hex"0abf0108f3b5988906123b122468747470733a2f2f7777772e6269747374616d702e6e65742f6170692f7469636b65722f1a13841877821864646c6173748218571903e8185b125c123168747470733a2f2f6170692e636f696e6465736b2e636f6d2f76312f6270692f63757272656e7470726963652e6a736f6e1a2786187782186663627069821866635553448218646a726174655f666c6f61748218571903e8185b1a0d0a0908051205fa3fc000001003220d0a0908051205fa3fc000001003100a186420012846308094ebdc03"); + } } - ``` As you can see, the contract contains the byte code for the request you diff --git a/docs/tutorials/bitcoin-price-feed/contract.md b/docs/tutorials/bitcoin-price-feed/contract.md index 0833a31f..ec6e34a1 100644 --- a/docs/tutorials/bitcoin-price-feed/contract.md +++ b/docs/tutorials/bitcoin-price-feed/contract.md @@ -36,32 +36,39 @@ import "./requests/BitcoinPrice.sol"; // Your contract needs to inherit from UsingWitnet contract PriceFeed is UsingWitnet { - // The public Bitcoin price point + /// The public Bitcoin price point uint64 public lastPrice; - // Stores the ID of the last Witnet request + /// Stores the ID of the last Witnet request uint256 public lastRequestId; - // Stores the timestamp of the last time the public price point was updated + /// Stores the timestamp of the last time the public price point was updated uint256 public timestamp; - // Tells if an update has been requested but not yet completed + /// Tells if an update has been requested but not yet completed bool public pending; - // The Witnet request object, is set in the constructor - Request public request; + /// The Witnet request object, is set in the constructor, and initialized after deployment + BitcoinPriceRequest public request; - // Emits when the price is updated + /// Emits when the price is updated event PriceUpdated(uint64); - // Emits when found an error decoding request result + /// Emits when found an error decoding request result event ResultError(string); - // This constructor does a nifty trick to tell the `UsingWitnet` library where - // to find the Witnet contracts on whatever Ethereum network you use. + /// This constructor does a nifty trick to tell the `UsingWitnet` library where + /// to find the Witnet contracts on whatever network you use. constructor (WitnetRequestBoard _wrb) UsingWitnet(_wrb) { // Instantiate the Witnet request request = new BitcoinPriceRequest(); + // Note: the request cannot be initialized here, as some EVM/OVM implementations + // may struggle with constructors containining arbitrary byte arrays or strings. + } + + // This method initializes the actual Witnet request bytecode + function initialize() external { + request.initialize(); } } ``` @@ -82,10 +89,8 @@ The above will: ## Write the `requestUpdate` method that launches the Witnet request ```solidity -/** - * @notice Sends `request` to the WitnetRequestBoard. - * @dev This method will only succeed if `pending` is 0. - **/ +/// @notice Sends `request` to the WitnetRequestBoard. +/// @dev This method will only succeed if `pending` is 0. function requestUpdate() public payable { require(!pending, "Complete pending request before requesting a new one"); @@ -101,12 +106,10 @@ function requestUpdate() public payable { ## Write the `completeUpdate` method that reads the result of the Witnet request ```solidity -/** - * @notice Reads the result, if ready, from the WitnetRequestBoard. - * @dev The `witnetRequestAccepted` modifier comes with `UsingWitnet` and allows to - * protect your methods from being called before the request has been successfully - * relayed into Witnet. - **/ +/// @notice Reads the result, if ready, from the WitnetRequestBoard. +/// @dev The `witnetRequestAccepted` modifier comes with `UsingWitnet` and allows to +/// @dev protect your methods from being called before the request has been successfully +/// @dev relayed into Witnet. function completeUpdate() public witnetRequestResolved(lastRequestId) { require(pending, "There is no pending update."); @@ -148,7 +151,6 @@ This is what the complete contract looks like: pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; - // Import the UsingWitnet library that enables interacting with Witnet import "witnet-ethereum-bridge/contracts/UsingWitnet.sol"; // Import the BitcoinPrice request that you created before @@ -157,38 +159,43 @@ import "./requests/BitcoinPrice.sol"; // Your contract needs to inherit from UsingWitnet contract PriceFeed is UsingWitnet { - // The public Bitcoin price point + /// The public Bitcoin price point uint64 public lastPrice; - // Stores the ID of the last Witnet request + /// Stores the ID of the last Witnet request uint256 public lastRequestId; - // Stores the timestamp of the last time the public price point was updated + /// Stores the timestamp of the last time the public price point was updated uint256 public timestamp; - // Tells if an update has been requested but not yet completed + /// Tells if an update has been requested but not yet completed bool public pending; - // The Witnet request object, is set in the constructor - Request public request; + /// The Witnet request object, is set in the constructor, and initialized after deployment + BitcoinPriceRequest public request; - // Emits when the price is updated + /// Emits when the price is updated event PriceUpdated(uint64); - // Emits when found an error decoding request result + /// Emits when found an error decoding request result event ResultError(string); - // This constructor does a nifty trick to tell the `UsingWitnet` library where - // to find the Witnet contracts on whatever Ethereum network you use. + /// This constructor does a nifty trick to tell the `UsingWitnet` library where + /// to find the Witnet contracts on whatever network you use. constructor (WitnetRequestBoard _wrb) UsingWitnet(_wrb) { // Instantiate the Witnet request request = new BitcoinPriceRequest(); + // Note: the request cannot be initialized here, as some EVM/OVM implementations + // may struggle with constructors containining arbitrary byte arrays or strings. + } + + /// This method initializes the actual Witnet request bytecode + function initialize() external { + request.initialize(); } - /** - * @notice Sends `request` to the WitnetRequestBoard. - * @dev This method will only succeed if `pending` is 0. - **/ + /// @notice Sends `request` to the WitnetRequestBoard. + /// @dev This method will only succeed if `pending` is 0. function requestUpdate() public payable { require(!pending, "Complete pending request before requesting a new one"); @@ -200,12 +207,10 @@ contract PriceFeed is UsingWitnet { pending = true; } - /** - * @notice Reads the result, if ready, from the WitnetRequestBoard. - * @dev The `witnetRequestAccepted` modifier comes with `UsingWitnet` and allows to - * protect your methods from being called before the request has been successfully - * relayed into Witnet. - **/ + /// @notice Reads the result, if ready, from the WitnetRequestBoard. + /// @dev The `witnetRequestAccepted` modifier comes with `UsingWitnet` and allows to + /// @dev protect your methods from being called before the request has been successfully + /// @dev relayed into Witnet. function completeUpdate() public witnetRequestResolved(lastRequestId) { require(pending, "There is no pending update."); diff --git a/docs/tutorials/bitcoin-price-feed/migrations.md b/docs/tutorials/bitcoin-price-feed/migrations.md index 6b54d751..5742f1e5 100644 --- a/docs/tutorials/bitcoin-price-feed/migrations.md +++ b/docs/tutorials/bitcoin-price-feed/migrations.md @@ -48,6 +48,8 @@ const PriceFeed = artifacts.require("PriceFeed") module.exports = async function (deployer) { await deployer.link(Witnet, [PriceFeed]) await deployer.deploy(PriceFeed, WitnetProxy.address) + const priceFeed = await PriceFeed.deployed() + await priceFeed.initialize() } ``` @@ -101,8 +103,7 @@ can deploy them into a public network using the `--network` flag: - `truffle migrate --network=ethereum.goerli` deploys on the Ethereum Görli testnet. -You can find a complete list of supported networks in the `addresses` object -in the `migrations/2_user_migrations.js` file, and also [here][addresses]. +You can find a complete list of supported networks in [here][addresses]. ## Interact with your contract @@ -119,4 +120,4 @@ your contracts][interacting]. [Telegram]: https://t.me/witnetio [intro]: /tutorials/bitcoin-price-feed/introduction [interacting]: https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts -[addresses]: https://github.com/witnet/witnet-ethereum-bridge/blob/master/migrations/witnet.addresses.json \ No newline at end of file +[addresses]: https://github.com/witnet/witnet-solidity-bridge/blob/master/migrations/witnet.addresses.json \ No newline at end of file From 92681f5857d24cb1b21321f8c59a559ede59f8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Mon, 13 Sep 2021 18:23:24 +0200 Subject: [PATCH 4/4] fix: last PR arrangements --- docs/chains/boba/addresses.md | 25 +++++++++---------------- docs/chains/boba/price-feeds.md | 10 ++++------ docs/chains/conflux/addresses.md | 23 +++++++++-------------- docs/chains/conflux/price-feeds.md | 4 ++-- docs/ethereum/price-feeds.md | 6 +++--- mkdocs.yml | 4 ++-- 6 files changed, 29 insertions(+), 43 deletions(-) diff --git a/docs/chains/boba/addresses.md b/docs/chains/boba/addresses.md index 0a360f36..7c9f3d8c 100644 --- a/docs/chains/boba/addresses.md +++ b/docs/chains/boba/addresses.md @@ -1,4 +1,4 @@ -# Witnet Addresses on BOBA networks +# Witnet Addresses on BOBA Layer 2 networks Smart contracts deployed into Boba's Layer-2 OVM can send oracle queries (aka _data requests_) to the Witnet decentralized oracle using the [Witnet Solidity Bridge] library. @@ -12,22 +12,15 @@ listed here. These addresses are provided for reference, just in case someone prefers not to use the [Witnet Truffle Box] and rather talk to the Witnet Request Board and other contracts directly using the interfaces in the [Witnet Solidity Bridge]. -## BOBA Mainnet +## Witnet-provided addresses (verified) -Witnet is not live yet on BOBA mainnet, but will be deployed soon. Stay tuned! - -## BOBA Rinkeby - -### Witnet entrypoint addresses -* WitnetRequestBoard: [``]() -* WitnetParserLib: [``]() - -### Published Price Feed contracts -* OMG/BTC: [``]() -* OMG/ETH: [``]() -* OMG/USDT: [``]() -* BTC/USD: [``]() -* ETH/USD: [``]() +| Contract | BOBA.Rinkeby | BOBA.Mainnet | +| :------- | :----------- | :----------- | +| **WitnetRequestBoard** | [`0xA2F4f5290F9cfD3a17Cfa82f2a2fD3E5c05d1442`](https://blockexplorer.rinkeby.boba.network/address/0xA2F4f5290F9cfD3a17Cfa82f2a2fD3E5c05d1442/contracts) | Stay tuned! +| **WitnetParserLib** | [`0xdF4Df677F645Fe603a883Ad3f2Db03EDFDd75F5C`](https://blockexplorer.rinkeby.boba.network/address/0xdF4Df677F645Fe603a883Ad3f2Db03EDFDd75F5C/contracts) | Stay tuned! +| **OmgBtcPriceFeed** | [`0x78C2dEb1A416508fB4B20A000cfD9d9673371e00`](https://blockexplorer.rinkeby.boba.network/address/0x78C2dEb1A416508fB4B20A000cfD9d9673371e00/contracts) | Stay tuned! +| **OmgEthPriceFeed** | [`0x6be8bb17C07453d217cd1BADBa3E55A627DcdD2A`](https://blockexplorer.rinkeby.boba.network/address/0x6be8bb17C07453d217cd1BADBa3E55A627DcdD2A/contracts) | Stay tuned! +| **OmgUsdtPriceFeed** | [`0x758C5adBFC25E260C07535933874e98583A14d41`](https://blockexplorer.rinkeby.boba.network/address/0x758C5adBFC25E260C07535933874e98583A14d41/contracts) | Stay tuned! [Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge [Witnet Truffle Box]: /try/use-from-ethereum diff --git a/docs/chains/boba/price-feeds.md b/docs/chains/boba/price-feeds.md index 24e34329..2ca027b1 100644 --- a/docs/chains/boba/price-feeds.md +++ b/docs/chains/boba/price-feeds.md @@ -1,4 +1,4 @@ -# Witnet Price Feeds on BOBA Networks +# Witnet Price Feeds on BOBA Layer 2 networks Witnet Foundation operates a series of public price feeds in cooperation with BOBA Network both for showcasing the capabilities of the Witnet oracle, and as a public service for the broader BOBA community. @@ -38,11 +38,9 @@ be found in [ADOIP-0010]. | | Decimals | Asset ID | BOBA.Rinkeby | BOBA.Mainnet | | ----------- | :------: | :------- | :----------- | :----------- | -| **OMG/BTC** | 9 | `c4ec7fbc6384f83dad668488519c7195acafd67645ebcc7f76a8d747feaca2fb` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-btc_9) | Stay tuned! -| **OMG/ETH** | 9 | `e2960cc030131ae6ce0d14aea9ecfa937461aa22d2d55a36b44b27737a11bd75` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-eth_9) | Stay tuned! -| **OMG/USDT** | 6 | `fb2c779532e89f660244ccdd71749e8d75b3e53a8fc0d5531ef814f8b8300eef` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_omg-usdt_6) | Stay tuned! -| **BTC/USD** | 6 | `24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_btc-usd_6) | Stay tuned! -| **ETH/USD** | 6 | `3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8` | [``](https://feeds.witnet.io/feeds/boba-rinkeby_eth-usd_6) | Stay tuned! +| **OMG/BTC** | 9 | `c4ec7fbc6384f83dad668488519c7195acafd67645ebcc7f76a8d747feaca2fb` | [`0x78C2dEb1A416508fB4B20A000cfD9d9673371e00`](https://feeds.witnet.io/feeds/boba-rinkeby_omg-btc_9) | Stay tuned! +| **OMG/ETH** | 9 | `e2960cc030131ae6ce0d14aea9ecfa937461aa22d2d55a36b44b27737a11bd75` | [`0x6be8bb17C07453d217cd1BADBa3E55A627DcdD2A`](https://feeds.witnet.io/feeds/boba-rinkeby_omg-eth_9) | Stay tuned! +| **OMG/USDT** | 6 | `fb2c779532e89f660244ccdd71749e8d75b3e53a8fc0d5531ef814f8b8300eef` | [`0x758C5adBFC25E260C07535933874e98583A14d41`](https://feeds.witnet.io/feeds/boba-rinkeby_omg-usdt_6) | Stay tuned! [ERC-2362]: https://github.com/adoracles/ado-contracts/blob/master/contracts/interfaces/IERC2362.sol [ADOIP-0010]: https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md#registered-ids \ No newline at end of file diff --git a/docs/chains/conflux/addresses.md b/docs/chains/conflux/addresses.md index 3b0acb52..1066de6d 100644 --- a/docs/chains/conflux/addresses.md +++ b/docs/chains/conflux/addresses.md @@ -13,20 +13,15 @@ listed here. These addresses are provided for reference, just in case someone prefers not to use the [Witnet Truffle Box] and rather talk to the Witnet Request Board and other contracts directly using the interfaces in the [Witnet Solidity Bridge]. -## Conflux Mainnet - Tethys - -Witnet is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned! - -## Conflux Testnet - -### Witnet entrypoint addresses -* WitnetRequestBoard: [`cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt`](https://testnet.confluxscan.io/address/cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt) -* WitnetParserLib: [`cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7`](https://testnet.confluxscan.io/address/cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7) - -### Published Price Feed contracts -* CFX/USDT: [`cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8`](https://testnet.confluxscan.io/address/cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8) -* BTC/USD: [`cfxtest:acg28k0yppzj5gc0dc1gazy6wt34m6ak5j5t12htkn`](https://testnet.confluxscan.io/address/cfxtest:acexkt9t0dm7tzhv9t1znbnc83ehtb703u9pyvd0cd) -* ETH/USD: [`cfxtest:ach8fz1axbh6p000u6xmsxpcfcawumvuyau4ac8tu5`](https://testnet.confluxscan.io/address/cfxtest:achf22mnyxrkt4bd4xb9b1fufwdw3bhg2pe445me8s) +## Witnet-provided addresses + +| Contract | Conflux.Testnet | Conflux.Mainnet | +| :------- | :-------------- | :-------------- | +| **WitnetRequestBoard** | [`cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt`](https://testnet.confluxscan.io/address/cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt) | Stay tuned! +| **WitnetParserLib** | [`cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7`](https://testnet.confluxscan.io/address/cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7) | Stay tuned! +| **CfxUsdtPriceFeed** | [`cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8`](https://testnet.confluxscan.io/address/cfxtest:ace8bsds7wn52khyk29nebzwfpvz5rppd28kcxetj8) | Stay tuned! +| **BtcUsdPriceFeed** | [`cfxtest:acg28k0yppzj5gc0dc1gazy6wt34m6ak5j5t12htkn`](https://testnet.confluxscan.io/address/cfxtest:acexkt9t0dm7tzhv9t1znbnc83ehtb703u9pyvd0cd) | Stay tuned! +| **EthUsdPriceFeed** | [`cfxtest:ach8fz1axbh6p000u6xmsxpcfcawumvuyau4ac8tu5`](https://testnet.confluxscan.io/address/cfxtest:achf22mnyxrkt4bd4xb9b1fufwdw3bhg2pe445me8s) | Stay tuned! [Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge [Witnet Truffle Box]: /try/use-from-ethereum diff --git a/docs/chains/conflux/price-feeds.md b/docs/chains/conflux/price-feeds.md index b765e9fd..90f2bf79 100644 --- a/docs/chains/conflux/price-feeds.md +++ b/docs/chains/conflux/price-feeds.md @@ -1,4 +1,4 @@ -# Witnet Price Feeds on Conflux Networks +# Witnet Price Feeds on Conflux networks Witnet Foundation operates a series of public price feeds in cooperation with Conflux Network both for showcasing the capabilities of the Witnet oracle, and as a public service for the broader Conflux community. @@ -36,7 +36,7 @@ be found in [ADOIP-0010]. As Solidity does not currently support `float` types, all prices are provided as `int256`, with a specific number of decimal digits. For example, if the BTC/USD price is `31371.21456`, the BTC/USD contract below will give`31371214560` because it is using 6 decimal digits. -## Data Explorer links +## Data Explorer links (and raw addresses) | | Decimals | Asset ID | Conflux.Testnet | Conflux.Mainnet | | ------------ | :------: | :------- | :-------------- | :-------------- | diff --git a/docs/ethereum/price-feeds.md b/docs/ethereum/price-feeds.md index 9916c15e..d391b43b 100644 --- a/docs/ethereum/price-feeds.md +++ b/docs/ethereum/price-feeds.md @@ -1,4 +1,4 @@ -# Witnet Public Price Feeds +# Witnet Public Price Feeds on Ethereum Witnet Foundation operates a series of public price feeds both for showcasing the capabilities of the Witnet oracle, and as a public service for the broader Ethereum community. @@ -40,8 +40,8 @@ be found in [ADOIP-0010]. | | Decimals | Asset ID | Mainnet | Goerli | Rinkeby | ------------ | :------: | :------- | :------ | :------ | :------ -| **BTC/USD** | 6 | `24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946` | [Stay tuned!](https://feeds.witnet.io/feeds/ethereum-mainnet_btc-usd_6) | [`0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c`](https://feeds.witnet.io/feeds/ethereum-goerli_btc-usd_6) | [`0xa7C971149AdfdFB237A0F78D7d317B916FFCE093`](https://feeds.witnet.io/feeds/ethereum-rinkeby_btc-usd_6) -| **ETH/USD** | 6 | `3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8` | [Stay tuned!](https://feeds.witnet.io/feeds/ethereum-mainnet_eth-usd_6) | [`0x031699240f710B47e92Df7766C06ee6C22A75df1`](https://feeds.witnet.io/feeds/ethereum-goerli_eth-usd_6) | [`0x1320C130Fc5361ced969Ca737d692a30e1142a13`](https://feeds.witnet.io/feeds/ethereum-rinkeby_eth-usd_6) +| **BTC/USD** | 6 | `24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946` | Stay tuned! | [`0x43Fe8778389f4EB98e82B750DCCAfF0D7d57778c`](https://feeds.witnet.io/feeds/ethereum-goerli_btc-usd_6) | [`0xa7C971149AdfdFB237A0F78D7d317B916FFCE093`](https://feeds.witnet.io/feeds/ethereum-rinkeby_btc-usd_6) +| **ETH/USD** | 6 | `3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8` | Stay tuned! | [`0x031699240f710B47e92Df7766C06ee6C22A75df1`](https://feeds.witnet.io/feeds/ethereum-goerli_eth-usd_6) | [`0x1320C130Fc5361ced969Ca737d692a30e1142a13`](https://feeds.witnet.io/feeds/ethereum-rinkeby_eth-usd_6) [ERC-2362]: https://github.com/adoracles/ado-contracts/blob/master/contracts/interfaces/IERC2362.sol [ADOIP-0010]: https://github.com/adoracles/ADOIPs/blob/main/adoip-0010.md#registered-ids diff --git a/mkdocs.yml b/mkdocs.yml index 2ba70ab7..56f6bbdc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,10 +30,10 @@ nav: - 7. Deploy: tutorials/bitcoin-price-feed/migrations.md - Recap: tutorials/bitcoin-price-feed/recap.md - Other chains: - - Boba Networks: + - Boba (Layer 2): - Price Feeds: chains/boba/price-feeds.md - Addresses: chains/boba/addresses.md - - Conflux Networks: + - Conflux Network: - Price Feeds: chains/conflux/price-feeds.md - Addresses: chains/conflux/addresses.md - Witnet-Rust Docs: