From d51c5efb57f53935582b34dad44327f56ca38726 Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Mon, 22 Jul 2024 17:50:40 +0200 Subject: [PATCH] fix: add factory_deps to estimate_gas (#486) --- crates/script/src/broadcast.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index 102f4f4ea..f93418053 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -120,6 +120,17 @@ pub async fn send_transaction( // Chains which use `eth_estimateGas` are being sent sequentially and require their // gas to be re-estimated right before broadcasting. if !is_fixed_gas_limit && estimate_via_rpc { + // manually add factory_deps to estimate_gas + if let Some(zk) = zk { + tx.other.insert( + "eip712Meta".into(), + serde_json::to_value(&Eip712Meta { + factory_deps: zk.factory_deps.clone(), + ..Default::default() + }) + .expect("failed serializing json"), + ); + } estimate_gas(&mut tx, &provider, estimate_multiplier).await?; }