Skip to content

Commit

Permalink
don't take 100% of balance (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eikix authored Apr 30, 2024
1 parent 21774a4 commit 2fbec79
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/eth_provider/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

Expand Down

0 comments on commit 2fbec79

Please sign in to comment.