Missing factory dependencies during compilation causes revert: The code hash is not known
error
#295
Closed
2 tasks done
Labels
compiler 📟
Issues specific to compiling
Component
zkforge
Have you ensured that all of these are up to date?
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: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.The text was updated successfully, but these errors were encountered: