Fallback to provider if no contract signer is given #29

Merged
bumi merged 2 commits from fallback-provider into master 2018-04-21 09:19:43 +00:00

View File

@ -90,7 +90,9 @@ class Kredits {
if (!address || !abi) {
throw new Error(`Address or ABI not found for ${contractName}`);
}
let contract = new ethers.Contract(address, abi, this.signer);
let signerOrProvider = this.signer || this.provider;
let contract = new ethers.Contract(address, abi, signerOrProvider);
this.contracts[name] = new Contracts[contractName](contract);
this.contracts[name].ipfs = this.ipfs;