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

Remove address override #832

Merged
merged 2 commits into from
Jul 4, 2023
Merged

Conversation

ericglau
Copy link
Member

@ericglau ericglau commented Jul 4, 2023

Closes #767

Remove overriding the contract address on deployments, since ethers.js's deploy function already calculates the address for the create operation.

@ericglau ericglau requested a review from frangio July 4, 2023 20:11
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to do something slightly different. I can't see what the difference would be though.

const { address, deployTransaction } = await factory.deploy(...args);

@ericglau
Copy link
Member Author

ericglau commented Jul 4, 2023

We used to do something slightly different. I can't see what the difference would be though.

const { address, deployTransaction } = await factory.deploy(...args);

ethers v6 needs a different approach:

  • deployTransaction can be null in the returned type (but should not be null here since it was a deployment)
  • address is not a field so we need to await getAddress()

@ericglau ericglau merged commit 000c4fd into OpenZeppelin:next Jul 4, 2023
7 checks passed
@ericglau ericglau deleted the remove-override branch July 4, 2023 20:25
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

Successfully merging this pull request may close these issues.

2 participants