support multiple chains; load correct contracts depending on the command line option
This commit is contained in:
parent
b30b2fb2e3
commit
f145c5251b
|
@ -33,7 +33,6 @@ class Actions {
|
|||
}
|
||||
|
||||
connect(url, cb) {
|
||||
console.dir("chain: " + url);
|
||||
console.dir("connecting to: " + url);
|
||||
web3.setProvider(url);
|
||||
|
||||
|
|
|
@ -8,11 +8,12 @@ class Contracts {
|
|||
}
|
||||
|
||||
loadContracts() {
|
||||
const LiquidPledgingJSONConfig = require("../dist/contracts/LiquidPledging.json");
|
||||
console.dir("loading contracts for " + this.chain);
|
||||
const LiquidPledgingJSONConfig = require(`../chains/${this.chain}/contracts/LiquidPledging.json`);
|
||||
const LiquidPledging = new this.web3.eth.Contract(LiquidPledgingJSONConfig.abiDefinition, LiquidPledgingJSONConfig.address);
|
||||
this.contracts.LiquidPledging = LiquidPledging;
|
||||
|
||||
const StandardTokenJSONConfig = require("../dist/contracts/StandardToken.json");
|
||||
const StandardTokenJSONConfig = require(`../chains/${this.chain}/contracts/StandardToken.json`);
|
||||
const StandardToken = new this.web3.eth.Contract(StandardTokenJSONConfig.abiDefinition, StandardTokenJSONConfig.address);
|
||||
this.contracts.StandardToken = StandardToken;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue