Skip to content

Commit

Permalink
fix: fix build issue with zk_source
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Oct 4, 2024
1 parent b8723d0 commit 1177466
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions crates/verify/src/zksync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{fmt::Debug, thread::sleep, time::Duration};

pub mod standard_json;

// TODO: This is hardcode for Sepolia verification URL, need to be updated.
// TODO: This is hardcoded for Sepolia verification URL, need to be updated.
pub static ZKSYNC_VERIFICATION_URL: &str =
"https://explorer.sepolia.era.zksync.dev/contract_verification";

Expand All @@ -22,7 +22,6 @@ pub struct ZkVerificationProvider;
pub trait ZksyncSourceProvider: Send + Sync + Debug {
fn zk_source(
&self,
args: &VerifyArgs,
context: &ZkVerificationContext,
) -> Result<(StandardJsonCompilerInput, String)>;
}
Expand Down Expand Up @@ -131,7 +130,7 @@ impl ZkVerificationProvider {
) -> Result<VerifyContractRequest> {
let (source, contract_name) = if let CompilerVerificationContext::ZkSolc(context) = context
{
self.source_provider().zk_source(args, context)?
self.source_provider().zk_source(context)?
} else {
eyre::bail!("Unsupported compiler context: only ZkSolc is supported");
};
Expand Down
5 changes: 1 addition & 4 deletions crates/verify/src/zksync/standard_json.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{VerifyArgs, ZksyncSourceProvider};
use super::ZksyncSourceProvider;
use crate::zk_provider::ZkVerificationContext;
use eyre::{Context, Result};
use foundry_compilers::zksolc::input::StandardJsonCompilerInput;
Expand All @@ -9,7 +9,6 @@ pub struct ZksyncStandardJsonSource;
impl ZksyncSourceProvider for ZksyncStandardJsonSource {
fn zk_source(
&self,
_args: &VerifyArgs,
context: &ZkVerificationContext,
) -> Result<(StandardJsonCompilerInput, String)> {
let input = foundry_compilers::zksync::project_standard_json_input(
Expand All @@ -18,15 +17,13 @@ impl ZksyncSourceProvider for ZksyncStandardJsonSource {
)
.wrap_err("failed to get zksolc standard json")?;

// Extract the path relative to the project root
let relative_path = context
.target_path
.strip_prefix(context.project.root())
.unwrap_or(context.target_path.as_path())
.display()
.to_string();

// Ensure the path uses forward slashes consistently (handles Windows paths)
let normalized_path = relative_path.replace("\\", "/");

// Format the name as <path>/<file>:<contract_name>
Expand Down

0 comments on commit 1177466

Please sign in to comment.