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

Missing factory dependencies during compilation causes revert: The code hash is not known error #295

Closed
2 tasks done
brotherlymite opened this issue Apr 1, 2024 · 1 comment · Fixed by #316
Closed
2 tasks done
Labels
compiler 📟 Issues specific to compiling

Comments

@brotherlymite
Copy link

brotherlymite commented Apr 1, 2024

Component

zkforge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (4307bfb 2024-03-20T16:57:57.936401000Z)

What command(s) is the bug in?

zkforge zkb

Operating System

macOS (Apple Silicon)

Describe the bug

The factory contract artifact after compilation does not contain all the factoryDependencies of the child contracts I think, which leads to script failed: revert: The code hash is not known error during contract deployment of factory.

When a factory contract which can deploy child contracts is compiled, the factoryDependencies field in the artifacts contains the data needed for deploying the child contracts as the bytecode of child contracts needs to be known in advance in order for the factory to deploy child contracts.

Example repository to reproduce issue: https://github.com/brotherlymite/zksync-factory-deps-issue

  • Example Issue one:

    Run: zkforge zkb on the above repo and notice that the artifact generated for FactoryExampleOne.sol contract is incomplete and does not contain all the factory dependencies (the nested ones), for ex. ProxyAdmin, TransparentUpgradeableProxy

    This can be seen also when we run make deploy-ex-one on the above repo and notice that we get the following error:

    Traces:
      [0] 0x0000000000000000000000000000000000000000::fallback()
        └─ ← <no data>
      [333505] 0x0000000000000000000000000000000000000000::fallback()
        └─ ← <no data>
    Error: 
    script failed: revert: The code hash is not known
    
  • Example Issue two:

    Run: make deploy-ex-two on the above repo and notice that when using a pre-deployed factory contract, when we try to deploy child contracts FactoryExampleTwo.sol, we again run into the same error as above.

@brotherlymite brotherlymite changed the title Missing factory dependencies during compilation causes script failed: revert: The code hash is not known error Missing factory dependencies during compilation causes revert: The code hash is not known error Apr 1, 2024
@dutterbutter
Copy link
Collaborator

That should not happen! We are actively investigating and will be resolved in next release.

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

Successfully merging a pull request may close this issue.

2 participants