Fallback to provider if no contract signer is given
No signing functions will be available then.
This commit is contained in:
parent
555cf1e12c
commit
42bfb3d24e
@ -106,7 +106,8 @@ class Kredits {
|
|||||||
if (!address || !abis[contractName]) {
|
if (!address || !abis[contractName]) {
|
||||||
throw new Error(`Address or ABI not found for ${contractName}`);
|
throw new Error(`Address or ABI not found for ${contractName}`);
|
||||||
}
|
}
|
||||||
let contract = new ethers.Contract(address, abis[contractName], this.signer);
|
let signerOrProvider = this.signer || this.provider;
|
||||||
|
let contract = new ethers.Contract(address, abis[contractName], signerOrProvider);
|
||||||
this.contracts[name] = new contracts[contractName](contract);
|
this.contracts[name] = new contracts[contractName](contract);
|
||||||
this.contracts[name].ipfs = this.ipfs;
|
this.contracts[name].ipfs = this.ipfs;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user