Skip to content

Commit

Permalink
fix bug with stx amount integer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed Mar 13, 2024
1 parent 301f267 commit 5f949e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stacking/stacking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5f949e0

Please sign in to comment.