Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new contract will point to wrong address. #32

Open
HiroKryptor opened this issue Jun 29, 2020 · 2 comments
Open

Create new contract will point to wrong address. #32

HiroKryptor opened this issue Jun 29, 2020 · 2 comments

Comments

@HiroKryptor
Copy link
Contributor

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?

this.address = this.options.address || address;

@ajaya-man
Copy link

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

@peekpi
Copy link
Contributor

peekpi commented Oct 15, 2020

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?

this.address = this.options.address || address;

what's your code?
this.options.address should be undefined, so this.address is the contractAddress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants