Skip to content

Commit

Permalink
Encode correctly paymaster input
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrigada committed Dec 2, 2024
1 parent 27360d4 commit 6f54a56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/cli/src/opts/build/zksync.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashSet, path::PathBuf};

use alloy_primitives::{Address, Bytes};
use alloy_primitives::{hex, Address, Bytes};
use clap::Parser;
use foundry_compilers::zksolc::settings::{ZkSolcError, ZkSolcWarning};
use foundry_config::ZkSyncConfig;
Expand Down Expand Up @@ -115,7 +115,8 @@ pub struct ZkSyncArgs {
#[clap(
long = "zk-paymaster-input",
value_name = "PAYMASTER_INPUT",
visible_alias = "paymaster-input"
visible_alias = "paymaster-input",
value_parser = parse_hex_bytes
)]
pub paymaster_input: Option<Bytes>,

Expand Down Expand Up @@ -185,3 +186,7 @@ impl ZkSyncArgs {
zksync
}
}

fn parse_hex_bytes(s: &str) -> Result<Bytes, String> {
hex::decode(s).map(Bytes::from).map_err(|e| format!("Invalid hex string: {e}"))
}

0 comments on commit 6f54a56

Please sign in to comment.