Skip to content

Commit

Permalink
docs: add documentation & notes on extra usages
Browse files Browse the repository at this point in the history
  • Loading branch information
Karrq committed Feb 7, 2025
1 parent ba14df4 commit 9e40df9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/verify/src/etherscan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ impl EtherscanVerificationProvider {
args: &VerifyArgs,
context: &CompilerVerificationContext,
) -> Result<VerifyContract> {
// NOTE(zk): will retrieve the zksync source set if this is a zksolc
// verification request
let (source, contract_name, code_format) = self.dispatch_source_provider(args, context)?;

let mut compiler_version = context.compiler_version().clone();
Expand All @@ -318,7 +320,9 @@ impl EtherscanVerificationProvider {
VerifyContract::new(args.address, contract_name, source, compiler_version)
.constructor_arguments(constructor_args)
.code_format(code_format);
self.populate_context_verify_args(context, &mut verify_args);

// NOTE(zk): add zksunc-specific items to the request
self.populate_verify_args_extras(context, &mut verify_args);

if args.via_ir {
// we explicitly set this __undocumented__ argument to true if provided by the user,
Expand Down
5 changes: 4 additions & 1 deletion crates/verify/src/etherscan/zksync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pub trait EtherscanZksyncSourceProvider {
}

impl EtherscanVerificationProvider {
pub(super) fn populate_context_verify_args(
/// Populates the `verify_args` request with context-specific
/// information
pub(super) fn populate_verify_args_extras(
&self,
context: &CompilerVerificationContext,
verify_args: &mut VerifyContract,
Expand All @@ -40,6 +42,7 @@ impl EtherscanVerificationProvider {
}
}

/// Dispatches the correct source request depending on the context
pub fn dispatch_source_provider(
&self,
args: &VerifyArgs,
Expand Down

0 comments on commit 9e40df9

Please sign in to comment.