Skip to content

Commit 8e5292a

Browse files
committed
fix: remove duplicate code - reuse calc-claimable-amount
1 parent 55873fe commit 8e5292a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

stackslib/src/chainstate/stacks/boot/sip-031.clar

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,7 @@
4545
(define-public (claim)
4646
(let
4747
(
48-
(balance (stx-get-balance (as-contract tx-sender)))
49-
(total-vested (calc-total-vested burn-block-height))
50-
;; Portion of the initial mint that is *still* locked (not yet vested)
51-
(reserved (- INITIAL_MINT_AMOUNT total-vested))
52-
;; Free balance = everything the caller may withdraw right now
53-
(claimable
54-
(if (> balance reserved)
55-
(- balance reserved)
56-
u0))
48+
(claimable (calc-claimable-amount burn-block-height))
5749
)
5850
(try! (validate-caller))
5951
(asserts! (> claimable u0) (err ERR_NOTHING_TO_CLAIM))

0 commit comments

Comments
 (0)