Skip to content

Commit dc4fd5c

Browse files
round wei to avoid conv errors (#2864)
1 parent 9be7ad4 commit dc4fd5c

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)