From 9bb233c9aaee260d426101d7a31121785352ad5f Mon Sep 17 00:00:00 2001 From: Tejas Badadare Date: Thu, 17 Jul 2025 20:18:40 -0700 Subject: [PATCH] round wei to avoid conv errors --- contract_manager/scripts/transfer_balance_entropy_chains.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contract_manager/scripts/transfer_balance_entropy_chains.ts b/contract_manager/scripts/transfer_balance_entropy_chains.ts index bb26bf09f0..251e6658b7 100644 --- a/contract_manager/scripts/transfer_balance_entropy_chains.ts +++ b/contract_manager/scripts/transfer_balance_entropy_chains.ts @@ -160,6 +160,9 @@ async function transferOnChain( transferAmountEth = (balanceEth - gasCostEth) * transferRatio!; } + // Round to 10 decimal places to avoid Web3 conversion errors + transferAmountEth = Math.round(transferAmountEth * 1e10) / 1e10; + // Validate transfer amount if (transferAmountEth <= 0) { console.log(