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

hardhat_setBalance blocking create2 deploys on anvil #764

Closed
kanej opened this issue May 23, 2024 · 0 comments · Fixed by #773
Closed

hardhat_setBalance blocking create2 deploys on anvil #764

kanej opened this issue May 23, 2024 · 0 comments · Fixed by #773
Assignees
Labels
status:ready This issue is ready to be worked on

Comments

@kanej
Copy link
Member

kanej commented May 23, 2024

This was first raised in the discord channel: https://discord.com/channels/750408878008827925/1153426756901032037/1243258480874360883

If you use create2 as a strategy when deploying against anvil, then because anvil has a chain id of 31337, the same as Hardhat, we attempt to deploy a createX factory if it is not present. This requires a hardhat_setBalance call to be made to the account that is used for deploying the createX factory.

In Hardhat, the rpc call hardhat_setBalance returns a boolean. It appears not to in anvil. Ignition on not getting the expected return result throws an error:

image

Approach

We should loosen the hardhat_setBalance return type check to allow anvil to pass. In Hardhat we always return true, or throw if we where unable to set the balance; so the check on the Ignition side is redundant.

Testing

This is a small fix, but we should double check create2 runs against anvil manually.

Workaround

In the meantime, manually deploying the createX factory then running an Ignition deploy with create2 strategy should work.

@kanej kanej added status:ready This issue is ready to be worked on and removed status:triaging labels May 23, 2024
@zoeyTM zoeyTM self-assigned this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants