Open HiroKryptor opened 4 years ago
I had also faced the same issue, and workaround was to use 'to' parameter explicitly in the methods call.
Steps Create new contract with abi and address as params:
hmy.contracts.createContract(abi, contractAddress);
What expected? New contract instance will send to contractAddress What happend? New contract instance will send to options addresss. Suggestion Check if constructor with address will using this param don't using in options.address Code line? https://github.com/harmony-one/sdk/blob/ab95524bd0f873dc8d5ed15910f492eb07f73908/packages/harmony-contract/src/contract.ts#L42
what's your code?
this.options.address
should be undefined
, so this.address
is the contractAddress
.
Steps Create new contract with abi and address as params:
hmy.contracts.createContract(abi, contractAddress);
What expected? New contract instance will send to contractAddress What happend? New contract instance will send to options addresss. Suggestion Check if constructor with address will using this param don't using in options.address Code line? https://github.com/harmony-one/sdk/blob/ab95524bd0f873dc8d5ed15910f492eb07f73908/packages/harmony-contract/src/contract.ts#L42