Skip to content
Permalink
Browse files

Feature/dev 45 overwrite factory address (gnosis#57)

* Feature DEV-45 Overwrite factory address

* Feature DEV-45 Overwrite factory address
  • Loading branch information...
germartinez authored and denisgranha committed Jan 25, 2018
1 parent 2cbad1b commit 1ac504cbf8e8a77c930c720b6fd0fe5c2b452a61
Showing with 31 additions and 4 deletions.
  1. +19 −0 dapp/config.js
  2. +8 −0 dapp/controllers/settingsCtrl.js
  3. +4 −4 dapp/services/Transaction.js
@@ -167,6 +167,24 @@ var txDefault = {
}
};

var oldWalletFactoryAddresses = [
("0x12ff9a987c648c5608b2c2a76f58de74a3bf1987").toLowerCase(),
("0xed5a90efa30637606ddaf4f4b3d42bb49d79bd4e").toLowerCase(),
("0xa0dbdadcbcc540be9bf4e9a812035eb1289dad73").toLowerCase()
];

/**
* Update the default wallet factory address in local storage
*/
function checkWalletFactoryAddress() {
var userConfig = JSON.parse(localStorage.getItem("userConfig"));

if (userConfig && oldWalletFactoryAddresses.indexOf(userConfig.walletFactoryAddress.toLowerCase()) >= 0) {
userConfig.walletFactoryAddress = txDefaultOrig.walletFactoryAddress;
localStorage.setItem("userConfig", JSON.stringify(userConfig));
}
}

/**
* Reload configuration
*/
@@ -175,4 +193,5 @@ function loadConfiguration () {
Object.assign(txDefault, txDefaultOrig, userConfig);
}

checkWalletFactoryAddress();
loadConfiguration();
@@ -58,6 +58,14 @@
factoryAddress = $scope.config.walletFactoryAddresses['kovan'];
alertNode = $scope.config.alertNodes['kovan'];
}
else if (data.chain == 'ropsten') {
factoryAddress = $scope.config.walletFactoryAddresses['ropsten'];
alertNode = $scope.config.alertNodes['ropsten'];
}
else if (data.chain == 'privatenet') {
factoryAddress = $scope.config.walletFactoryAddresses['privatenet'];
alertNode = $scope.config.alertNodes['privatenet'];
}
else {
factoryAddress = $scope.config.walletFactoryAddresses['mainnet'];
alertNode = $scope.config.alertNodes['mainnet'];
@@ -305,22 +305,22 @@
else if (block && block.hash == "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") {
data.chain = "mainnet";
data.etherscan = "https://etherscan.io";
data.walletFactoryAddress = "0xed5a90efa30637606ddaf4f4b3d42bb49d79bd4e";
data.walletFactoryAddress = txDefault.walletFactoryAddresses["mainnet"].address;
}
else if (block && block.hash == "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") {
data.chain = "ropsten";
data.etherscan = "https://ropsten.etherscan.io";
data.walletFactoryAddress = "0x5cb85db3e237cac78cbb3fd63e84488cac5bd3dd";
data.walletFactoryAddress = txDefault.walletFactoryAddresses["ropsten"].address;
}
else if (block && block.hash == "0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9") {
data.chain = "kovan";
data.etherscan = "https://kovan.etherscan.io";
data.walletFactoryAddress = "0xa0dbdadcbcc540be9bf4e9a812035eb1289dad73";
data.walletFactoryAddress = txDefault.walletFactoryAddresses["kovan"].address;
}
else {
data.chain = "privatenet";
data.etherscan = "https://testnet.etherscan.io";
data.walletFactoryAddress = "0xd79426bcee5b46fde413ededeb38364b3e666097";
data.walletFactoryAddress = txDefault.walletFactoryAddresses["privatenet"].address;
}

resolve(data);

0 comments on commit 1ac504c

Please sign in to comment.
You can’t perform that action at this time.