-
Notifications
You must be signed in to change notification settings - Fork 23
Feat: Add section covering BOBA integration #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # 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. | ||
|
|
||
| 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]. | ||
|
|
||
| ## Witnet-provided addresses (verified) | ||
|
|
||
| | 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # 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. | ||
|
|
||
| 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(<address of the price feed>); | ||
| bytes32 assetID = bytes32(hex"<asset ID>"); | ||
| (_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` | [`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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,27 @@ | ||
| # 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 | ||
| ## Witnet-provided addresses | ||
|
|
||
| Witnet is not live yet on Conflux mainnet, but will be deployed soon. Stay tuned! | ||
| | 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! | ||
|
|
||
| ## 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) | ||
| * WitnetParserLib: [`cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7`](https://testnet.confluxscan.io/address/cfxtest:acbez2ctj9dmvuep19uyb88wstzw6k41wyzct8ezh7) | ||
|
|
||
| ### Public price feeds | ||
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these tables look like once rendered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean inside mkdocs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really too different!