Skip to content

Commit

Permalink
chore: cleanup & todos
Browse files Browse the repository at this point in the history
  • Loading branch information
Karrq committed Apr 11, 2024
1 parent 36f32f7 commit 96bcb0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/cheatcodes/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl Cheatcode for zkRegisterContractCall {
name: name.clone(),
zk_bytecode_hash: zkBytecodeHash.0.into(),
zk_deployed_bytecode: zkDeployedBytecode.clone(),
//TODO: add argument to cheatcode
zk_factory_deps: vec![],
evm_bytecode_hash: *evmBytecodeHash,
evm_deployed_bytecode: evmDeployedBytecode.clone(),
Expand Down
9 changes: 4 additions & 5 deletions crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use ethers_core::{
use ethers_middleware::SignerMiddleware;
use ethers_providers::Middleware;
use eyre::{Context, Result};
use forge::revm::primitives::bitvec::vec;
use foundry_cli::{
opts::{CoreBuildArgs, EthereumOpts, EtherscanOpts, TransactionOpts},
utils::{self, read_constructor_args_file, remove_contract, LoadConfig},
Expand All @@ -26,7 +25,7 @@ use foundry_common::{
types::{ToAlloy, ToEthers},
};
use foundry_compilers::{
artifacts::{contract, BytecodeObject, CompactBytecode},
artifacts::{BytecodeObject, CompactBytecode},
info::ContractInfo,
utils::canonicalized,
};
Expand All @@ -37,7 +36,6 @@ use foundry_zksync_compiler::{
use serde_json::json;
use std::{
borrow::Borrow,
collections::{HashSet, VecDeque},
marker::PhantomData,
path::PathBuf,
sync::Arc,
Expand Down Expand Up @@ -157,12 +155,13 @@ impl CreateArgs {
source_map: Default::default(),
};

//TODO: restore `--factory-deps` handling? (+ lookup)
// or remove flag entirely?
let factory_deps = dual_compiled_contracts
.fetch_all_factory_deps(&contract)
.fetch_all_factory_deps(contract)
.into_iter()
.collect::<Vec<_>>();

println!("Total Factory Deps: {:?}", factory_deps.len());
(abi, zk_bin, Some((contract, factory_deps)))
} else {
(abi, bin, None)
Expand Down
1 change: 1 addition & 0 deletions crates/forge/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ pub async fn runner_with_config_and_zk(mut config: Config) -> MultiContractRunne
name: contract_name,
zk_bytecode_hash: packed_bytecode.bytecode_hash(),
zk_deployed_bytecode: packed_bytecode.bytecode(),
zk_factory_deps: packed_bytecode.factory_deps(),
evm_bytecode_hash: keccak256(solc_deployed_bytecode),
evm_bytecode: solc_bytecode.to_vec(),
evm_deployed_bytecode: solc_deployed_bytecode.to_vec(),
Expand Down
2 changes: 1 addition & 1 deletion crates/zksync/core/src/vm/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
let caller = env.tx.caller;
let calldata = encode_create_params(&call.scheme, contract.zk_bytecode_hash, constructor_input);
let factory_deps =
dual_compiled_contracts.fetch_all_factory_deps(&contract).into_iter().collect();
dual_compiled_contracts.fetch_all_factory_deps(contract).into_iter().collect();
let nonce = ZKVMData::new(db, journaled_state).get_tx_nonce(caller);

let (gas_limit, max_fee_per_gas) = gas_params(env, db, journaled_state, caller);
Expand Down

0 comments on commit 96bcb0e

Please sign in to comment.