-
Notifications
You must be signed in to change notification settings - Fork 2k
FEAT: support vyper contract verification #10864
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
base: master
Are you sure you want to change the base?
FEAT: support vyper contract verification #10864
Conversation
(cherry picked from commit e41786b)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, what's missing to get this over the line?
crates/verify/src/verify.rs
Outdated
@@ -410,6 +421,20 @@ impl VerifyArgs { | |||
} | |||
} | |||
|
|||
pub fn detect_language(args: &VerifyArgs, ctx: &VerificationContext) -> ContractLanguage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this a function of VerifyArgs instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
released new block-explorers version
still have a few questions here, mainly why we need additional logic for the solidity codeformat
crates/verify/src/verify.rs
Outdated
#[derive(Copy, Clone, Debug, Eq, PartialEq, ValueEnum)] | ||
pub enum ContractLanguage { | ||
Solidity, | ||
Vyper, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs docs
93a3dfe
to
e049932
Compare
Btw @mattsse, we should probably open an issue on the foundry-docs to properly mention this new feature, right? |
hello |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, last pedantic nits
and would like another review by @grandizzy or @zerosnacks
} | ||
ContractLanguage::Vyper => { | ||
// Execute vyper -f solc_json {target_path} | ||
let output = Command::new("vyper") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's ok for now but wonder if we should upstream a vyper.solc_json
fn to compilers as it is basically doing similar as here https://github.com/foundry-rs/compilers/blob/5846d3ca5181ecf4515997eecdeac52fdda22d29/crates/compilers/src/compilers/vyper/mod.rs#L118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, let me try to use the functions already existing on compilers or to create a new one for the solc_json
generation
Closes: #10702
This PR enables verification of Vyper contracts via
forge verify-contract
.✅ Summary of the approach
--language
that allows selecting betweensolidity
andvyper
.solc_json
(standard input JSON) through a small bypass, avoiding the need to route throughfoundry-compilers
..vy
, the appropriate arguments expected by Etherscan for Vyper are applied.🔧 Dependencies
This implementation depends on:
foundry-rs/block-explorers#91
Please make sure to merge and update that crate before merging this PR.
🧪 Test
Verified on Sepolia:

https://sepolia.etherscan.io/address/0x538d309a74c7201803db2eff456d7ebba56022b2#code