Skip to content

Commit

Permalink
Merge branch 'main' into feat-jrigada-paymaster-initial-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrigada authored Sep 24, 2024
2 parents e9f47dd + 082b6a3 commit f222c8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/cheatcodes/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,23 @@ impl Cheatcodes {
return None
}

if let Some(CreateScheme::Create) = input.scheme() {
let caller = input.caller();
let nonce = ecx
.inner
.journaled_state
.load_account(input.caller(), &mut ecx.inner.db)
.unwrap()
.0
.info
.nonce;
let address = caller.create(nonce);
if ecx.db.get_test_contract_address().map(|addr| address == addr).unwrap_or_default() {
info!("running create in EVM, instead of zkEVM (Test Contract) {:#?}", address);
return None
}
}

if input.init_code().0 == DEFAULT_CREATE2_DEPLOYER_CODE {
info!("running create in EVM, instead of zkEVM (DEFAULT_CREATE2_DEPLOYER_CODE)");
return None
Expand Down
1 change: 1 addition & 0 deletions crates/script/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl ScriptRunner {
let address = CALLER.create(self.executor.get_nonce(CALLER)?);
self.executor.backend_mut().set_test_contract(address);

self.executor.backend_mut().set_test_contract(address);
// Set the contracts initial balance before deployment, so it is available during the
// construction
self.executor.set_balance(address, self.evm_opts.initial_balance)?;
Expand Down

0 comments on commit f222c8f

Please sign in to comment.