Skip to content

Commit

Permalink
feat: add support to CELO providers
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Aug 30, 2021
1 parent 142c560 commit 3e0ec34
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 16 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ The repository also provides:

`WitnetProxy` is an upgradable delegate-proxy contract that routes Witnet Data Requests coming from a `UsingWitnet`-inheriting contract to a currently active `WitnetRequestBoard` implementation.

The following table contains all the `WinetProxy` instances that act as entry-points for the latest versions of the `WitnetRequestBoard` approved and deployed by the [**Witnet Foundation**](https://witnet.foundation), and that actually integrates with the **Witnet mainnet** from the currently supported EVM-compatible blockchains.
The following table contains the addresses that point to the the latest deployed versions of the `WitnetRequestBoard`, approved by the [**Witnet Foundation**](https://witnet.foundation), and that actually integrates with the **Witnet mainnet** from the currently supported EVM-compatible blockchains.

| Blockchain | Network | `WitnetProxy` |
| ------------ | --------- | :-----------: |
| **Ethereum** | Rinkeby | `0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4`
| | Göerli | `0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8`
| | Mainnet | ``
| Chain | Network | Entrypoint address | Version tag
| ------------ | --------- | :----------------- | :----------
| **Ethereum** | Rinkeby | `0x6cE42a35C61ccfb42907EEE57eDF14Bb69C7fEF4` | `0.4.2-trustable`
| | Göerli | `0xb58D05247d16b3F1BD6B59c52f7f61fFef02BeC8` | `0.4.2-trustable`
| | Mainnet | |
| ------------ | --------- | ---------------------
| **Conflux** | Testnet | `cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt`
| | Mainnet | ``
| **Conflux** | Testnet | `cfxtest:acfnpy71hjhamy075xyps56124zje5154ux9nte7vt` | `0.4.2-trustable`
| | Mainnet | |
| ------------ | --------- | ---------------------
| **BOBA.L2** | Rinkeby | `0xA2F4f5290F9cfD3a17Cfa82f2a2fD3E5c05d1442`
| | Mainnet | ``
| **BOBA.L2** | Rinkeby | `0xA2F4f5290F9cfD3a17Cfa82f2a2fD3E5c05d1442` | `0.4.2-trustable-boba`
| | Mainnet | |
| ------------ | --------- | ---------------------
| **CELO** | Alfajores | `0x8e0F6f18DA49e548eBf845aFb6Ca98d43CBc8744` | `0.4.2-trustable`
| | Mainnet | |

## **IWitnetRequest**

Expand Down
3 changes: 1 addition & 2 deletions contracts/impls/WitnetProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import "../patterns/Upgradable.sol";

/// @title WitnetProxy: upgradable delegate-proxy contract that routes Witnet data requests coming from a
/// `UsingWitnet`-inheriting contract to a currently active `WitnetRequestBoard` implementation.
/// https://github.com/witnet/witnet-ethereum-bridge/tree/0.3.x
/// @author The Witnet Foundation.
contract WitnetProxy {

struct WitnetProxySlot {
address implementation;
}

/// Event emitted when a new DR is posted.
/// Event emitted every time the implementation gets updated.
event Upgraded(address indexed implementation);

/// Constructor with no params as to ease eventual support of Singleton pattern (i.e. ERC-2470).
Expand Down
9 changes: 6 additions & 3 deletions migrations/scripts/1_deploy_wrb.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const { merge } = require("lodash")

const realm = process.env.WITNET_EVM_REALM ? process.env.WITNET_EVM_REALM.toLowerCase() : "default"
const settings = require("../witnet.settings")
const artifactsName = merge(settings.artifacts.default, settings.artifacts[realm])

module.exports = async function (deployer, network, accounts) {
const addresses = require("../witnet.addresses")[realm][network.split("-")[0]]
const realm = network === "test"
? "default"
: process.env.WITNET_EVM_REALM ? process.env.WITNET_EVM_REALM.toLowerCase() : "default"

const addresses = require("../witnet.addresses")[realm][network = network.split("-")[0]]
const artifactsName = merge(settings.artifacts.default, settings.artifacts[realm])

let WitnetParserLib, WitnetDecoderLib
let WitnetProxy, WitnetRequestBoard
Expand Down
6 changes: 6 additions & 0 deletions migrations/witnet.addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@
"WitnetParserLib": "",
"WitnetRequestBoard": ""
}
},
"celo": {
"celo.alfajores": {
"WitnetParserLib": "0x1C402c521C8dbF8aCF769d8445dC69c09E3505a5",
"WitnetRequestBoard": "0x8e0F6f18DA49e548eBf845aFb6Ca98d43CBc8744"
}
}
}
13 changes: 13 additions & 0 deletions migrations/witnet.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ module.exports = {
version: "./node_modules/@eth-optimism/solc",
},
},
celo: {
solc: {
version: "0.8.7",
},
},
},
networks: {
default: {
Expand Down Expand Up @@ -112,6 +117,14 @@ module.exports = {
skipDryRun: true,
},
},
celo: {
"celo.alfajores": {
network_id: 44787,
host: "localhost",
port: 8538,
skipDryRun: true,
},
},
},
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "witnet-ethereum-bridge",
"version": "0.4.2",
"version": "0.4.3",
"description": "Witnet Bridge Solidity contracts for EVM-compatible networks",
"main": "",
"scripts": {
Expand Down

0 comments on commit 3e0ec34

Please sign in to comment.