-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Solidity verifier does not accept optimization mode #1072
Comments
let settings = Settings { |
Hi @monokh, thanks for raising it! This a bug indeed and I will prepare a fix soon, but it affects only |
Thanks for looking into this Yet I am still unable to verify our contract, I have checked that the compiler versions match through the verification payload and build.json |
I should also mention that our contract deploys another contract in the constructor |
Thanks, it should be enough to investigate, let me come back later after I try it |
…rification (#1079) ## What ❔ Fixes #1072 ## Why ❔ Bug fix ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`.
Thanks. Here are deployed versions if you'd like to avoid deploying yourself: They were compiled and deployed using the settings in the repo Testnet: |
sorry had the mainnet adress wrong 😅 I've updated it - correct is |
@monokh we've found a problem in hardhat verification plugin. Problem was triggered because you are using hardhat-preproccesor plugin. For now please verify contracts compiled with this plugin with |
🐛 Bug Report
📝 Description
Calling the verifier api with a contract compiled using any optimization mode except "3" will not result in the correct compilation from the verifier.
🔄 Reproduction Steps
Compile a contract with zksolc optimizer mode "z"
Use hardhat verifier, manually or on explorer.
🤔 Expected Behavior
Verifier should pass and verify the contract correctly
😯 Current Behavior
Verifier errors:
Deployed bytecode is not equal to generated one from given source
🖥️ Environment
Any relevant environment details.
📋 Additional Context
This seems to happen because for building the solc input, the verifier does not pass on
optimizerMode
like it does for the vyper input:https://github.com/matter-labs/zksync-era/blob/main/core/bin/contract-verifier/src/verifier.rs#L304
See implemented correctly for vyper: https://github.com/matter-labs/zksync-era/blob/main/core/bin/contract-verifier/src/verifier.rs#L304
📎 Log Output
The text was updated successfully, but these errors were encountered: