Skip to content

Commit

Permalink
feat: update migrations centralized bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Claudia Bartoli Duncan <[email protected]>
  • Loading branch information
clbartoli committed Apr 19, 2021
1 parent c5c634b commit a746133
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 67 deletions.
8 changes: 3 additions & 5 deletions contracts/WitnetDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
pragma solidity ^0.6.6;
pragma experimental ABIEncoderV2;

// Import witnet-ethereum-block-relay-contracts
import "witnet-ethereum-block-relay/contracts/CentralizedBlockRelay.sol";
import "witnet-ethereum-block-relay/contracts/BlockRelayProxy.sol";
// Import the UsingWitnet library that enables interacting with Witnet
import "witnet-ethereum-bridge/contracts/WitnetRequestsBoard.sol";
import "witnet-ethereum-bridge/contracts/WitnetRequestsBoardProxy.sol";
import "witnet-ethereum-bridge/contracts/UsingWitnet.sol";
import "witnet-ethereum-bridge/contracts/WitnetRequestBoard.sol";
import "witnet-ethereum-bridge/contracts/WitnetRequestBoardProxy.sol";
import "witnet-ethereum-bridge/contracts/Witnet.sol";
import "witnet-ethereum-bridge/contracts/CBOR.sol";
// Import price feeds
Expand Down
14 changes: 0 additions & 14 deletions migrations/2_deploy_cent_block_relay.js

This file was deleted.

14 changes: 14 additions & 0 deletions migrations/2_deploy_wrb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

const WitnetRequestBoard = artifacts.require("WitnetRequestBoard")
const addresses = require("./addresses.json")

module.exports = function (deployer, network, accounts) {
network = network.split("-")[0]
console.log(network)
if (network in addresses && addresses[network].WitnetRequestBoard) {
WitnetRequestBoard.address = addresses[network].WitnetRequestBoard
} else {
console.log(`> Migrating WitnetRequestBoard into ${network} network`)
return deployer.deploy(WitnetRequestBoard, [accounts[0]])
}
}
14 changes: 0 additions & 14 deletions migrations/3_deploy_br_proxy.js

This file was deleted.

15 changes: 15 additions & 0 deletions migrations/3_deploy_wrb_proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

const WitnetRequestBoard = artifacts.require("WitnetRequestBoard")
const WitnetRequestBoardProxy = artifacts.require("WitnetRequestBoardProxy")
const addresses = require("./addresses.json")

module.exports = function (deployer, network) {
network = network.split("-")[0]
console.log(network)
if (network in addresses && addresses[network].WitnetRequestBoardProxy) {
WitnetRequestBoardProxy.address = addresses[network].WitnetRequestBoardProxy
} else {
console.log(`> Migrating WitnetRequestBoardProxy into ${network} network`)
return deployer.deploy(WitnetRequestBoardProxy, WitnetRequestBoard.address)
}
}
File renamed without changes.
15 changes: 0 additions & 15 deletions migrations/4_deploy_wrb.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Witnet = artifacts.require("Witnet")
const WitnetRequestsBoardProxy = artifacts.require("WitnetRequestsBoardProxy")
const WitnetRequestBoardProxy = artifacts.require("WitnetRequestBoardProxy")
const BtcUsdPriceFeed = artifacts.require("BtcUsdPriceFeed")
const addresses = require("./addresses.json")

Expand All @@ -9,6 +9,6 @@ module.exports = function (deployer, network) {
BtcUsdPriceFeed.address = addresses[network].BtcUsdPriceFeed
} else{
deployer.link(Witnet, [BtcUsdPriceFeed])
deployer.deploy(BtcUsdPriceFeed, WitnetRequestsBoardProxy.address)
deployer.deploy(BtcUsdPriceFeed, WitnetRequestBoardProxy.address)
}
}
15 changes: 0 additions & 15 deletions migrations/5_deploy_wrb_proxy.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

const Witnet = artifacts.require("Witnet")
const WitnetRequestsBoardProxy = artifacts.require("WitnetRequestsBoardProxy")
const WitnetRequestBoardProxy = artifacts.require("WitnetRequestBoardProxy")
const GoldEurPriceFeed = artifacts.require("GoldEurPriceFeed")
const addresses = require("./addresses.json")

Expand All @@ -10,6 +10,6 @@ module.exports = function (deployer, network) {
GoldEurPriceFeed.address = addresses[network].GoldEurPriceFeed
} else{
deployer.link(Witnet, [GoldEurPriceFeed])
deployer.deploy(GoldEurPriceFeed, WitnetRequestsBoardProxy.address)
deployer.deploy(GoldEurPriceFeed, WitnetRequestBoardProxy.address)
}
}
File renamed without changes.
14 changes: 14 additions & 0 deletions migrations/addresses.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"rinkeby" : {

"Witnet": "0x47689bc2d27770Ab3a358C1C2C9c998028ea0823",
"WitnetRequestBoard": "0x90d08bF4e89C9D1fFb69cb4F783c38F6493ae74a",
"WitnetRequestBoardProxy": "0xE1EC13d1521B98ee7b826751048806E85DC1F1bA",
"BtcUsdPriceFeed": "0x2Bc468FeE3222273c9CCeb2F326c189EC2b9c7c0",
"EthUsdPriceFeed": "0xF51704649E14094DB8F1cBd8CEE2c204dFD83bB5",
"GoldEurPriceFeed": "0xF6e23A466617E1A3d81cA86D3eBD69DdA4eF984A"
},
"goerli" : {

"Witnet": "0xb64212DBefFCdDeCC57B7B6F4E49a3B876cA3D6E",
"WitnetRequestBoard": "0xCF8B9f0Edc298Da2CD5832Dc9D85D805E33dB5Af",
"WitnetRequestBoardProxy": "0xA1539D2d301201f8001F582a8B4F61B206747716",
"GoldEurPriceFeed": "0x5ab43d4F7f2B30C1ce5BC8b78eef5bf3F0bc6339",
"BtcUsdPriceFeed": "0x2F359585536471c5cFB5d3bC71380cCF99EFbdcB",
"EthUsdPriceFeed": "0x6Be525a3D9D2905222D1a9F5153024F909E9eB2c"
}
}

0 comments on commit a746133

Please sign in to comment.