From 244c5f407f743fb3bdfd743c56ff206bd41a7cf5 Mon Sep 17 00:00:00 2001 From: Jan Kuczma <63134918+JanKuczma@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:35:19 +0100 Subject: [PATCH] Verifiers as libraries with embedded keys (#31) --- contracts/Shielder.sol | 56 ++---------------- crates/halo2-verifier/src/generator.rs | 19 +++---- .../src/lib/verifier_contract.rs | 7 +-- .../templates/Halo2Verifier.sol | 4 +- .../src/shielder/calls/deposit_native.rs | 2 +- .../src/shielder/calls/new_account_native.rs | 2 +- .../src/shielder/calls/withdraw_native.rs | 2 +- .../integration-tests/src/shielder/deploy.rs | 57 ++++++++++++------- crates/integration-tests/src/verifier.rs | 35 +++--------- .../shielder-rust-sdk/src/contract/types.rs | 6 -- scripts/Shielder.s.sol | 47 +-------------- 11 files changed, 69 insertions(+), 168 deletions(-) diff --git a/contracts/Shielder.sol b/contracts/Shielder.sol index 88d5ec30..83a96daa 100644 --- a/contracts/Shielder.sol +++ b/contracts/Shielder.sol @@ -2,6 +2,9 @@ pragma solidity 0.8.26; +import { Halo2Verifier as NewAccountVerifier } from "./NewAccountVerifier.sol"; +import { Halo2Verifier as DepositVerifier } from "./DepositVerifier.sol"; +import { Halo2Verifier as WithdrawVerifier } from "./WithdrawVerifier.sol"; import { IArbSys } from "./IArbSys.sol"; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { MerkleTree } from "./MerkleTree.sol"; @@ -10,14 +13,6 @@ import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/P import { UIntSet } from "./UIntSet.sol"; import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -interface IVerifier { - function verifyProof( - address vk, - bytes calldata proof, - uint256[] calldata instances - ) external returns (bool); -} - /// @title Shielder /// @author CardinalCryptography contract Shielder is @@ -59,16 +54,6 @@ contract Shielder is 0x0000000000000000000000000000000000000064; IArbSys private arbSysPrecompile; - // verifier contracts - address public newAccountVerifier; - address public depositVerifier; - address public withdrawVerifier; - - // verification key contracts - address public newAccountVerifyingKey; - address public depositVerifyingKey; - address public withdrawVerifyingKey; - MerkleTree.MerkleTreeData public merkleTree; UIntSet.Set private merkleRoots; @@ -139,12 +124,6 @@ contract Shielder is function initialize( address initialOwner, - address _newAccountVerifier, - address _depositVerifier, - address _withdrawVerifier, - address _newAccountVerifyingKey, - address _depositVerifyingKey, - address _withdrawVerifyingKey, uint256 _depositLimit ) public initializer { __Ownable_init(initialOwner); @@ -155,14 +134,6 @@ contract Shielder is arbSysPrecompile = IArbSys(ARB_SYS_ADDRESS); - newAccountVerifier = _newAccountVerifier; - depositVerifier = _depositVerifier; - withdrawVerifier = _withdrawVerifier; - - newAccountVerifyingKey = _newAccountVerifyingKey; - depositVerifyingKey = _depositVerifyingKey; - withdrawVerifyingKey = _withdrawVerifyingKey; - depositLimit = _depositLimit; } @@ -206,12 +177,7 @@ contract Shielder is publicInputs[1] = idHash; publicInputs[2] = amount; - IVerifier _verifier = IVerifier(newAccountVerifier); - bool success = _verifier.verifyProof( - newAccountVerifyingKey, - proof, - publicInputs - ); + bool success = NewAccountVerifier.verifyProof(proof, publicInputs); if (!success) revert NewAccountVerificationFailed(); @@ -255,12 +221,7 @@ contract Shielder is publicInputs[3] = newNote; publicInputs[4] = amount; - IVerifier _verifier = IVerifier(depositVerifier); - bool success = _verifier.verifyProof( - depositVerifyingKey, - proof, - publicInputs - ); + bool success = DepositVerifier.verifyProof(proof, publicInputs); if (!success) revert DepositVerificationFailed(); @@ -316,12 +277,7 @@ contract Shielder is // @dev shifting right by 4 bits so the commitment is smaller from r publicInputs[5] = uint256(keccak256(commitment)) >> 4; - IVerifier _verifier = IVerifier(withdrawVerifier); - bool success = _verifier.verifyProof( - withdrawVerifyingKey, - proof, - publicInputs - ); + bool success = WithdrawVerifier.verifyProof(proof, publicInputs); if (!success) revert WithdrawVerificationFailed(); diff --git a/crates/halo2-verifier/src/generator.rs b/crates/halo2-verifier/src/generator.rs index 43e5b44c..e47c5c44 100644 --- a/crates/halo2-verifier/src/generator.rs +++ b/crates/halo2-verifier/src/generator.rs @@ -35,22 +35,21 @@ pub fn main() { ); } -/// Generate verification key and proving key contracts for the given circuit type. +/// Generate verifier contract for the given circuit type. fn handle_relation>(full_params: Params, relation: &str) { println!("Generating {relation} relation contracts..."); - let (verifier_solidity, vk_solidity) = generate_solidity_verification_bundle::(full_params); + let verifier_solidity = generate_solidity_verification_bundle::(full_params); save_contract_source(&format!("{relation}Verifier.sol"), &verifier_solidity); - save_contract_source(&format!("{relation}VerifyingKey.sol"), &vk_solidity); } -/// Given trusted setup, generate Solidity code for the verification key and the verifier. +/// Given trusted setup, generate Solidity code for the verifier with embedded verification key. fn generate_solidity_verification_bundle>( full_parameters: ParamsKZG, -) -> (String, String) { +) -> String { let (parameters, _, _, vk) = generate_keys_with_min_k::(full_parameters).expect("Failed to generate keys"); SolidityGenerator::new(¶meters, &vk, Bdfg21, PK::PublicInput::COUNT) - .render_separately() + .render() .expect("Failed to generate separate contracts") } @@ -99,7 +98,6 @@ mod test { /// Return an error if verifier fails on-chain. fn verify_with_contract( verifier_solidity: &str, - vk_solidity: &str, proof: &[u8], public_input: &[Fr], ) -> Result { @@ -107,10 +105,9 @@ mod test { // Deploy verifier and vk contracts let verifier_address = deploy_source_code(verifier_solidity, "Halo2Verifier", &mut evm); - let vk_address = deploy_source_code(vk_solidity, "Halo2VerifyingKey", &mut evm); // Call verifier contract - let calldata = verifier_contract::encode_calldata(vk_address, proof, public_input); + let calldata = verifier_contract::encode_calldata(proof, public_input); match evm.call(verifier_address, calldata, None, None) { Ok(SuccessResult { gas_used, output, .. @@ -130,7 +127,7 @@ mod test { let prover_knowledge = PK::random_correct_example(&mut rng); let public_input = prover_knowledge.serialize_public_input(); - let (verifier_solidity, vk_solidity) = + let verifier_solidity = generate_solidity_verification_bundle::(full_parameters.clone()); let (parameters, _, pk, _) = @@ -138,7 +135,7 @@ mod test { let circuit = prover_knowledge.create_circuit(); let proof = generate_proof(¶meters, &pk, circuit, &public_input, &mut rng); - let result = verify_with_contract(&verifier_solidity, &vk_solidity, &proof, &public_input); + let result = verify_with_contract(&verifier_solidity, &proof, &public_input); assert!(result.is_ok()); assert!(result.unwrap() <= cost_upper_bound); } diff --git a/crates/halo2-verifier/src/lib/verifier_contract.rs b/crates/halo2-verifier/src/lib/verifier_contract.rs index fb14d89a..23b3c148 100644 --- a/crates/halo2-verifier/src/lib/verifier_contract.rs +++ b/crates/halo2-verifier/src/lib/verifier_contract.rs @@ -1,21 +1,18 @@ #![allow(missing_docs)] -use alloy_primitives::Address; use alloy_sol_types::{private::Bytes, sol, SolCall}; use halo2_proofs::halo2curves::bn256::Fr; use shielder_rust_sdk::conversion::field_to_u256; sol! { function verifyProof( - address vk, bytes calldata proof, uint256[] calldata instances - ) public returns (bool); + ) public view returns (bool); } /// Encode proof into calldata to invoke `Halo2Verifier.verifyProof`. -pub fn encode_calldata(vk: Address, proof: &[u8], instances: &[Fr]) -> Vec { +pub fn encode_calldata(proof: &[u8], instances: &[Fr]) -> Vec { verifyProofCall { - vk, proof: Bytes::from(proof.to_vec()), instances: instances.iter().map(field_to_u256::).collect(), } diff --git a/crates/halo2-verifier/templates/Halo2Verifier.sol b/crates/halo2-verifier/templates/Halo2Verifier.sol index 96568abb..f96d1940 100644 --- a/crates/halo2-verifier/templates/Halo2Verifier.sol +++ b/crates/halo2-verifier/templates/Halo2Verifier.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.26; /* @dev: linter does not understand inline assembly */ /* solhint-disable no-unused-vars */ -contract Halo2Verifier { +library Halo2Verifier { uint256 internal constant PROOF_LEN_CPTR = {{ proof_cptr - 1 }}; uint256 internal constant PROOF_CPTR = {{ proof_cptr }}; uint256 internal constant NUM_INSTANCE_CPTR = {{ proof_cptr + (proof_len / 32) }}; @@ -80,7 +80,7 @@ contract Halo2Verifier { {%- endmatch %} bytes calldata proof, uint256[] calldata instances - ) public returns (bool) { + ) public view returns (bool) { assembly ("memory-safe") { // Read EC point (x, y) at (proof_cptr, proof_cptr + 0x20), // and check if the point is on affine plane, diff --git a/crates/integration-tests/src/shielder/calls/deposit_native.rs b/crates/integration-tests/src/shielder/calls/deposit_native.rs index c10a89a5..00d5f4d8 100644 --- a/crates/integration-tests/src/shielder/calls/deposit_native.rs +++ b/crates/integration-tests/src/shielder/calls/deposit_native.rs @@ -24,7 +24,7 @@ use crate::shielder::{ CallResult, }; -const GAS_CONSUMPTION: u64 = 1833173; +const GAS_CONSUMPTION: u64 = 1826239; pub fn prepare_call( deployment: &mut Deployment, diff --git a/crates/integration-tests/src/shielder/calls/new_account_native.rs b/crates/integration-tests/src/shielder/calls/new_account_native.rs index 16efb221..52efc9a0 100644 --- a/crates/integration-tests/src/shielder/calls/new_account_native.rs +++ b/crates/integration-tests/src/shielder/calls/new_account_native.rs @@ -17,7 +17,7 @@ use crate::shielder::{ CallResult, Deployment, }; -const GAS_CONSUMPTION: u64 = 2005642; +const GAS_CONSUMPTION: u64 = 1998654; pub fn prepare_call( deployment: &mut Deployment, diff --git a/crates/integration-tests/src/shielder/calls/withdraw_native.rs b/crates/integration-tests/src/shielder/calls/withdraw_native.rs index d955b2a9..a27c00c3 100644 --- a/crates/integration-tests/src/shielder/calls/withdraw_native.rs +++ b/crates/integration-tests/src/shielder/calls/withdraw_native.rs @@ -24,7 +24,7 @@ use crate::shielder::{ recipient_balance_increased_by, relayer_balance_increased_by, CallResult, }; -const GAS_CONSUMPTION: u64 = 1903378; +const GAS_CONSUMPTION: u64 = 1901269; struct PrepareCallArgs { amount: U256, diff --git a/crates/integration-tests/src/shielder/deploy.rs b/crates/integration-tests/src/shielder/deploy.rs index 8c00a49a..70f8ce64 100644 --- a/crates/integration-tests/src/shielder/deploy.rs +++ b/crates/integration-tests/src/shielder/deploy.rs @@ -23,7 +23,7 @@ use crate::{ unpause_shielder, }, token, - verifier::{deploy_verifiers_and_keys, VerificationContracts}, + verifier::deploy_verifiers, }; /// The address of the deployer account. @@ -83,6 +83,9 @@ pub fn prepare_account( /// Solc leaves this placeholder for a Poseidon2 contract address. const POSEIDON2_LIB_PLACEHOLDER: &str = "__$fa7e1b6d9a16949b5fb8159594c1e0b34c$__"; +const NEW_ACCOUNT_VERIFIER_LIB_PLACEHOLDER: &str = "__$96275be2429eed9b26a54836ed89b224a2$__"; +const DEPOSIT_VERIFIER_LIB_PLACEHOLDER: &str = "__$d586e7da5a0e0b714a5d44ed4e0f6a624d$__"; +const WITHDRAW_VERIFIER_LIB_PLACEHOLDER: &str = "__$06bb88608c3ade14b496e12c6067f182f6$__"; pub struct Deployment { pub evm: EvmRunner, @@ -112,10 +115,9 @@ pub fn deployment( Some(reverting_bytecode), ); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); let token = deploy_token(&mut evm, owner); let permit2 = deploy_permit2(&mut evm, owner); - let shielder_address = deploy_shielder_contract(verification_contracts, &mut evm, owner); + let shielder_address = deploy_shielder_contract(&mut evm, owner); unpause_shielder(shielder_address, &mut evm); instrument_token(&mut evm, owner, actor, token, permit2); @@ -191,14 +193,41 @@ fn deploy_shielder_implementation(evm: &mut EvmRunner) -> Address { let poseidon2_address = deploy_contract("Poseidon2T8Assembly.sol", "Poseidon2T8Assembly", evm).to_string(); + let verifiers = deploy_verifiers(evm); + // 3. Manipulate the Shielder implementation bytecode to replace the placeholders with the // corresponding contract addresses. let implementation_bytecode = String::from_utf8(implementation_bytecode).unwrap(); - let with_poseidon2 = implementation_bytecode.replace( - POSEIDON2_LIB_PLACEHOLDER, - poseidon2_address.strip_prefix("0x").unwrap(), - ); - let ready_bytecode = hex::decode(with_poseidon2).unwrap(); + let with_linked_libs = implementation_bytecode + .replace( + POSEIDON2_LIB_PLACEHOLDER, + poseidon2_address.strip_prefix("0x").unwrap(), + ) + .replace( + NEW_ACCOUNT_VERIFIER_LIB_PLACEHOLDER, + verifiers + .new_account_verifier + .to_string() + .strip_prefix("0x") + .unwrap(), + ) + .replace( + DEPOSIT_VERIFIER_LIB_PLACEHOLDER, + verifiers + .deposit_verifier + .to_string() + .strip_prefix("0x") + .unwrap(), + ) + .replace( + WITHDRAW_VERIFIER_LIB_PLACEHOLDER, + verifiers + .withdraw_verifier + .to_string() + .strip_prefix("0x") + .unwrap(), + ); + let ready_bytecode = hex::decode(with_linked_libs).unwrap(); // 4. Finally, deploy the Shielder implementation contract. evm.create(ready_bytecode, None) @@ -206,20 +235,10 @@ fn deploy_shielder_implementation(evm: &mut EvmRunner) -> Address { } /// Deploy Shielder contract using ERC 1967 proxy. -pub fn deploy_shielder_contract( - verification_contracts: VerificationContracts, - evm: &mut EvmRunner, - owner: Address, -) -> Address { +pub fn deploy_shielder_contract(evm: &mut EvmRunner, owner: Address) -> Address { let implementation_address = deploy_shielder_implementation(evm); let initialization_data = initializeCall { initialOwner: owner, - _newAccountVerifier: verification_contracts.new_account_verifier, - _depositVerifier: verification_contracts.deposit_verifier, - _withdrawVerifier: verification_contracts.withdraw_verifier, - _newAccountVerifyingKey: verification_contracts.new_account_vk, - _depositVerifyingKey: verification_contracts.deposit_vk, - _withdrawVerifyingKey: verification_contracts.withdraw_vk, _depositLimit: INITIAL_DEPOSIT_LIMIT, } .abi_encode(); diff --git a/crates/integration-tests/src/verifier.rs b/crates/integration-tests/src/verifier.rs index c4595871..06bd579e 100644 --- a/crates/integration-tests/src/verifier.rs +++ b/crates/integration-tests/src/verifier.rs @@ -11,50 +11,39 @@ use shielder_circuits::{ use crate::{deploy_contract, proving_utils}; const VERIFIER_CONTRACT_NAME: &str = "Halo2Verifier"; -const VK_CONTRACT_NAME: &str = "Halo2VerifyingKey"; #[derive(Copy, Clone)] pub struct VerificationContracts { pub new_account_verifier: Address, - pub new_account_vk: Address, pub deposit_verifier: Address, - pub deposit_vk: Address, pub withdraw_verifier: Address, - pub withdraw_vk: Address, } -pub fn deploy_verifiers_and_keys(evm: &mut EvmRunner) -> VerificationContracts { +pub fn deploy_verifiers(evm: &mut EvmRunner) -> VerificationContracts { let new_account_verifier = deploy_contract("NewAccountVerifier.sol", VERIFIER_CONTRACT_NAME, evm); - let new_account_vk = deploy_contract("NewAccountVerifyingKey.sol", VK_CONTRACT_NAME, evm); let deposit_verifier = deploy_contract("DepositVerifier.sol", VERIFIER_CONTRACT_NAME, evm); - let deposit_vk = deploy_contract("DepositVerifyingKey.sol", VK_CONTRACT_NAME, evm); let withdraw_verifier = deploy_contract("WithdrawVerifier.sol", VERIFIER_CONTRACT_NAME, evm); - let withdraw_vk = deploy_contract("WithdrawVerifyingKey.sol", VK_CONTRACT_NAME, evm); VerificationContracts { new_account_verifier, - new_account_vk, deposit_verifier, - deposit_vk, withdraw_verifier, - withdraw_vk, } } #[test] fn deploy_verification_contracts() { - deploy_verifiers_and_keys(&mut EvmRunner::aleph_evm()); + deploy_verifiers(&mut EvmRunner::aleph_evm()); } fn verify_with_contract( proof: Vec, pub_input: Vec, - vk_address: Address, verifier_address: Address, evm: &mut EvmRunner, ) -> bool { - let calldata = verifier_contract::encode_calldata(vk_address, &proof, &pub_input); + let calldata = verifier_contract::encode_calldata(&proof, &pub_input); let response = evm .call(verifier_address, calldata, None, None) .expect("Call failed") @@ -65,13 +54,12 @@ fn verify_with_contract( #[test] fn new_account_contract_verification_works() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); let (proof, pub_input) = proving_utils::prepare_proof::>(); assert!(verify_with_contract( proof, pub_input, - verification_contracts.new_account_vk, verification_contracts.new_account_verifier, &mut evm, )); @@ -80,14 +68,13 @@ fn new_account_contract_verification_works() { #[test] fn deposit_contract_verification_works() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); let (proof, pub_input) = proving_utils::prepare_proof::>(); assert!(verify_with_contract( proof, pub_input, - verification_contracts.deposit_vk, verification_contracts.deposit_verifier, &mut evm, )); @@ -96,14 +83,13 @@ fn deposit_contract_verification_works() { #[test] fn withdraw_contract_verification_works() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); let (proof, pub_input) = proving_utils::prepare_proof::>(); assert!(verify_with_contract( proof, pub_input, - verification_contracts.withdraw_vk, verification_contracts.withdraw_verifier, &mut evm, )); @@ -113,12 +99,11 @@ fn withdraw_contract_verification_works() { #[test] fn fails_on_empty_proof() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); assert!(!verify_with_contract( vec![], vec![], - verification_contracts.new_account_vk, verification_contracts.new_account_verifier, &mut evm, )); @@ -128,7 +113,7 @@ fn fails_on_empty_proof() { #[test] fn fails_on_proof_with_wrong_input() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); let (proof, mut pub_input) = proving_utils::prepare_proof::>(); pub_input[0] += Fr::from(1); @@ -136,7 +121,6 @@ fn fails_on_proof_with_wrong_input() { assert!(!verify_with_contract( proof, pub_input, - verification_contracts.new_account_vk, verification_contracts.new_account_verifier, &mut evm, )); @@ -146,7 +130,7 @@ fn fails_on_proof_with_wrong_input() { #[test] fn fails_on_corrupted_proof() { let mut evm = EvmRunner::aleph_evm(); - let verification_contracts = deploy_verifiers_and_keys(&mut evm); + let verification_contracts = deploy_verifiers(&mut evm); let (mut proof, pub_input) = proving_utils::prepare_proof::>(); proof[0] = proof[0].wrapping_add(1u8); @@ -154,7 +138,6 @@ fn fails_on_corrupted_proof() { assert!(!verify_with_contract( proof, pub_input, - verification_contracts.new_account_vk, verification_contracts.new_account_verifier, &mut evm, )); diff --git a/crates/shielder-rust-sdk/src/contract/types.rs b/crates/shielder-rust-sdk/src/contract/types.rs index 16aea6fe..fd10ff88 100644 --- a/crates/shielder-rust-sdk/src/contract/types.rs +++ b/crates/shielder-rust-sdk/src/contract/types.rs @@ -61,12 +61,6 @@ sol! { function initialize( address initialOwner, - address _newAccountVerifier, - address _depositVerifier, - address _withdrawVerifier, - address _newAccountVerifyingKey, - address _depositVerifyingKey, - address _withdrawVerifyingKey, uint256 _depositLimit ) public; diff --git a/scripts/Shielder.s.sol b/scripts/Shielder.s.sol index 44fb0f98..a913641d 100644 --- a/scripts/Shielder.s.sol +++ b/scripts/Shielder.s.sol @@ -5,12 +5,6 @@ pragma solidity ^0.8.14; import { Script, console2 } from "forge-std/src/Script.sol"; import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import { Halo2Verifier as NewAccountVerifier } from "../contracts/NewAccountVerifier.sol"; -import { Halo2VerifyingKey as NewAccountVerifyingKey } from "../contracts/NewAccountVerifyingKey.sol"; -import { Halo2Verifier as DepositVerifier } from "../contracts/DepositVerifier.sol"; -import { Halo2VerifyingKey as DepositVerifyingKey } from "../contracts/DepositVerifyingKey.sol"; -import { Halo2Verifier as WithdrawVerifier } from "../contracts/WithdrawVerifier.sol"; -import { Halo2VerifyingKey as WithdrawVerifyingKey } from "../contracts/WithdrawVerifyingKey.sol"; import { Shielder } from "../contracts/Shielder.sol"; /* solhint-disable no-console */ @@ -23,36 +17,6 @@ contract DeployShielderScript is Script { vm.startBroadcast(privateKey); - NewAccountVerifier newAccountVerifier = new NewAccountVerifier(); - console2.log( - "NewAccountVerifier deployed at:", - address(newAccountVerifier) - ); - NewAccountVerifyingKey newAccountVerifyingKey = new NewAccountVerifyingKey(); - console2.log( - "NewAccountVerifyingKey deployed at:", - address(newAccountVerifyingKey) - ); - - DepositVerifier depositVerifier = new DepositVerifier(); - console2.log("DepositVerifier deployed at:", address(depositVerifier)); - DepositVerifyingKey depositVerifyingKey = new DepositVerifyingKey(); - console2.log( - "DepositVerifyingKey deployed at:", - address(depositVerifyingKey) - ); - - WithdrawVerifier withdrawVerifier = new WithdrawVerifier(); - console2.log( - "WithdrawVerifier deployed at:", - address(withdrawVerifier) - ); - WithdrawVerifyingKey withdrawVerifyingKey = new WithdrawVerifyingKey(); - console2.log( - "WithdrawVerifyingKey deployed at:", - address(withdrawVerifyingKey) - ); - address shielderImplementation = address(new Shielder()); console2.log( @@ -62,16 +26,7 @@ contract DeployShielderScript is Script { bytes memory data = abi.encodeCall( Shielder.initialize, - ( - owner, - address(newAccountVerifier), - address(depositVerifier), - address(withdrawVerifier), - address(newAccountVerifyingKey), - address(depositVerifyingKey), - address(withdrawVerifyingKey), - type(uint256).max - ) + (owner, type(uint256).max) ); address proxy = address(new ERC1967Proxy(shielderImplementation, data));