From 2fbec794b6a4750fcd4a5a2c3bf0861e686ba6eb Mon Sep 17 00:00:00 2001 From: Elias Tazartes <66871571+Eikix@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:25:28 +0200 Subject: [PATCH] don't take 100% of balance (#1037) --- src/eth_provider/provider.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eth_provider/provider.rs b/src/eth_provider/provider.rs index 92f470fbf..023c85ea1 100644 --- a/src/eth_provider/provider.rs +++ b/src/eth_provider/provider.rs @@ -518,6 +518,7 @@ where let eth_fees = eth_fees_per_gas.saturating_mul(transaction_signed.gas_limit()); let balance = self.balance(signer, None).await?; let max_fee: u64 = balance.try_into().unwrap_or(u64::MAX); + let max_fee = (max_fee as u128 * 80 / 100) as u64; max_fee.saturating_sub(eth_fees) };