Skip to content

Commit

Permalink
feat: support suppressed warnings/errors for zksolc
Browse files Browse the repository at this point in the history
  • Loading branch information
elfedy committed Nov 4, 2024
1 parent 953a180 commit 5c2e7e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions crates/config/src/zksync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ use foundry_compilers::{
solc::CliSettings,
zksolc::{
settings::{
BytecodeHash, Codegen, Optimizer, OptimizerDetails, SettingsMetadata, ZkSolcSettings,
BytecodeHash, Codegen, Optimizer, OptimizerDetails, SettingsMetadata, ZkSolcError,
ZkSolcSettings, ZkSolcWarning,
},
ZkSettings,
},
};

use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::{collections::HashSet, path::PathBuf};

use crate::SolcReq;

Expand Down Expand Up @@ -59,8 +60,14 @@ pub struct ZkSyncConfig {
/// The optimization mode string for zkSync
pub optimizer_mode: char,

/// zkSolc optimizer details
/// zksolc optimizer details
pub optimizer_details: Option<OptimizerDetails>,

/// zksolc suppressed errors
pub suppressed_warnings: HashSet<ZkSolcWarning>,

/// zksolc suppressed warnings
pub suppressed_errors: HashSet<ZkSolcError>,
}

impl Default for ZkSyncConfig {
Expand All @@ -80,6 +87,8 @@ impl Default for ZkSyncConfig {
optimizer: true,
optimizer_mode: '3',
optimizer_details: Default::default(),
suppressed_warnings: Default::default(),
suppressed_errors: Default::default(),
}
}
}
Expand Down Expand Up @@ -130,6 +139,8 @@ impl ZkSyncConfig {
},
},
codegen: if self.force_evmla { Codegen::EVMLA } else { Codegen::Yul },
suppressed_warnings: self.suppressed_warnings.clone(),
suppressed_errors: self.suppressed_errors.clone(),
};

// `cli_settings` get set from `Project` values when building `ZkSolcVersionedInput`
Expand Down

0 comments on commit 5c2e7e8

Please sign in to comment.