Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/chains/boba/addresses.md
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!
Comment on lines +17 to +23
Copy link
Member

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_20210914_190032

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean inside mkdocs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really too different!

Screenshot_20210915_113711


[Witnet Solidity Bridge]: https://github.com/witnet/witnet-solidity-bridge
[Witnet Truffle Box]: /try/use-from-ethereum
46 changes: 46 additions & 0 deletions docs/chains/boba/price-feeds.md
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
37 changes: 15 additions & 22 deletions docs/chains/conflux/addresses.md
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
88 changes: 23 additions & 65 deletions docs/chains/conflux/price-feeds.md
Original file line number Diff line number Diff line change
@@ -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("<address of the price feed>");
bytes32 assetID = bytes32(hex("<asset ID>"));
int256 value = priceFeed.valueFor(assetID);

return value;
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);
}

}
```

Expand All @@ -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 (and raw addresses)

* 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
Loading