From 5f949e0640b9bb2522f187c4639ef9edc075e6d9 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Wed, 13 Mar 2024 13:22:46 +0100 Subject: [PATCH] fix bug with stx amount integer overflow --- stacking/stacking.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacking/stacking.ts b/stacking/stacking.ts index c54020f..5260aa6 100644 --- a/stacking/stacking.ts +++ b/stacking/stacking.ts @@ -115,7 +115,7 @@ async function run() { async function stackStx(poxInfo: PoxInfo, account: Account) { // Bump min threshold by 50% to avoid getting stuck if threshold increases const minStx = Math.floor(poxInfo.next_cycle.min_threshold_ustx * 1.5); - const amountToStx = Math.round(minStx * account.targetSlots); + const amountToStx = BigInt(minStx) * BigInt(account.targetSlots); const authId = randInt(); const sigArgs = { topic: Pox4SignatureTopic.StackStx,