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

feat: adds verification for zksync block explorer #599

Merged
merged 16 commits into from
Oct 10, 2024

Conversation

dutterbutter
Copy link
Collaborator

@dutterbutter dutterbutter commented Oct 4, 2024

Motivation

Solution

  • Fixes verification by implementing ZkVerificationProvider formatted to adhere to ZKsync verification service while maintaining the Etherscan verification
  • Adds zksync verifier, should be used alongside --verifier-url

Example usage

Using forge create

forge create --zksync --rpc-url https://sepolia.era.zksync.dev --constructor-args "ForgeUSD" "FUSD" 18 1000000000000000000000 --private-key <PRIVATE-KEY> --verifier zksync  --verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification  --verify src/MyToken.sol:MyToken

Using forge verify-check

  • Passing verification ID, and specifying verifier and verifier-url
forge verify-check 27487 --verifier zksync --verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification --chain zksync-testnet

Using forge verify-contract

forge verify-contract 0x21d6dffe4B406c59E80CD62b4cB1763363c8a040 src/Counter.sol:Counter --verifier zksync --verifier-url https://explorer.sepolia.era.zksync.dev/contract_verification --zksync

Foundry-zksync-book

TODO

  • Test with standardJSON
  • Test using scripts (FAILS)
  • Test with more contracts (with libraries)
  • Test with additional compiler settings
  • Update foundry book
  • Test with forge verify-check
  • Test with forge verify-contract

@dutterbutter dutterbutter requested a review from Jrigada October 4, 2024 19:22
Copy link
Contributor

@Karrq Karrq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the awesome PR!

crates/verify/src/zksync/mod.rs Outdated Show resolved Hide resolved
crates/verify/src/zksync/mod.rs Outdated Show resolved Hide resolved
@dutterbutter dutterbutter requested a review from Karrq October 4, 2024 20:47
@dutterbutter
Copy link
Collaborator Author

dutterbutter commented Oct 4, 2024

Fails when using scripts right now. Specifically, during this check.

crates/script/src/build.rs Show resolved Hide resolved
crates/script/src/verify.rs Outdated Show resolved Hide resolved
crates/script/src/verify.rs Outdated Show resolved Hide resolved
crates/script/src/verify.rs Outdated Show resolved Hide resolved
@dutterbutter dutterbutter marked this pull request as ready for review October 8, 2024 14:39
@dutterbutter dutterbutter requested review from Karrq and nbaztec October 8, 2024 15:29
crates/script/src/verify.rs Outdated Show resolved Hide resolved
Karrq
Karrq previously approved these changes Oct 10, 2024
crates/script/src/sequence.rs Outdated Show resolved Hide resolved
crates/script/src/verify.rs Show resolved Hide resolved
crates/script/src/verify.rs Show resolved Hide resolved
crates/zksync/core/src/lib.rs Show resolved Hide resolved
@nbaztec nbaztec requested a review from Karrq October 10, 2024 14:27
@dutterbutter dutterbutter merged commit 15bec2f into main Oct 10, 2024
11 checks passed
@dutterbutter dutterbutter deleted the db/testing-verification branch October 10, 2024 16:48
@jarrodwatts
Copy link

Has this feature been included in a release yet? Keen to test it out!

@Karrq
Copy link
Contributor

Karrq commented Oct 23, 2024

Hey @jarrodwatts, I believe this feature made it into our nighlty release for a few days at the very least :)
For sure if you get the latest nightly release you'll have the feature available to use :)

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

Successfully merging this pull request may close these issues.

Contract source verification failure
5 participants