Skip to content

Commit 9bb233c

Browse files
committed
round wei to avoid conv errors
1 parent 366badb commit 9bb233c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contract_manager/scripts/transfer_balance_entropy_chains.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ async function transferOnChain(
160160
transferAmountEth = (balanceEth - gasCostEth) * transferRatio!;
161161
}
162162

163+
// Round to 10 decimal places to avoid Web3 conversion errors
164+
transferAmountEth = Math.round(transferAmountEth * 1e10) / 1e10;
165+
163166
// Validate transfer amount
164167
if (transferAmountEth <= 0) {
165168
console.log(

0 commit comments

Comments
 (0)