Skip to content

Commit e81fcec

Browse files
committed
Merge branch 'upstream-59f354c' of github.com:matter-labs/foundry-zksync into upstream-59f354c
2 parents d3cb0fc + 0e5ad05 commit e81fcec

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

crates/cheatcodes/assets/cheatcodes.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/evm/core/src/utils.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,13 @@ pub fn create2_handler_register<I: InspectorExt>(
217217
let mut code_hash = ctx.evm.load_account(create2_deployer)?.info.code_hash;
218218
// NOTE(zk): We check which deployer we are using to separate the logic for zkSync
219219
// and original foundry.
220+
// TODO(zk): adding this check to skip comparing to evm create2 deployer
221+
// hash, should we compare vs zkevm one?
222+
let mut zk_is_create2_deployer = false;
220223
if call_inputs.target_address == DEFAULT_CREATE2_DEPLOYER_ZKSYNC {
221224
code_hash = ctx.evm.load_account(call_inputs.target_address)?.info.code_hash;
222-
};
225+
zk_is_create2_deployer = true;
226+
}
223227
if code_hash == KECCAK_EMPTY {
224228
return Ok(FrameOrResult::Result(FrameResult::Call(CallOutcome {
225229
result: InterpreterResult {
@@ -229,7 +233,7 @@ pub fn create2_handler_register<I: InspectorExt>(
229233
},
230234
memory_offset: 0..0,
231235
})))
232-
} else if code_hash != DEFAULT_CREATE2_DEPLOYER_CODEHASH {
236+
} else if code_hash != DEFAULT_CREATE2_DEPLOYER_CODEHASH && !zk_is_create2_deployer {
233237
return Ok(FrameOrResult::Result(FrameResult::Call(CallOutcome {
234238
result: InterpreterResult {
235239
result: InstructionResult::Revert,

crates/forge/tests/it/test_helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ impl ForgeTestProfile {
203203
zk_config.zksync.optimizer_mode = '3';
204204
zk_config.zksync.zksolc = Some(foundry_config::SolcReq::Version(Version::new(1, 5, 7)));
205205
zk_config.fuzz.no_zksync_reserved_addresses = true;
206+
zk_config.invariant.depth = 15;
206207

207208
zk_config
208209
}

crates/zksync/compilers/src/artifacts/contract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Contract {
9090

9191
// CompactContract variants
9292
// TODO: for zkEvm, the distinction between bytecode and deployed_bytecode makes little sense,
93-
// and there some fields that the ouptut doesn't provide (e.g: source_map)
93+
// and there some fields that the output doesn't provide (e.g: source_map)
9494
// However, we implement these because we get the Artifact trait and can reuse lots of
9595
// the crate's helpers without needing to duplicate everything. Maybe there's a way
9696
// we can get all these without having to add the same bytecode twice on each struct.

crates/zksync/compilers/src/compilers/artifact_output/zk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl ZkContractArtifact {
6363

6464
// CompactContract variants
6565
// TODO: for zkEvm, the distinction between bytecode and deployed_bytecode makes little sense,
66-
// and there some fields that the ouptut doesn't provide (e.g: source_map)
66+
// and there some fields that the output doesn't provide (e.g: source_map)
6767
// However, we implement these because we get the Artifact trait and can reuse lots of
6868
// the crate's helpers without needing to duplicate everything. Maybe there's a way
6969
// we can get all these without having to add the same bytecode twice on each struct.

crates/zksync/compilers/src/compilers/zksolc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ fn compiler_blocking_install(
653653
let _lock = try_lock_file(lock_path)?;
654654
trace!("got lock for {label}");
655655

656-
// Only write to file if it is not there. The check is doneafter adquiring the lock
656+
// Only write to file if it is not there. The check is done after acquiring the lock
657657
// to ensure the thread remains blocked until the required compiler is
658658
// fully installed
659659
if !compiler_path.exists() {
@@ -679,7 +679,7 @@ fn compiler_blocking_install(
679679
response.status()
680680
)));
681681
}
682-
trace!("{label} instalation completed");
682+
trace!("{label} installation completed");
683683
Ok(compiler_path)
684684
})
685685
}

0 commit comments

Comments
 (0)