sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Create new contract will point to wrong address.

Open HiroKryptor opened this issue 4 years ago • 2 comments

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

HiroKryptor avatar Jun 29 '20 23:06 HiroKryptor

I had also faced the same issue, and workaround was to use 'to' parameter explicitly in the methods call.

ajaya-man avatar Aug 05 '20 16:08 ajaya-man

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.

peekpi avatar Oct 15 '20 09:10 peekpi