Skip to content

Commit 75001b3

Browse files
committed
fix: uppercase constant DEPLOY_BLOCK_HEIGHT
1 parent d9e0d50 commit 75001b3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

contrib/core-contract-tests/tests/clarigen-types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4610,6 +4610,11 @@ export const contracts = {
46104610
},
46114611
maps: {},
46124612
variables: {
4613+
DEPLOY_BLOCK_HEIGHT: {
4614+
name: "DEPLOY_BLOCK_HEIGHT",
4615+
type: "uint128",
4616+
access: "constant",
4617+
} as TypedAbiVariable<bigint>,
46134618
ERR_NOTHING_TO_CLAIM: {
46144619
name: "ERR_NOTHING_TO_CLAIM",
46154620
type: "uint128",
@@ -4650,18 +4655,14 @@ export const contracts = {
46504655
type: "uint128",
46514656
access: "constant",
46524657
} as TypedAbiVariable<bigint>,
4653-
deployBlockHeight: {
4654-
name: "deploy-block-height",
4655-
type: "uint128",
4656-
access: "constant",
4657-
} as TypedAbiVariable<bigint>,
46584658
recipient: {
46594659
name: "recipient",
46604660
type: "principal",
46614661
access: "variable",
46624662
} as TypedAbiVariable<string>,
46634663
},
46644664
constants: {
4665+
DEPLOY_BLOCK_HEIGHT: 3n,
46654666
ERR_NOTHING_TO_CLAIM: 102n,
46664667
ERR_NOT_ALLOWED: 101n,
46674668
INITIAL_MINT_AMOUNT: 200_000_000_000_000n,
@@ -4670,7 +4671,6 @@ export const contracts = {
46704671
INITIAL_MINT_VESTING_ITERATIONS: 24n,
46714672
INITIAL_MINT_VESTING_ITERATION_BLOCKS: 4_383n,
46724673
STX_PER_ITERATION: 4_166_666_666_666n,
4673-
deployBlockHeight: 3n,
46744674
recipient: "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM",
46754675
},
46764676
non_fungible_tokens: [],

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
;; The amount of STX that is vested per iteration
2020
(define-constant STX_PER_ITERATION (/ INITIAL_MINT_VESTING_AMOUNT INITIAL_MINT_VESTING_ITERATIONS))
2121

22-
(define-data-var recipient principal tx-sender)
23-
2422
;; The block height at which vesting starts. On Mainnet, this is
2523
;; burn height 907740, which is what is specified in SIP-031.
26-
(define-constant deploy-block-height (if is-in-mainnet u907740 burn-block-height))
24+
(define-constant DEPLOY_BLOCK_HEIGHT (if is-in-mainnet u907740 burn-block-height))
25+
26+
(define-data-var recipient principal tx-sender)
2727

2828
(define-read-only (get-recipient) (var-get recipient))
2929

30-
(define-read-only (get-deploy-block-height) deploy-block-height)
30+
(define-read-only (get-deploy-block-height) DEPLOY_BLOCK_HEIGHT)
3131

3232
;; Update the recipient of the funds.
3333
;;
@@ -64,7 +64,7 @@
6464
(define-private (calc-total-vested (burn-height uint))
6565
(let
6666
(
67-
(diff (- burn-height deploy-block-height))
67+
(diff (- burn-height DEPLOY_BLOCK_HEIGHT))
6868
;; Note: this rounds down
6969
(iterations (/ diff INITIAL_MINT_VESTING_ITERATION_BLOCKS))
7070
(vested-multiple (* STX_PER_ITERATION iterations))
@@ -83,7 +83,7 @@
8383

8484
;; Returns the amount of STX that is claimable from the vested balance at `burn-height`
8585
(define-read-only (calc-claimable-amount (burn-height uint))
86-
(if (< burn-height deploy-block-height)
86+
(if (< burn-height DEPLOY_BLOCK_HEIGHT)
8787
u0
8888
(let
8989
(

0 commit comments

Comments
 (0)