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

Error using create2 and solc optimizer off #589

Closed
ghost opened this issue Dec 16, 2020 · 3 comments
Closed

Error using create2 and solc optimizer off #589

ghost opened this issue Dec 16, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 16, 2020

Stack

  • hardhat
  • waffle
  • solidity-coverage

I am looking for a clue on where to look at, my tests are working using tests, when I use coverage I am having some issues.
Can some code that has some issues but the optimizer fixes ?

I have narrow down the issue and it looks like the create2 function isn't behaving the say way.

@cgewecke
Copy link
Member

cgewecke commented Dec 16, 2020

Can some code that has some issues but the optimizer fixes ?

So far, there are two known cases where people have discovered code which only compiles with the optimizer on.

I have narrow down the issue and it looks like the create2 function isn't behaving the say way.

Oh! Could you provide some more details to help reproduce the problem?

  • what is the test failure like?
  • what is your compiler version and settings?
  • what is the create2 code sequence like?

[EDIT - I've retitled this issue to reflect the reported problem]

@cgewecke cgewecke changed the title Test passing but not coverage Error using create2 and solc optimizer off Dec 16, 2020
@ghost
Copy link
Author

ghost commented Dec 16, 2020

I just found the cause of the issue.
I was using standard gas estimate when sending the transaction when switching to coverage I guess the contract I try to deploy using gets too big and create2 just returns address(0x0).

I have fixed the issue overriding the gas estimate.

@ghost ghost closed this as completed Dec 16, 2020
@cgewecke
Copy link
Member

Oh great! That's good to hear.

The extra gas needed is often really confusing, sorry about that.

This issue was closed.
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

1 participant