Skip to content

Commit f7de821

Browse files
authored
Merge pull request #221 from rsksmart/2.0.0-rebased
Add deployed addresses and ip 172.17.0.1 as localhost
2 parents a8c4c8a + d6fcd00 commit f7de821

10 files changed

+46
-23
lines changed

bridge/deployed/deployHelper.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
const fs = require('fs')
22

3+
function isMainnet(network) {
4+
return network.toLowerCase().includes('mainnet')
5+
}
6+
37
function isLocalNetwork(network) {
48
return !network.toLowerCase().includes('mainnet')
59
&& !network.toLowerCase().includes('kovan')
@@ -25,5 +29,6 @@ function saveDeployed(deployJson) {
2529
module.exports = {
2630
isLocalNetwork: isLocalNetwork,
2731
getDeployed: getDeployed,
28-
saveDeployed: saveDeployed
32+
saveDeployed: saveDeployed,
33+
isMainnet: isMainnet,
2934
};

bridge/deployed/ethmainnet.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"MultiSig": "0x040007b1804ad78a97f541bebed377dcb60e4138",
44
"ProxyAdmin": "0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6",
55
"Utils": "0x5f989f2f323a1732a565c9a3f694f2Fa8f0b6120",
6-
"Federation": "0x479F86eCbE766073D2712EF418acEb56d5362a2B",
7-
"SideTokenFactory": "0x578a80AD3f6D56f873da81b73B8D192aB6BfB063",
8-
"AllowTokens": "0xe4aa0f414725C9322a1a9D80d469c5e234786653",
6+
"Federation": "0x5631a6ac95b6bde690807085aaa70e3b2d9d76c5",
7+
"SideTokenFactory": "0xf73c60863bf2930bde2c69df4cb8fe700ae713fb",
8+
"AllowTokens": "0x118522603dc0b8490fec2b8db92e6f1c66cd697c",
99
"BridgeProxy": "0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d",
10-
"Bridge": "0x8582f510817731Be46e6A8380cF4eEFfc05aa5f1",
10+
"Bridge": "0x9f29f9bda2052884d39f0f032b68aaa14fc363d8",
1111
"smallAmountConfirmations": "120",
1212
"mediumAmountConfirmations": "240",
1313
"largeAmountConfirmations": "5760",
14-
"WrappedCurrency": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
14+
"WrappedCurrency": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
15+
"AllowTokensProxy": "0xa3fc98e0a7a979677bc14d541be770b2cb0a15f3",
16+
"FederationProxy": "0x5e29c223d99648c88610519f96e85e627b3abe17"
1517
}

bridge/deployed/rskmainnet.json

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"network": "rskmainnet",
3-
"MultiSig": "0x040007b1804aD78A97f541bEBED377dcb60E4138",
3+
"MultiSig": "0x040007b1804ad78a97f541bebed377dcb60e4138",
44
"ProxyAdmin": "0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d",
5-
"Utils": "0x95eD2b8D3115bAE6c0Ce539781B7D44119e019Bc",
6-
"Federation": "0xE37b6516F4FE2A27569a2751C1aD50F6340DF369",
7-
"SideTokenFactory": "0x75c6e15702ebacd51177154ff383df9695e1b1da",
8-
"AllowTokens": "0xe4aa0f414725c9322a1a9d80d469c5e234786653",
9-
"Bridge": "0x3b4353D80464af08Cc0787eA9C45BbC50f8c5cCE",
10-
"BridgeProxy": "0x9d11937E2179dC5270Aa86A3f8143232D6DA0E69",
5+
"Utils": "0x95ed2b8d3115bae6c0ce539781b7d44119e019bc",
6+
"Federation": "0x950a384d950ea319f7d634cabac41ffee49320f0",
7+
"SideTokenFactory": "0x44fcd0854d745efdef4cfe9868efe4d4eb51ecd6",
8+
"AllowTokens": "0x882846c2792a999cee1d080e89bec9e17f885bdd",
9+
"Bridge": "0x4e159f565555fc4eb27d864ff0bd308f1cefa0ac",
10+
"BridgeProxy": "0x9d11937e2179dc5270aa86a3f8143232d6da0e69",
1111
"smallAmountConfirmations": "60",
1212
"mediumAmountConfirmations": "120",
1313
"largeAmountConfirmations": "2880",
14-
"WrappedCurrency": "0x967f8799af07df1534d48a95a5c9febe92c53ae0"
14+
"WrappedCurrency": "0x967f8799af07df1534d48a95a5c9febe92c53ae0",
15+
"AllowTokensProxy": "0xcb789036894a83a008a2aa5b3c2dde41d0605a9a",
16+
"FederationProxy": "0x7ecfda6072942577d36f939ad528b366b020004b"
1517
}

bridge/migrations/21_deploy_allowTokens.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async function setTokensEthereum(allowTokens) {
224224
{ token: '0x8d3e855f3f55109d473735ab76f753218400fe96', typeId: '3' }, //BUND
225225
{ token: '0xf04a8ac553fcedb5ba99a64799155826c136b0be', typeId: '6' }, //FLIXX
226226
{ token: '0xa1d6Df714F91DeBF4e0802A542E13067f31b8262', typeId: '6' }, //RFOX
227-
{ token: '0xca0e7269600d353f70b14ad118a49575455c0f2f', typeId: '7' }, //AMLT
227+
{ token: '0xca0e7269600d353f70b14ad118a49575455c0f2f', typeId: '6' }, //AMLT
228228
// Side Tokens
229229
{ token: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5', typeId: '5' }, //eRIF
230230
{ token: '0xe700691da7b9851f2f35f8b8182c69c53ccad9db', typeId: '4' }, //eDOC

bridge/migrations/24_deploy_bridge.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ module.exports = async (deployer, networkName, accounts) => {
1919
const proxyAdmin = await ProxyAdmin.at(deployedJson.ProxyAdmin);
2020

2121
let methodCall = proxyAdmin.contract.methods.upgrade(deployedJson.BridgeProxy, deployedJson.Bridge);
22-
await methodCall.call({from:deployedJson.MultiSig})
22+
if (!deployHelper.isMainnet(networkName)) {
23+
await methodCall.call({from:deployedJson.MultiSig});
24+
}
2325
await multiSig.submitTransaction(proxyAdmin.address, 0, methodCall.encodeABI(), { from: accounts[0] });
2426

2527
const bridge = await Bridge.at(deployedJson.BridgeProxy);
@@ -38,10 +40,14 @@ module.exports = async (deployer, networkName, accounts) => {
3840
await multiSig.submitTransaction(allowTokens.address, 0, methodCall.encodeABI(), { from: accounts[0] });
3941
} else {
4042
methodCall = bridge.contract.methods.setWrappedCurrency(deployedJson.WrappedCurrency);
41-
await methodCall.call({from:deployedJson.MultiSig})
43+
if (!deployHelper.isMainnet(networkName)) {
44+
await methodCall.call({from:deployedJson.MultiSig});
45+
}
4246
await multiSig.submitTransaction(bridge.address, 0, methodCall.encodeABI(), { from: accounts[0] });
4347
}
4448
methodCall = bridge.contract.methods.initDomainSeparator();
45-
await methodCall.call({from:deployedJson.MultiSig})
49+
if (!deployHelper.isMainnet(networkName)) {
50+
await methodCall.call({from:deployedJson.MultiSig});
51+
}
4652
await multiSig.submitTransaction(bridge.address, 0, methodCall.encodeABI(), { from: accounts[0] });
4753
};

bridge/migrations/25_transfer_federation.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ module.exports = async (deployer, networkName, accounts) => {
99
const bridge = new web3.eth.Contract(Bridge.abi, deployedJson.BridgeProxy);
1010
const methodCall = bridge.methods.changeFederation(deployedJson.FederationProxy);
1111

12-
await methodCall.call({ from: deployedJson.MultiSig });
12+
if (!deployHelper.isMainnet(networkName)) {
13+
// Check before sending the transaction as it eats the error
14+
await methodCall.call({ from: deployedJson.MultiSig });
15+
}
1316
await multiSig.submitTransaction(deployedJson.BridgeProxy, 0, methodCall.encodeABI(), { from: accounts[0] });
1417

1518
}

bridge/migrations/26_transfer_sideTokenFactory.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ module.exports = async (deployer, networkName, accounts) => {
1010
const bridge = new web3.eth.Contract(Bridge.abi, deployedJson.BridgeProxy);
1111
const methodCall = bridge.methods.changeSideTokenFactory(deployedJson.SideTokenFactory);
1212

13-
await bridge.methods.changeSideTokenFactory(deployedJson.SideTokenFactory).call({ from: deployedJson.MultiSig });
13+
if (!deployHelper.isMainnet(networkName)) {
14+
// Check before sending the transaction as it eats the error
15+
await methodCall.call({ from: deployedJson.MultiSig });
16+
}
1417
await multiSig.submitTransaction(deployedJson.BridgeProxy, 0, methodCall.encodeABI(), { from: accounts[0] });
1518
}

bridge/migrations/27_transfer_allowTokens.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ module.exports = async (deployer, networkName, accounts) => {
1010
const bridge = new web3.eth.Contract(Bridge.abi, deployedJson.BridgeProxy);
1111
const methodCall = bridge.methods.changeAllowTokens(deployedJson.AllowTokensProxy);
1212

13-
//Check before sending the transaction as it eats the error
14-
await methodCall.call({ from: deployedJson.MultiSig });
13+
if (!deployHelper.isMainnet(networkName)) {
14+
// Check before sending the transaction as it eats the error
15+
await methodCall.call({ from: deployedJson.MultiSig });
16+
}
1517
await multiSig.submitTransaction(deployedJson.BridgeProxy, 0, methodCall.encodeABI(), { from: accounts[0] });
1618
}

federator/src/contracts/BridgeFactory.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module.exports = class BridgeFactory {
2020
async createInstance(web3, address) {
2121
let bridgeContract = new web3.eth.Contract(abiBridgeOld, address);
2222
const version = await this.getVersion(bridgeContract);
23-
console.log('version', version)
2423
if (version === 'v3') {
2524
bridgeContract = new web3.eth.Contract(abiBridgeNew, address);
2625
} else if (!['v2','v1'].includes(version)) {

federator/src/lib/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ function calculatePrefixesSuffixes(nodes) {
134134
function checkHttpsOrLocalhost(url = '') {
135135
const isHttps = url.slice(0,8).toLowerCase() === 'https://';
136136
const isLocalhost = url.slice(0,16).toLowerCase() === 'http://127.0.0.1' ||
137+
url.slice(0,17).toLowerCase() === 'http://172.17.0.1' ||
137138
url.slice(0,16).toLowerCase() === 'http://localhost' ||
138139
url.slice(0,14).toLowerCase() === 'http://0.0.0.0';
139140

0 commit comments

Comments
 (0)