mirror of
https://github.com/zhigang1992/liquid-stacking.git
synced 2026-01-12 22:48:34 +08:00
Merge branch 'main' into ci
This commit is contained in:
@@ -235,6 +235,10 @@ epoch = 2.4
|
||||
path = "contracts/regtest-boot.clar"
|
||||
epoch = 2.4
|
||||
|
||||
[contracts.simnet-boot]
|
||||
path = "contracts/simnet-boot.clar"
|
||||
epoch = 2.4
|
||||
|
||||
[contracts.amm-swap-pool-v1-1]
|
||||
path = "contracts_modules/alex_v1/pool/amm-swap-pool-v1-1.clar"
|
||||
depends_on = ["trait-ownable", "trait-sip-010", "token-amm-swap-pool-v1-1"]
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;;
|
||||
;; lqstx-mint-registry
|
||||
;;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-public (execute (sender principal))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;;
|
||||
;; lqstx-mint-endpoint
|
||||
;;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait rebase-strategy-trait
|
||||
(
|
||||
(rebase () (response uint uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(use-trait strategy-trait .strategy-trait.strategy-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u3000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;;
|
||||
;; lqstx-mint-endpoint-v1-01
|
||||
;;
|
||||
@@ -19,8 +22,13 @@
|
||||
(define-data-var mint-delay uint u432) ;; mint available 3 day after cycle starts
|
||||
|
||||
;; corresponds to `first-burnchain-block-height` and `pox-reward-cycle-length` in pox-3
|
||||
(define-data-var activation-burn-block uint u666050)
|
||||
(define-data-var reward-cycle-length uint u2100)
|
||||
;; __IF_MAINNET__
|
||||
(define-constant pox-info (unwrap-panic (contract-call? 'SP000000000000000000002Q6VF78.pox-3 get-pox-info)))
|
||||
(define-constant activation-burn-block (get first-burnchain-block-height pox-info))
|
||||
(define-constant reward-cycle-length (get reward-cycle-length pox-info))
|
||||
;; (define-constant activation-burn-block u0)
|
||||
;; (define-constant reward-cycle-length u200)
|
||||
;; __ENDIF__
|
||||
|
||||
(define-data-var use-whitelist bool false)
|
||||
(define-map whitelisted principal bool)
|
||||
@@ -74,12 +82,12 @@
|
||||
(ok { vaulted-amount: vaulted-amount, request-id-idx: request-id-idx })))
|
||||
|
||||
(define-read-only (get-reward-cycle (burn-block uint))
|
||||
(if (>= burn-block (var-get activation-burn-block))
|
||||
(some (/ (- burn-block (var-get activation-burn-block)) (var-get reward-cycle-length)))
|
||||
(if (>= burn-block activation-burn-block)
|
||||
(some (/ (- burn-block activation-burn-block) reward-cycle-length))
|
||||
none))
|
||||
|
||||
(define-read-only (get-first-burn-block-in-reward-cycle (reward-cycle uint))
|
||||
(+ (var-get activation-burn-block) (* (var-get reward-cycle-length) reward-cycle)))
|
||||
(+ activation-burn-block (* reward-cycle-length reward-cycle)))
|
||||
|
||||
(define-read-only (get-mint-delay)
|
||||
(var-get mint-delay))
|
||||
@@ -161,16 +169,6 @@
|
||||
(try! (is-dao-or-extension))
|
||||
(ok (var-set mint-delay new-delay))))
|
||||
|
||||
(define-public (set-activation-burn-block (new-activation-burn-block uint))
|
||||
(begin
|
||||
(try! (is-dao-or-extension))
|
||||
(ok (var-set activation-burn-block new-activation-burn-block))))
|
||||
|
||||
(define-public (set-reward-cycle-length (new-reward-cycle-length uint))
|
||||
(begin
|
||||
(try! (is-dao-or-extension))
|
||||
(ok (var-set reward-cycle-length new-reward-cycle-length))))
|
||||
|
||||
;; privileged calls
|
||||
|
||||
(define-public (finalize-mint (request-id uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;; This contract holds the STX of the members
|
||||
|
||||
(use-trait strategy-trait .strategy-trait.strategy-trait)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(use-trait proposal-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-constant err-unauthorised (err u3000))
|
||||
|
||||
(define-map authorised-managers principal bool)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(use-trait proxy-trait .proxy-trait.proxy-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(use-trait proxy-trait .proxy-trait.proxy-trait)
|
||||
(use-trait sip-010-transferable-trait .sip-010-transferable-trait.sip-010-transferable-trait)
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;; lisa dao
|
||||
|
||||
(use-trait proposal-trait .proposal-trait.proposal-trait)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-public (execute (sender principal))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
|
||||
(define-map authorised-managers principal bool)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .strategy-trait.strategy-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-constant PENDING 0x00)
|
||||
(define-constant FINALIZED 0x01)
|
||||
(define-constant REVOKED 0x02)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .trait-sip-010.sip-010-trait)
|
||||
|
||||
(define-fungible-token wlqstx)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proxy-trait.proxy-trait)
|
||||
|
||||
(define-constant err-invalid-payload (err u4000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proxy-trait.proxy-trait)
|
||||
|
||||
(define-constant err-invalid-payload (err u4000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proxy-trait.proxy-trait)
|
||||
|
||||
(define-constant err-invalid-payload (err u4000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proxy-trait.proxy-trait)
|
||||
|
||||
(define-constant err-invalid-payload (err u4000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-public (execute (sender principal))
|
||||
@@ -17,12 +20,11 @@
|
||||
{operator: tx-sender, enabled: true}
|
||||
{operator: 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM, enabled: true}
|
||||
{operator: 'ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND, enabled: true}
|
||||
{operator: 'ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB, enabled: true}
|
||||
)))
|
||||
(try! (contract-call? .operators set-proposal-threshold 2))
|
||||
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-paused false))
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-activation-burn-block u0))
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-reward-cycle-length u200))
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-mint-delay u14))
|
||||
(try! (contract-call? .mock-strategy-manager set-authorised-manager 'ST2QXSK64YQX3CQPC530K79XWQ98XFAM9W3XKEH3N true))
|
||||
(try! (contract-call? .mock-strategy-manager set-authorised-manager 'ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND true))
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
|
||||
(define-constant PENDING 0x00)
|
||||
(define-constant FINALIZED 0x01)
|
||||
(define-constant REVOKED 0x02)
|
||||
|
||||
63
contracts/simnet-boot.clar
Normal file
63
contracts/simnet-boot.clar
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-public (execute (sender principal))
|
||||
(begin
|
||||
(try! (contract-call? .lisa-dao set-extensions (list
|
||||
{ extension: .lqstx-mint-endpoint, enabled: false }
|
||||
{ extension: .lqstx-mint-endpoint-v1-01, enabled: true }
|
||||
{ extension: .lqstx-vault, enabled: true }
|
||||
{ extension: .treasury, enabled: true }
|
||||
{ extension: .token-vesting, enabled: true }
|
||||
{ extension: .public-pools-strategy-manager, enabled: true }
|
||||
{ extension: .lisa-rebase, enabled: true }
|
||||
{ extension: .rebase-1, enabled: true }
|
||||
{ extension: .operators, enabled: true }
|
||||
)))
|
||||
|
||||
;; Set initial operators
|
||||
(try! (contract-call? .operators set-operators (list
|
||||
;; three from ALEX
|
||||
{ operator: 'SP3BQ65DRM8DMTYDD5HWMN60EYC0JFS5NC2V5CWW7, enabled: true }
|
||||
{ operator: 'SPHFAXDZVFHMY8YR3P9J7ZCV6N89SBET203ZAY25, enabled: true }
|
||||
{ operator: 'SPSZ26REB731JN8H00TD010S600F4AB4Z8F0JRB7, enabled: true }
|
||||
;; three from Ryder/FAST Pool
|
||||
{ operator: 'SP12BFYTH3NJ6N63KE0S50GHSYV0M91NGQND2B704, enabled: true }
|
||||
{ operator: 'SP1ZPTDQ3801C1AYEZ37NJWNDZ3HM60HC2TCFP228, enabled: true }
|
||||
{ operator: 'SPGAB1P3YV109E22KXFJYM63GK0G21BYX50CQ80B, enabled: true }
|
||||
)))
|
||||
;; Set operator signal threshold, i.e. 4-of-6
|
||||
(try! (contract-call? .operators set-proposal-threshold 4))
|
||||
|
||||
;; Set initial strategy managers, sender is the deployer
|
||||
;; TODO add manager
|
||||
(try! (contract-call? .public-pools-strategy-manager set-authorised-manager sender true))
|
||||
|
||||
;; Mint max LISA token supply (1bn)
|
||||
(try! (contract-call? .token-lisa dao-mint-many (list
|
||||
{ recipient: .treasury, amount: u1000000000000000 }
|
||||
)))
|
||||
|
||||
;; Enable whitelist
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-use-whitelist false))
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-whitelisted-many
|
||||
(list
|
||||
'SP3BQ65DRM8DMTYDD5HWMN60EYC0JFS5NC2V5CWW7
|
||||
'SP2VZBR9GCVM33BN0WXA05VJP6QV7CJ3Z3SQKJ5HH
|
||||
'SP12BFYTH3NJ6N63KE0S50GHSYV0M91NGQND2B704
|
||||
'SPGAB1P3YV109E22KXFJYM63GK0G21BYX50CQ80B
|
||||
'SPFJVM9Y1A4KJ31T8ZBDESZH36YGPDAZ9WXEFC53
|
||||
)
|
||||
(list
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
)))
|
||||
(try! (contract-call? .lqstx-mint-endpoint-v1-01 set-paused false))
|
||||
(ok true)
|
||||
)
|
||||
)
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-constant err-unauthorised (err u5000))
|
||||
|
||||
(as-contract (contract-call? 'SP000000000000000000002Q6VF78.pox-3 allow-contract-caller 'SP21YTSM60CAY6D011EZVEVNKXVW8FVZE198XEFFP.pox-fast-pool-v2 none))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .strategy-trait.strategy-trait)
|
||||
|
||||
(define-constant err-not-vault-caller (err u2000))
|
||||
@@ -90,7 +93,8 @@
|
||||
)
|
||||
|
||||
(define-private (get-member-balance-iter (member <pool-member>) (accumulator uint))
|
||||
(+ (stx-get-balance (contract-of member)) accumulator)
|
||||
(let ((member-account (stx-account (contract-of member))))
|
||||
(+ (get locked member-account) (get unlocked member-account) accumulator))
|
||||
)
|
||||
|
||||
(define-read-only (get-total-member-balances)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-constant err-unauthorised (err u5000))
|
||||
|
||||
(define-data-var pool-reward-pox-addr
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .sip-010-trait.sip-010-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u3000))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;; lqstx
|
||||
;;
|
||||
|
||||
@@ -41,7 +44,9 @@
|
||||
(define-public (set-reserve (new-reserve uint))
|
||||
(begin
|
||||
(try! (is-dao-or-extension))
|
||||
(ok (var-set reserve new-reserve))))
|
||||
(var-set reserve new-reserve)
|
||||
(print {notification: "rebase", payload: {reserve: (var-get reserve), total-shares: (ft-get-supply lqstx)}})
|
||||
(ok true)))
|
||||
|
||||
(define-public (add-reserve (increment uint))
|
||||
(set-reserve (+ (var-get reserve) increment)))
|
||||
@@ -109,10 +114,12 @@
|
||||
;; public calls
|
||||
|
||||
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 2048))))
|
||||
(begin
|
||||
(let (
|
||||
(shares (get-tokens-to-shares amount)))
|
||||
(asserts! (or (is-eq tx-sender sender) (is-eq contract-caller sender)) err-unauthorised)
|
||||
(try! (ft-transfer? lqstx (get-tokens-to-shares amount) sender recipient))
|
||||
(print { type: "transfer", amount: amount, sender: sender, recipient: recipient, memo: memo })
|
||||
(try! (ft-transfer? lqstx shares sender recipient))
|
||||
(match memo to-print (print to-print) 0x)
|
||||
(print { notification: "transfer", payload: { amount: amount, shares: shares, sender: sender, recipient: recipient } })
|
||||
(ok true)))
|
||||
|
||||
;; private functions
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
;; vlqstx
|
||||
|
||||
(define-fungible-token vlqstx)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait extension-trait
|
||||
(
|
||||
(callback (principal (buff 2048)) (response bool uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait proposal-trait
|
||||
(
|
||||
(execute (principal) (response bool uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait proxy-trait
|
||||
((proxy-call ((buff 2048)) (response bool uint)))
|
||||
)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait rebase-strategy-trait
|
||||
(
|
||||
(rebase () (response uint uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait sip-010-extensions-trait
|
||||
(
|
||||
(mint (uint principal) (response bool uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait sip-010-trait
|
||||
(
|
||||
;; Transfer from the caller to a new principal
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait sip-010-transferable-trait
|
||||
(
|
||||
(transfer (uint principal principal (optional (buff 2048))) (response bool uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait strategy-trait
|
||||
(
|
||||
(execute ((buff 2048)) (response uint uint))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait rebase-sip-010-trait
|
||||
(
|
||||
;; Transfer from the caller to a new principal
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
---
|
||||
id: 0
|
||||
name: Devnet deployment
|
||||
|
||||
@@ -39,6 +39,7 @@ genesis:
|
||||
- pox
|
||||
- pox-2
|
||||
- pox-3
|
||||
- pox-4
|
||||
- lockup
|
||||
- costs-2
|
||||
- costs-3
|
||||
@@ -53,9 +54,6 @@ plan:
|
||||
emulated-sender: SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE
|
||||
path: "./.cache/requirements/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.clar"
|
||||
clarity-version: 1
|
||||
epoch: "2.0"
|
||||
- id: 1
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: trait-sip-010
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
@@ -101,8 +99,8 @@ plan:
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts_modules/alex_v1/traits/trait-vault.clar
|
||||
clarity-version: 1
|
||||
epoch: "2.05"
|
||||
- id: 2
|
||||
epoch: "2.1"
|
||||
- id: 1
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: pox-pools-1-cycle-v2
|
||||
@@ -230,7 +228,7 @@ plan:
|
||||
path: contracts/strategies/public-pools/fastpool-member.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 3
|
||||
- id: 2
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: xverse-member1
|
||||
@@ -358,13 +356,18 @@ plan:
|
||||
path: contracts/traits/rebase-strategy-trait.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 4
|
||||
- id: 3
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: regtest-boot
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/regtest-boot.clar
|
||||
clarity-version: 2
|
||||
- emulated-contract-publish:
|
||||
contract-name: simnet-boot
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/simnet-boot.clar
|
||||
clarity-version: 2
|
||||
- emulated-contract-publish:
|
||||
contract-name: sip-010-extensions-trait
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
{
|
||||
"name": "lisa",
|
||||
"version": "1.0.0",
|
||||
|
||||
568
pnpm-lock.yaml
generated
568
pnpm-lock.yaml
generated
@@ -6,8 +6,14 @@ settings:
|
||||
|
||||
dependencies:
|
||||
'@hirosystems/clarinet-sdk':
|
||||
specifier: ^1.0.0
|
||||
version: 1.3.0(@types/node@20.11.24)
|
||||
specifier: 2.4.0-beta2
|
||||
version: 2.4.0-beta2(@types/node@20.11.24)
|
||||
'@stacks/prettier-config':
|
||||
specifier: ^0.0.10
|
||||
version: 0.0.10
|
||||
'@stacks/stacking':
|
||||
specifier: 6.11.4-pr.36558cf.0
|
||||
version: 6.11.4-pr.36558cf.0
|
||||
'@stacks/transactions':
|
||||
specifier: ^6.9.0
|
||||
version: 6.12.0
|
||||
@@ -21,14 +27,14 @@ dependencies:
|
||||
specifier: ^5.2.2
|
||||
version: 5.3.3
|
||||
vite:
|
||||
specifier: ^4.4.9
|
||||
version: 4.5.2(@types/node@20.11.24)
|
||||
specifier: ^5.1.4
|
||||
version: 5.1.4(@types/node@20.11.24)
|
||||
vitest:
|
||||
specifier: ^0.34.4
|
||||
version: 0.34.6
|
||||
specifier: ^1.3.1
|
||||
version: 1.3.1(@types/node@20.11.24)
|
||||
vitest-environment-clarinet:
|
||||
specifier: ^1.0.0
|
||||
version: 1.1.0(@hirosystems/clarinet-sdk@1.3.0)(vitest@0.34.6)
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0(@hirosystems/clarinet-sdk@2.4.0-beta2)(vitest@1.3.1)
|
||||
yaml:
|
||||
specifier: ^2.4.1
|
||||
version: 2.4.1
|
||||
@@ -51,15 +57,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm64@0.18.20:
|
||||
resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm64@0.19.12:
|
||||
resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -69,15 +66,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm@0.18.20:
|
||||
resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-arm@0.19.12:
|
||||
resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -87,15 +75,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-x64@0.18.20:
|
||||
resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/android-x64@0.19.12:
|
||||
resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -105,15 +84,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-arm64@0.18.20:
|
||||
resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-arm64@0.19.12:
|
||||
resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -123,15 +93,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-x64@0.18.20:
|
||||
resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/darwin-x64@0.19.12:
|
||||
resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -141,15 +102,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-arm64@0.18.20:
|
||||
resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-arm64@0.19.12:
|
||||
resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -159,15 +111,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-x64@0.18.20:
|
||||
resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/freebsd-x64@0.19.12:
|
||||
resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -177,15 +120,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm64@0.18.20:
|
||||
resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm64@0.19.12:
|
||||
resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -195,15 +129,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm@0.18.20:
|
||||
resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-arm@0.19.12:
|
||||
resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -213,15 +138,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ia32@0.18.20:
|
||||
resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ia32@0.19.12:
|
||||
resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -231,15 +147,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64@0.18.20:
|
||||
resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64@0.19.12:
|
||||
resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -249,15 +156,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-mips64el@0.18.20:
|
||||
resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-mips64el@0.19.12:
|
||||
resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -267,15 +165,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ppc64@0.18.20:
|
||||
resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-ppc64@0.19.12:
|
||||
resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -285,15 +174,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-riscv64@0.18.20:
|
||||
resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-riscv64@0.19.12:
|
||||
resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -303,15 +183,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-s390x@0.18.20:
|
||||
resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-s390x@0.19.12:
|
||||
resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -321,15 +192,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-x64@0.18.20:
|
||||
resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-x64@0.19.12:
|
||||
resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -339,15 +201,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/netbsd-x64@0.18.20:
|
||||
resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/netbsd-x64@0.19.12:
|
||||
resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -357,15 +210,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/openbsd-x64@0.18.20:
|
||||
resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/openbsd-x64@0.19.12:
|
||||
resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -375,15 +219,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/sunos-x64@0.18.20:
|
||||
resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/sunos-x64@0.19.12:
|
||||
resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -393,15 +228,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-arm64@0.18.20:
|
||||
resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-arm64@0.19.12:
|
||||
resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -411,15 +237,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-ia32@0.18.20:
|
||||
resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-ia32@0.19.12:
|
||||
resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -429,15 +246,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-x64@0.18.20:
|
||||
resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@esbuild/win32-x64@0.19.12:
|
||||
resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -447,16 +255,19 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@hirosystems/clarinet-sdk-wasm@2.3.1:
|
||||
resolution: {integrity: sha512-2x5cdnhMrYu5mJrtB0/LCkSX8gLAWFoB8juzjQVoPj+Q3oi+9586COyvqCzqJdFPf1mZhuWYgtWQvk5rm3d4XA==}
|
||||
/@hirosystems/clarinet-sdk-wasm@2.4.0-beta3:
|
||||
resolution: {integrity: sha512-m4PHoE38F+YzH5WDwK5CuRs3/RZWGstIPx4bq2vX6ut1ETE2S9LkS8q91RFF4FnZHnI5f8LwxflTbaxE+RSNrA==}
|
||||
dev: false
|
||||
|
||||
/@hirosystems/clarinet-sdk@1.3.0(@types/node@20.11.24):
|
||||
resolution: {integrity: sha512-CB6+E8gcFJp2Q+iYZ74opI+GJBsAEc54SdPdMY8lvz/H7lHonQtyjn0aOPl8Th5jcC3Cq+yqb6APDWbBr07vUA==}
|
||||
/@hirosystems/clarinet-sdk@2.4.0-beta2(@types/node@20.11.24):
|
||||
resolution: {integrity: sha512-GLcUCcyLJHBY31Zdp0X8TyLknxRatTSIlHjJIP2wM9mm1qiT1IspmISC/mBLHVom6OK1FBoXHSaxb1k/SjpHjQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@hirosystems/clarinet-sdk-wasm': 2.3.1
|
||||
'@hirosystems/clarinet-sdk-wasm': 2.4.0-beta3
|
||||
'@stacks/encryption': 6.12.0
|
||||
'@stacks/network': 6.11.3
|
||||
'@stacks/stacking': 6.11.4-pr.36558cf.0
|
||||
'@stacks/transactions': 6.12.0
|
||||
kolorist: 1.8.0
|
||||
prompts: 2.4.2
|
||||
@@ -614,6 +425,21 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@scure/base@1.1.1:
|
||||
resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==}
|
||||
dev: false
|
||||
|
||||
/@scure/base@1.1.5:
|
||||
resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==}
|
||||
dev: false
|
||||
|
||||
/@scure/bip39@1.1.0:
|
||||
resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==}
|
||||
dependencies:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@scure/base': 1.1.5
|
||||
dev: false
|
||||
|
||||
/@sinclair/typebox@0.27.8:
|
||||
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
|
||||
dev: false
|
||||
@@ -625,6 +451,27 @@ packages:
|
||||
'@types/node': 18.19.21
|
||||
dev: false
|
||||
|
||||
/@stacks/common@6.11.4-pr.e279ac3.0:
|
||||
resolution: {integrity: sha512-6PMFR75VWmVnuNSGd0UNz6PDFUKcwEsZIEHzODeG4YDfoGq8NuFi+Wu4box9iKk2gbYfqJL5i0TW9F5sjY2+Bg==}
|
||||
dependencies:
|
||||
'@types/bn.js': 5.1.5
|
||||
'@types/node': 18.19.21
|
||||
dev: false
|
||||
|
||||
/@stacks/encryption@6.12.0:
|
||||
resolution: {integrity: sha512-CubE51pHrcxx3yA+xapevPgA9UDleIoEaUZ06/9uD91B42yvTg37HyS8t06rzukU9q+X7Cv2I/+vbuf4nJIo8g==}
|
||||
dependencies:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@scure/bip39': 1.1.0
|
||||
'@stacks/common': 6.10.0
|
||||
'@types/node': 18.19.21
|
||||
base64-js: 1.5.1
|
||||
bs58: 5.0.0
|
||||
ripemd160-min: 0.0.6
|
||||
varuint-bitcoin: 1.1.2
|
||||
dev: false
|
||||
|
||||
/@stacks/network@6.11.3:
|
||||
resolution: {integrity: sha512-c4ClCU/QUwuu8NbHtDKPJNa0M5YxauLN3vYaR0+S4awbhVIKFQSxirm9Q9ckV1WBh7FtD6u2S0x+tDQGAODjNg==}
|
||||
dependencies:
|
||||
@@ -634,6 +481,40 @@ packages:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@stacks/network@6.11.4-pr.e279ac3.0:
|
||||
resolution: {integrity: sha512-3V7Gopn4zyNqKV3+62asMX9FWiZ5cKlzb3kBwfrui3fACHE6fFamPYfyPzNCQ1Y6Cpw00FS2OBVVq2Qw1GKWtw==}
|
||||
dependencies:
|
||||
'@stacks/common': 6.11.4-pr.e279ac3.0
|
||||
cross-fetch: 3.1.8
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@stacks/prettier-config@0.0.10:
|
||||
resolution: {integrity: sha512-MrYWGEgO/mYR8TOZIKknQEHbFQZ5VyAD/s8eF2Yxr6Lgalt2alVEh+6ODehVP2uepkyXPmJzLbaQYs8/L4E78Q==}
|
||||
dependencies:
|
||||
prettier: 2.5.1
|
||||
dev: false
|
||||
|
||||
/@stacks/stacking@6.11.4-pr.36558cf.0:
|
||||
resolution: {integrity: sha512-BK3da72woKdqwrSi5KrQrp7pfEBSrJKDE/gn/yt5RRkYcX38jbUoNauJqbNCHaPgKdPlYVzYnmtbe4f5YUQ+Ng==}
|
||||
dependencies:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@scure/base': 1.1.1
|
||||
'@stacks/common': 6.11.4-pr.e279ac3.0
|
||||
'@stacks/encryption': 6.12.0
|
||||
'@stacks/network': 6.11.4-pr.e279ac3.0
|
||||
'@stacks/stacks-blockchain-api-types': 0.61.0
|
||||
'@stacks/transactions': 6.12.0
|
||||
bs58: 5.0.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@stacks/stacks-blockchain-api-types@0.61.0:
|
||||
resolution: {integrity: sha512-yPOfTUboo5eA9BZL/hqMcM71GstrFs9YWzOrJFPeP4cOO1wgYvAcckgBRbgiE3NqeX0A7SLZLDAXLZbATuRq9w==}
|
||||
dev: false
|
||||
|
||||
/@stacks/transactions@6.12.0:
|
||||
resolution: {integrity: sha512-gRP3SfTaAIoTdjMvOiLrMZb/senqB8JQlT5Y4C3/CiHhiprYwTx7TbOCSa7WsNOU99H4aNfHvatmymuggXQVkA==}
|
||||
dependencies:
|
||||
@@ -669,16 +550,6 @@ packages:
|
||||
'@types/node': 18.19.21
|
||||
dev: false
|
||||
|
||||
/@types/chai-subset@1.3.5:
|
||||
resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==}
|
||||
dependencies:
|
||||
'@types/chai': 4.3.12
|
||||
dev: false
|
||||
|
||||
/@types/chai@4.3.12:
|
||||
resolution: {integrity: sha512-zNKDHG/1yxm8Il6uCCVsm+dRdEsJlFoDu73X17y09bId6UwoYww+vFBsAcRzl8knM1sab3Dp1VRikFQwDOtDDw==}
|
||||
dev: false
|
||||
|
||||
/@types/estree@1.0.5:
|
||||
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
||||
dev: false
|
||||
@@ -695,14 +566,6 @@ packages:
|
||||
undici-types: 5.26.5
|
||||
dev: false
|
||||
|
||||
/@vitest/expect@0.34.6:
|
||||
resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==}
|
||||
dependencies:
|
||||
'@vitest/spy': 0.34.6
|
||||
'@vitest/utils': 0.34.6
|
||||
chai: 4.4.1
|
||||
dev: false
|
||||
|
||||
/@vitest/expect@1.3.1:
|
||||
resolution: {integrity: sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==}
|
||||
dependencies:
|
||||
@@ -711,14 +574,6 @@ packages:
|
||||
chai: 4.4.1
|
||||
dev: false
|
||||
|
||||
/@vitest/runner@0.34.6:
|
||||
resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==}
|
||||
dependencies:
|
||||
'@vitest/utils': 0.34.6
|
||||
p-limit: 4.0.0
|
||||
pathe: 1.1.2
|
||||
dev: false
|
||||
|
||||
/@vitest/runner@1.3.1:
|
||||
resolution: {integrity: sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==}
|
||||
dependencies:
|
||||
@@ -727,14 +582,6 @@ packages:
|
||||
pathe: 1.1.2
|
||||
dev: false
|
||||
|
||||
/@vitest/snapshot@0.34.6:
|
||||
resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==}
|
||||
dependencies:
|
||||
magic-string: 0.30.8
|
||||
pathe: 1.1.2
|
||||
pretty-format: 29.7.0
|
||||
dev: false
|
||||
|
||||
/@vitest/snapshot@1.3.1:
|
||||
resolution: {integrity: sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==}
|
||||
dependencies:
|
||||
@@ -743,26 +590,12 @@ packages:
|
||||
pretty-format: 29.7.0
|
||||
dev: false
|
||||
|
||||
/@vitest/spy@0.34.6:
|
||||
resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==}
|
||||
dependencies:
|
||||
tinyspy: 2.2.1
|
||||
dev: false
|
||||
|
||||
/@vitest/spy@1.3.1:
|
||||
resolution: {integrity: sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==}
|
||||
dependencies:
|
||||
tinyspy: 2.2.1
|
||||
dev: false
|
||||
|
||||
/@vitest/utils@0.34.6:
|
||||
resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==}
|
||||
dependencies:
|
||||
diff-sequences: 29.6.3
|
||||
loupe: 2.3.7
|
||||
pretty-format: 29.7.0
|
||||
dev: false
|
||||
|
||||
/@vitest/utils@1.3.1:
|
||||
resolution: {integrity: sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==}
|
||||
dependencies:
|
||||
@@ -832,6 +665,10 @@ packages:
|
||||
resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==}
|
||||
dev: false
|
||||
|
||||
/base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
dev: false
|
||||
|
||||
/binary-extensions@2.2.0:
|
||||
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -844,6 +681,12 @@ packages:
|
||||
fill-range: 7.0.1
|
||||
dev: false
|
||||
|
||||
/bs58@5.0.0:
|
||||
resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==}
|
||||
dependencies:
|
||||
base-x: 4.0.0
|
||||
dev: false
|
||||
|
||||
/c32check@2.0.0:
|
||||
resolution: {integrity: sha512-rpwfAcS/CMqo0oCqDf3r9eeLgScRE3l/xHDCXhM3UyrfvIn7PrLq63uHh7yYbv8NzaZn5MVsVhIRpQ+5GZ5HyA==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -1008,36 +851,6 @@ packages:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
dev: false
|
||||
|
||||
/esbuild@0.18.20:
|
||||
resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/android-arm': 0.18.20
|
||||
'@esbuild/android-arm64': 0.18.20
|
||||
'@esbuild/android-x64': 0.18.20
|
||||
'@esbuild/darwin-arm64': 0.18.20
|
||||
'@esbuild/darwin-x64': 0.18.20
|
||||
'@esbuild/freebsd-arm64': 0.18.20
|
||||
'@esbuild/freebsd-x64': 0.18.20
|
||||
'@esbuild/linux-arm': 0.18.20
|
||||
'@esbuild/linux-arm64': 0.18.20
|
||||
'@esbuild/linux-ia32': 0.18.20
|
||||
'@esbuild/linux-loong64': 0.18.20
|
||||
'@esbuild/linux-mips64el': 0.18.20
|
||||
'@esbuild/linux-ppc64': 0.18.20
|
||||
'@esbuild/linux-riscv64': 0.18.20
|
||||
'@esbuild/linux-s390x': 0.18.20
|
||||
'@esbuild/linux-x64': 0.18.20
|
||||
'@esbuild/netbsd-x64': 0.18.20
|
||||
'@esbuild/openbsd-x64': 0.18.20
|
||||
'@esbuild/sunos-x64': 0.18.20
|
||||
'@esbuild/win32-arm64': 0.18.20
|
||||
'@esbuild/win32-ia32': 0.18.20
|
||||
'@esbuild/win32-x64': 0.18.20
|
||||
dev: false
|
||||
|
||||
/esbuild@0.19.12:
|
||||
resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -1203,11 +1016,6 @@ packages:
|
||||
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
|
||||
dev: false
|
||||
|
||||
/local-pkg@0.4.3:
|
||||
resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
|
||||
engines: {node: '>=14'}
|
||||
dev: false
|
||||
|
||||
/local-pkg@0.5.0:
|
||||
resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -1319,13 +1127,6 @@ packages:
|
||||
p-try: 2.2.0
|
||||
dev: false
|
||||
|
||||
/p-limit@4.0.0:
|
||||
resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dependencies:
|
||||
yocto-queue: 1.0.0
|
||||
dev: false
|
||||
|
||||
/p-limit@5.0.0:
|
||||
resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -1394,6 +1195,12 @@ packages:
|
||||
source-map-js: 1.0.2
|
||||
dev: false
|
||||
|
||||
/prettier@2.5.1:
|
||||
resolution: {integrity: sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/pretty-format@29.7.0:
|
||||
resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
|
||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||
@@ -1431,12 +1238,9 @@ packages:
|
||||
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
|
||||
dev: false
|
||||
|
||||
/rollup@3.29.4:
|
||||
resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==}
|
||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||
hasBin: true
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
/ripemd160-min@0.0.6:
|
||||
resolution: {integrity: sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==}
|
||||
engines: {node: '>=8'}
|
||||
dev: false
|
||||
|
||||
/rollup@4.12.0:
|
||||
@@ -1462,6 +1266,10 @@ packages:
|
||||
fsevents: 2.3.3
|
||||
dev: false
|
||||
|
||||
/safe-buffer@5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
dev: false
|
||||
|
||||
/set-blocking@2.0.0:
|
||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
||||
dev: false
|
||||
@@ -1541,12 +1349,6 @@ packages:
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/strip-literal@1.3.0:
|
||||
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
|
||||
dependencies:
|
||||
acorn: 8.11.3
|
||||
dev: false
|
||||
|
||||
/strip-literal@2.0.0:
|
||||
resolution: {integrity: sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==}
|
||||
dependencies:
|
||||
@@ -1557,11 +1359,6 @@ packages:
|
||||
resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==}
|
||||
dev: false
|
||||
|
||||
/tinypool@0.7.0:
|
||||
resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
dev: false
|
||||
|
||||
/tinypool@0.8.2:
|
||||
resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -1637,26 +1434,10 @@ packages:
|
||||
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
|
||||
dev: false
|
||||
|
||||
/vite-node@0.34.6(@types/node@20.11.24):
|
||||
resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
|
||||
engines: {node: '>=v14.18.0'}
|
||||
hasBin: true
|
||||
/varuint-bitcoin@1.1.2:
|
||||
resolution: {integrity: sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==}
|
||||
dependencies:
|
||||
cac: 6.7.14
|
||||
debug: 4.3.4
|
||||
mlly: 1.6.1
|
||||
pathe: 1.1.2
|
||||
picocolors: 1.0.0
|
||||
vite: 4.5.2(@types/node@20.11.24)
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- less
|
||||
- lightningcss
|
||||
- sass
|
||||
- stylus
|
||||
- sugarss
|
||||
- supports-color
|
||||
- terser
|
||||
safe-buffer: 5.2.1
|
||||
dev: false
|
||||
|
||||
/vite-node@1.3.1(@types/node@20.11.24):
|
||||
@@ -1680,42 +1461,6 @@ packages:
|
||||
- terser
|
||||
dev: false
|
||||
|
||||
/vite@4.5.2(@types/node@20.11.24):
|
||||
resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@types/node': '>= 14'
|
||||
less: '*'
|
||||
lightningcss: ^1.21.0
|
||||
sass: '*'
|
||||
stylus: '*'
|
||||
sugarss: '*'
|
||||
terser: ^5.4.0
|
||||
peerDependenciesMeta:
|
||||
'@types/node':
|
||||
optional: true
|
||||
less:
|
||||
optional: true
|
||||
lightningcss:
|
||||
optional: true
|
||||
sass:
|
||||
optional: true
|
||||
stylus:
|
||||
optional: true
|
||||
sugarss:
|
||||
optional: true
|
||||
terser:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@types/node': 20.11.24
|
||||
esbuild: 0.18.20
|
||||
postcss: 8.4.35
|
||||
rollup: 3.29.4
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
dev: false
|
||||
|
||||
/vite@5.1.4(@types/node@20.11.24):
|
||||
resolution: {integrity: sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==}
|
||||
engines: {node: ^18.0.0 || >=20.0.0}
|
||||
@@ -1752,79 +1497,14 @@ packages:
|
||||
fsevents: 2.3.3
|
||||
dev: false
|
||||
|
||||
/vitest-environment-clarinet@1.1.0(@hirosystems/clarinet-sdk@1.3.0)(vitest@0.34.6):
|
||||
resolution: {integrity: sha512-abf6VPWVyzZ6Ynz3kNqKZGsJuS0MH5xKyJeR9dgE5Y4dQ34KaBoTeA2jzgamDUxyX1y+5/yA/SBQab4sZjX8Sg==}
|
||||
/vitest-environment-clarinet@2.0.0(@hirosystems/clarinet-sdk@2.4.0-beta2)(vitest@1.3.1):
|
||||
resolution: {integrity: sha512-NW8Z0JPV/hwB1WkvGiGED9JmXsefPUjImJRbO3BEsxdL8qxA1y2EAwuqjfmvXYDeisQSnZGbfns7DN8eDxJnpg==}
|
||||
peerDependencies:
|
||||
'@hirosystems/clarinet-sdk': '1'
|
||||
vitest: '1'
|
||||
'@hirosystems/clarinet-sdk': '2'
|
||||
vitest: ^1.3.1
|
||||
dependencies:
|
||||
'@hirosystems/clarinet-sdk': 1.3.0(@types/node@20.11.24)
|
||||
vitest: 0.34.6
|
||||
dev: false
|
||||
|
||||
/vitest@0.34.6:
|
||||
resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==}
|
||||
engines: {node: '>=v14.18.0'}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@vitest/browser': '*'
|
||||
'@vitest/ui': '*'
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
playwright: '*'
|
||||
safaridriver: '*'
|
||||
webdriverio: '*'
|
||||
peerDependenciesMeta:
|
||||
'@edge-runtime/vm':
|
||||
optional: true
|
||||
'@vitest/browser':
|
||||
optional: true
|
||||
'@vitest/ui':
|
||||
optional: true
|
||||
happy-dom:
|
||||
optional: true
|
||||
jsdom:
|
||||
optional: true
|
||||
playwright:
|
||||
optional: true
|
||||
safaridriver:
|
||||
optional: true
|
||||
webdriverio:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@types/chai': 4.3.12
|
||||
'@types/chai-subset': 1.3.5
|
||||
'@types/node': 20.11.24
|
||||
'@vitest/expect': 0.34.6
|
||||
'@vitest/runner': 0.34.6
|
||||
'@vitest/snapshot': 0.34.6
|
||||
'@vitest/spy': 0.34.6
|
||||
'@vitest/utils': 0.34.6
|
||||
acorn: 8.11.3
|
||||
acorn-walk: 8.3.2
|
||||
cac: 6.7.14
|
||||
chai: 4.4.1
|
||||
debug: 4.3.4
|
||||
local-pkg: 0.4.3
|
||||
magic-string: 0.30.8
|
||||
pathe: 1.1.2
|
||||
picocolors: 1.0.0
|
||||
std-env: 3.7.0
|
||||
strip-literal: 1.3.0
|
||||
tinybench: 2.6.0
|
||||
tinypool: 0.7.0
|
||||
vite: 4.5.2(@types/node@20.11.24)
|
||||
vite-node: 0.34.6(@types/node@20.11.24)
|
||||
why-is-node-running: 2.2.2
|
||||
transitivePeerDependencies:
|
||||
- less
|
||||
- lightningcss
|
||||
- sass
|
||||
- stylus
|
||||
- sugarss
|
||||
- supports-color
|
||||
- terser
|
||||
'@hirosystems/clarinet-sdk': 2.4.0-beta2(@types/node@20.11.24)
|
||||
vitest: 1.3.1(@types/node@20.11.24)
|
||||
dev: false
|
||||
|
||||
/vitest@1.3.1(@types/node@20.11.24):
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import {
|
||||
MultiSigSpendingCondition,
|
||||
StacksMessageType,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import {
|
||||
deserializeTransaction,
|
||||
getNonce,
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import fs from "fs";
|
||||
import { hexToBytes } from '@stacks/common';
|
||||
import { AddressHashMode, TransactionVersion, addressFromHashMode, createStacksPrivateKey, publicKeyFromBytes } from "@stacks/transactions";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import {
|
||||
makeUnsignedContractDeploy,
|
||||
StacksPublicKey,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { makeRandomPrivKey } from "@stacks/transactions";
|
||||
import { bytesToHex } from '@stacks/common';
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { AddressHashMode, AddressVersion, addressFromPublicKeys, addressToString, compressPublicKey, pubKeyfromPrivKey } from "@stacks/transactions";
|
||||
import { getNetwork, getStacksPubkeys, loadConfig } from "./config.ts";
|
||||
import { bytesToHex } from '@stacks/common';
|
||||
|
||||
7
scripts/prepare_tests.sh
Executable file
7
scripts/prepare_tests.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
|
||||
find . -type f -name "*.clar" -exec \
|
||||
sed -i '' -e 's/SP000000000000000000002Q6VF78/ST000000000000000000002AMW42H/g' {} \;
|
||||
7
scripts/revert_prepare_tests.sh
Executable file
7
scripts/revert_prepare_tests.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
|
||||
find . -type f -name "*.clar" -exec \
|
||||
sed -i 's/ST000000000000000000002AMW42H/SP000000000000000000002Q6VF78/g' {} \;
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import {
|
||||
TransactionSigner,
|
||||
compressPublicKey,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { Address, SpendingCondition, StacksPublicKey } from "@stacks/transactions";
|
||||
import fs from "fs";
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
[network]
|
||||
name = "devnet"
|
||||
deployment_fee_rate = 10
|
||||
|
||||
430
tests/lqstx-mint-endpoint-with-public-pools.test.ts
Normal file
430
tests/lqstx-mint-endpoint-with-public-pools.test.ts
Normal file
@@ -0,0 +1,430 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { tx } from '@hirosystems/clarinet-sdk';
|
||||
import { Cl, ResponseOkCV, TupleCV, UIntCV, cvToString } from '@stacks/transactions';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const mintDelay = 432;
|
||||
const accounts = simnet.getAccounts();
|
||||
const user = accounts.get('wallet_1')!;
|
||||
const oracle = accounts.get('wallet_2')!;
|
||||
const bot = accounts.get('wallet_3')!;
|
||||
const manager = accounts.get('deployer')!;
|
||||
const operator = accounts.get('wallet_4')!;
|
||||
const user2 = accounts.get('wallet_5')!;
|
||||
|
||||
const contracts = {
|
||||
endpoint: 'lqstx-mint-endpoint-v1-01',
|
||||
registry: 'lqstx-mint-registry',
|
||||
vault: 'lqstx-vault',
|
||||
lqstx: 'token-lqstx',
|
||||
vlqstx: 'token-vlqstx',
|
||||
wstx: 'token-wstx',
|
||||
strategy: 'public-pools-strategy',
|
||||
rebase: 'lisa-rebase',
|
||||
rebase1: 'rebase-1',
|
||||
amm: 'amm-swap-pool-v1-1',
|
||||
wlqstx: 'token-wlqstx',
|
||||
dao: 'lisa-dao',
|
||||
boot: 'simnet-boot',
|
||||
manager: 'public-pools-strategy-manager',
|
||||
operators: 'operators',
|
||||
proposal: 'mock-proposal',
|
||||
};
|
||||
|
||||
const prepareTest = () =>
|
||||
simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.dao,
|
||||
'construct',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.boot)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
|
||||
const getRewardCycle = () => {
|
||||
return (
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-reward-cycle',
|
||||
[Cl.uint(simnet.blockHeight)],
|
||||
user
|
||||
).result as ResponseOkCV<UIntCV>
|
||||
).value.value;
|
||||
};
|
||||
|
||||
const getBlocksToStartOfCycle = (cycle: bigint) => {
|
||||
return (
|
||||
Number(
|
||||
(
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-first-burn-block-in-reward-cycle',
|
||||
[Cl.uint(cycle)],
|
||||
user
|
||||
).result as ResponseOkCV<UIntCV>
|
||||
).value
|
||||
) - simnet.blockHeight
|
||||
);
|
||||
};
|
||||
const goToNextCycle = () => {
|
||||
const cycle = getRewardCycle();
|
||||
const blocksToMine = getBlocksToStartOfCycle(cycle + 1n);
|
||||
|
||||
simnet.mineEmptyBlocks(blocksToMine);
|
||||
};
|
||||
|
||||
// 1m STX
|
||||
const mintAmount = 1_000_000e6;
|
||||
|
||||
const requestMint = () =>
|
||||
simnet.callPublicFn(contracts.endpoint, 'request-mint', [Cl.uint(mintAmount)], user);
|
||||
|
||||
// lock mintAmount stx and request burn of 1 stx
|
||||
const requestBurn = () =>
|
||||
simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'fund-strategy', [Cl.list([Cl.uint(mintAmount)])], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(1e6)], user),
|
||||
]);
|
||||
|
||||
describe(contracts.endpoint, () => {
|
||||
it('can request mint', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
const response = requestMint();
|
||||
expect(response.result).toBeOk(Cl.uint(1));
|
||||
});
|
||||
|
||||
it('can finalize mint', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
goToNextCycle();
|
||||
|
||||
const finaliseErr = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(finaliseErr.result).toBeErr(Cl.uint(1006));
|
||||
|
||||
simnet.mineEmptyBlocks(mintDelay + 1); // mint-delay
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
|
||||
it('can revoke mint', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1000));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay + 1);
|
||||
responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
|
||||
it('can request burn', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay + 1);
|
||||
|
||||
const responses = requestBurn();
|
||||
expect(responses[0].result).toBeOk(Cl.uint(0));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[2].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(responses[3].result).toBeOk(Cl.uint(mintAmount));
|
||||
console.log(cvToString(responses[4].result));
|
||||
expect(responses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
});
|
||||
|
||||
it('can finalize burn', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay + 1);
|
||||
|
||||
const burnResponses = requestBurn();
|
||||
expect(burnResponses[0].result).toBeOk(Cl.uint(0));
|
||||
expect(burnResponses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(burnResponses[2].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(burnResponses[3].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(burnResponses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
|
||||
const responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.uint(1e6));
|
||||
expect(responses[1].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(responses[2].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
|
||||
it('can revoke burn', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay + 1);
|
||||
|
||||
const burnResponses = requestBurn();
|
||||
expect(burnResponses[0].result).toBeOk(Cl.uint(0));
|
||||
expect(burnResponses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(burnResponses[2].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(burnResponses[3].result).toBeOk(Cl.uint(mintAmount));
|
||||
expect(burnResponses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
|
||||
const responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], manager),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], user),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.uint(1e6));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1000));
|
||||
expect(responses[2].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
|
||||
it('can interact with strategies', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
const cycle = (
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-reward-cycle',
|
||||
[Cl.uint(simnet.blockHeight)],
|
||||
user
|
||||
).result as ResponseOkCV<UIntCV>
|
||||
).value.value;
|
||||
const blocksToMine =
|
||||
Number(
|
||||
(
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-first-burn-block-in-reward-cycle',
|
||||
[Cl.uint(cycle + 1n)],
|
||||
user
|
||||
).result as UIntCV
|
||||
).value
|
||||
) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine - 100);
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'fund-strategy', [Cl.list([Cl.uint(mintAmount)])], bot),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'fund-strategy',
|
||||
[Cl.list([Cl.uint(mintAmount)])],
|
||||
manager
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1006)); // request pending
|
||||
expect(responses[1].result).toBeErr(Cl.uint(3000)); // not authorized
|
||||
responses[2].events.map((e: any) => console.log(e));
|
||||
expect(responses[2].result).toBeOk(Cl.uint(mintAmount)); // mintAmount stx transferred, mintAmount - 1 stx locked
|
||||
|
||||
const stxAccountFastPoolMember1 = simnet.runSnippet(
|
||||
`(stx-account '${simnet.deployer}.fastpool-member1)`
|
||||
) as TupleCV<{ locked: UIntCV; unlocked: UIntCV }>;
|
||||
expect(stxAccountFastPoolMember1.data.locked).toBeUint(mintAmount - 1e6);
|
||||
|
||||
goToNextCycle(); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(mintDelay + 1); // mint-delay
|
||||
|
||||
responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(mintAmount)], user),
|
||||
tx.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(1e6)], user),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], bot),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], manager),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
expect(responses[2].result).toBeErr(Cl.uint(1)); // not enough funds
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1006)); // request pending
|
||||
expect(responses[4].result).toBeErr(Cl.uint(3000)); // not authorized
|
||||
expect(responses[5].result).toBeOk(Cl.uint(1e6)); // refund 1 stx
|
||||
expect(responses[6].result).toBeOk(Cl.uint(0)); // refund 0 stx
|
||||
expect(responses[7].result).toBeOk(Cl.uint(mintAmount)); // rebase mintAmount stx
|
||||
expect(responses[8].result).toBeErr(Cl.uint(1006)); // request pending
|
||||
|
||||
// refund remaining stx after unlock
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(1);
|
||||
|
||||
responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.list([Cl.bool(true)])], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.uint(mintAmount - 1e6));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
});
|
||||
|
||||
// user1 mints 100 STX, user2 100m STX
|
||||
it('can rebase', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
let response;
|
||||
response = simnet.callPublicFn(contracts.endpoint, 'request-mint', [Cl.uint(100e6)], user);
|
||||
expect(response.result).toBeOk(Cl.uint(1));
|
||||
response = simnet.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'request-mint',
|
||||
[Cl.uint(100_000_000e6)],
|
||||
user2
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.uint(2));
|
||||
|
||||
goToNextCycle(); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(mintDelay + 1); // mint-delay
|
||||
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'rebase', [], oracle);
|
||||
expect(response.result).toBeOk(Cl.uint(0));
|
||||
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(response.result).toBeOk(Cl.bool(true));
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(2)], bot);
|
||||
expect(response.result).toBeOk(Cl.bool(true));
|
||||
|
||||
response = simnet.callPublicFn(
|
||||
contracts.manager,
|
||||
'fund-strategy',
|
||||
[
|
||||
Cl.list([
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
Cl.uint(5_000_000e6),
|
||||
]),
|
||||
],
|
||||
manager
|
||||
);
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'rebase', [], oracle);
|
||||
expect(response.result).toBeOk(Cl.uint(100_000_100e6));
|
||||
|
||||
response = simnet.callReadOnlyFn(
|
||||
contracts.lqstx,
|
||||
'get-balance',
|
||||
[Cl.standardPrincipal(user)],
|
||||
user
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.uint(100e6));
|
||||
|
||||
response = simnet.callReadOnlyFn(
|
||||
contracts.lqstx,
|
||||
'get-share',
|
||||
[Cl.standardPrincipal(user)],
|
||||
user
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.uint(100e6));
|
||||
|
||||
// receive rewards
|
||||
response = simnet.transferSTX(1_000_000e6, `${simnet.deployer}.fastpool-member1`, oracle);
|
||||
response = simnet.transferSTX(1_000_000e6, `${simnet.deployer}.fastpool-member2`, oracle);
|
||||
response = simnet.transferSTX(1_000_000e6, `${simnet.deployer}.fastpool-member3`, oracle);
|
||||
response = simnet.transferSTX(1_000_000e6, `${simnet.deployer}.fastpool-member4`, oracle);
|
||||
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'rebase', [], oracle);
|
||||
expect(response.result).toBeOk(Cl.uint(104_000_100e6));
|
||||
|
||||
response = simnet.callReadOnlyFn(
|
||||
contracts.lqstx,
|
||||
'get-balance',
|
||||
[Cl.standardPrincipal(user)],
|
||||
user
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.uint(103_999_996));
|
||||
|
||||
response = simnet.callReadOnlyFn(
|
||||
contracts.lqstx,
|
||||
'get-share',
|
||||
[Cl.standardPrincipal(user)],
|
||||
user
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.uint(100e6));
|
||||
});
|
||||
|
||||
it('can set up amm pool', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
goToNextCycle(); // go to the next cycle
|
||||
|
||||
const finaliseErr = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(finaliseErr.result).toBeErr(Cl.uint(1006));
|
||||
|
||||
simnet.mineEmptyBlocks(mintDelay + 1); // mint-delay
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(
|
||||
contracts.amm,
|
||||
'create-pool',
|
||||
[
|
||||
Cl.principal(simnet.deployer + '.' + contracts.wstx),
|
||||
Cl.principal(simnet.deployer + '.' + contracts.wlqstx),
|
||||
Cl.uint(1e8),
|
||||
Cl.principal(user),
|
||||
Cl.uint(1e8),
|
||||
Cl.uint(1e8),
|
||||
],
|
||||
user
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { tx } from '@hirosystems/clarinet-sdk';
|
||||
import { Cl } from '@stacks/transactions';
|
||||
import { Cl, ResponseOkCV, UIntCV } from '@stacks/transactions';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const accounts = simnet.getAccounts();
|
||||
@@ -24,67 +27,65 @@ const contracts = {
|
||||
boot: 'regtest-boot',
|
||||
manager: 'mock-strategy-manager',
|
||||
operators: 'operators',
|
||||
proposal: 'mock-proposal'
|
||||
}
|
||||
proposal: 'mock-proposal',
|
||||
};
|
||||
const mintDelay = 144;
|
||||
|
||||
const prepareTest = () =>
|
||||
simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.dao,
|
||||
'construct',
|
||||
[
|
||||
Cl.contractPrincipal(simnet.deployer, contracts.boot),
|
||||
],
|
||||
simnet.deployer,
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.boot)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
|
||||
const requestMint = () =>
|
||||
simnet.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'request-mint',
|
||||
[Cl.uint(100e6)],
|
||||
user,
|
||||
)
|
||||
simnet.callPublicFn(contracts.endpoint, 'request-mint', [Cl.uint(100e6)], user);
|
||||
|
||||
const requestBurn = (payload: Buffer) =>
|
||||
simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'rebase',
|
||||
[],
|
||||
oracle
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'fund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'rebase',
|
||||
[],
|
||||
oracle
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'request-burn',
|
||||
[
|
||||
Cl.uint(100e6),
|
||||
],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'fund-strategy', [Cl.uint(100e6)], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(100e6)], user),
|
||||
]);
|
||||
|
||||
const getRewardCycle = () => {
|
||||
return (
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-reward-cycle',
|
||||
[Cl.uint(simnet.blockHeight)],
|
||||
user
|
||||
).result as ResponseOkCV<UIntCV>
|
||||
).value.value;
|
||||
};
|
||||
|
||||
const getBlocksToStartOfCycle = (cycle: bigint) => {
|
||||
return (
|
||||
Number(
|
||||
(
|
||||
simnet.callReadOnlyFn(
|
||||
contracts.endpoint,
|
||||
'get-first-burn-block-in-reward-cycle',
|
||||
[Cl.uint(cycle)],
|
||||
user
|
||||
).result as ResponseOkCV<UIntCV>
|
||||
).value
|
||||
) - simnet.blockHeight
|
||||
);
|
||||
};
|
||||
|
||||
const goToNextCycle = () => {
|
||||
const cycle = getRewardCycle();
|
||||
const blocksToMine = getBlocksToStartOfCycle(cycle + 1n);
|
||||
|
||||
simnet.mineEmptyBlocks(blocksToMine);
|
||||
};
|
||||
|
||||
describe(contracts.endpoint, () => {
|
||||
it('can request mint', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
@@ -97,33 +98,16 @@ describe(contracts.endpoint, () => {
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
goToNextCycle();
|
||||
|
||||
const finaliseErr = simnet.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
);
|
||||
const finaliseErr = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(finaliseErr.result).toBeErr(Cl.uint(1006));
|
||||
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-mint',
|
||||
[Cl.uint(1)],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1007));
|
||||
@@ -135,34 +119,17 @@ describe(contracts.endpoint, () => {
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-mint',
|
||||
[Cl.uint(1)],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-mint', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1000));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay); // mint-delay
|
||||
|
||||
responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
)
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
@@ -171,10 +138,8 @@ describe(contracts.endpoint, () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
const payload = simnet.callReadOnlyFn(
|
||||
contracts.strategy,
|
||||
@@ -187,17 +152,18 @@ describe(contracts.endpoint, () => {
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[2].result).toBeOk(Cl.uint(100e6));
|
||||
expect(responses[3].result).toBeOk(Cl.uint(100e6));
|
||||
expect(responses[4].result).toBeOk(Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') }));
|
||||
expect(responses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
});
|
||||
|
||||
it('can finalize burn', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
const payload = simnet.callReadOnlyFn(
|
||||
contracts.strategy,
|
||||
@@ -210,51 +176,28 @@ describe(contracts.endpoint, () => {
|
||||
expect(burnResponses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(burnResponses[2].result).toBeOk(Cl.uint(100e6));
|
||||
expect(burnResponses[3].result).toBeOk(Cl.uint(100e6));
|
||||
expect(burnResponses[4].result).toBeOk(Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') }));
|
||||
expect(burnResponses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
|
||||
const responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'refund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'rebase',
|
||||
[],
|
||||
oracle
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-burn',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-burn',
|
||||
[Cl.uint(1)],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.uint(100e6)], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], user),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.uint(100e6));
|
||||
expect(responses[1].result).toBeOk(Cl.uint(100e6));
|
||||
expect(responses[2].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1007));
|
||||
|
||||
});
|
||||
|
||||
it('can revoke burn', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
const payload = simnet.callReadOnlyFn(
|
||||
contracts.strategy,
|
||||
@@ -267,35 +210,15 @@ describe(contracts.endpoint, () => {
|
||||
expect(burnResponses[1].result).toBeOk(Cl.bool(true));
|
||||
expect(burnResponses[2].result).toBeOk(Cl.uint(100e6));
|
||||
expect(burnResponses[3].result).toBeOk(Cl.uint(100e6));
|
||||
expect(burnResponses[4].result).toBeOk(Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') }));
|
||||
expect(burnResponses[4].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
|
||||
const responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'refund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-burn',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.endpoint,
|
||||
'revoke-burn',
|
||||
[Cl.uint(1)],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
)
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.uint(100e6)], manager),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.endpoint, 'revoke-burn', [Cl.uint(1)], user),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.uint(100e6));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1000));
|
||||
@@ -303,113 +226,59 @@ describe(contracts.endpoint, () => {
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1007));
|
||||
});
|
||||
|
||||
it('can request burn and finalized immediately', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
let response;
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(100e6)], user);
|
||||
expect(response.result).toBeErr(Cl.uint(1)); // not enough funds
|
||||
|
||||
goToNextCycle();
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(response.result).toBeOk(Cl.bool(true));
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(100e6)], user);
|
||||
expect(response.result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.buffer(new Uint8Array([1])) })
|
||||
);
|
||||
});
|
||||
|
||||
it('can interact with strategies', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
const payload = simnet.callReadOnlyFn(
|
||||
contracts.strategy,
|
||||
'create-payload',
|
||||
[Cl.uint(100e6)],
|
||||
manager
|
||||
).result.buffer;
|
||||
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
const cycle = getRewardCycle();
|
||||
const blocksToMine = getBlocksToStartOfCycle(cycle + 1n);
|
||||
simnet.mineEmptyBlocks(blocksToMine - 100);
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'fund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'fund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'fund-strategy', [Cl.uint(100e6)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'fund-strategy', [Cl.uint(100e6)], manager),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1006));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1000));
|
||||
expect(responses[2].result).toBeOk(Cl.uint(100e6));
|
||||
|
||||
simnet.mineEmptyBlocks(99); // go to the next cycle
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'request-burn',
|
||||
[
|
||||
Cl.uint(100e6),
|
||||
],
|
||||
user
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-burn',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'refund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'refund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.manager,
|
||||
'refund-strategy',
|
||||
[
|
||||
Cl.uint(100e6)
|
||||
],
|
||||
manager
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'rebase',
|
||||
[],
|
||||
oracle
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-burn',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
)
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(100e6)], user),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.uint(100e6)], bot),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.uint(100e6)], manager),
|
||||
tx.callPublicFn(contracts.manager, 'refund-strategy', [Cl.uint(100e6)], manager),
|
||||
tx.callPublicFn(contracts.rebase1, 'rebase', [], oracle),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-burn', [Cl.uint(1)], bot),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeOk(Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') }));
|
||||
expect(responses[1].result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.bufferFromHex('00') })
|
||||
);
|
||||
expect(responses[2].result).toBeErr(Cl.uint(1006));
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1000));
|
||||
expect(responses[4].result).toBeOk(Cl.uint(100e6));
|
||||
@@ -423,27 +292,15 @@ describe(contracts.endpoint, () => {
|
||||
|
||||
expect(requestMint().result).toBeOk(Cl.uint(1));
|
||||
|
||||
const cycle = simnet.callReadOnlyFn(contracts.endpoint, 'get-reward-cycle', [Cl.uint(simnet.blockHeight)], user).result.value.value;
|
||||
const blocksToMine = Number(simnet.callReadOnlyFn(contracts.endpoint, 'get-first-burn-block-in-reward-cycle', [Cl.uint(cycle + 1n)], user).result.value) - simnet.blockHeight;
|
||||
simnet.mineEmptyBlocks(blocksToMine); // go to the next cycle
|
||||
goToNextCycle();
|
||||
|
||||
const finaliseErr = simnet.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
);
|
||||
const finaliseErr = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(finaliseErr.result).toBeErr(Cl.uint(1006));
|
||||
|
||||
simnet.mineEmptyBlocks(144); // mint-delay
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.rebase1,
|
||||
'finalize-mint',
|
||||
[Cl.uint(1)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot),
|
||||
tx.callPublicFn(
|
||||
contracts.amm,
|
||||
'create-pool',
|
||||
@@ -453,10 +310,10 @@ describe(contracts.endpoint, () => {
|
||||
Cl.uint(1e8),
|
||||
Cl.principal(user),
|
||||
Cl.uint(1e8),
|
||||
Cl.uint(1e8)
|
||||
Cl.uint(1e8),
|
||||
],
|
||||
user
|
||||
)
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
@@ -477,7 +334,7 @@ describe(contracts.endpoint, () => {
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
)
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1001));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(false));
|
||||
@@ -494,10 +351,9 @@ describe(contracts.endpoint, () => {
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
manager
|
||||
),
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1001));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
|
||||
});
|
||||
expect(responses[1].result).toBeOk(Cl.bool(true));
|
||||
});
|
||||
});
|
||||
|
||||
192
tests/operators.test.ts
Normal file
192
tests/operators.test.ts
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
import { ParsedTransactionResult, tx } from '@hirosystems/clarinet-sdk';
|
||||
import { BooleanCV, Cl, IntCV, SomeCV, TupleCV, UIntCV } from '@stacks/transactions';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const accounts = simnet.getAccounts();
|
||||
const user = accounts.get('wallet_1')!;
|
||||
const oracle = accounts.get('wallet_2')!;
|
||||
const bot = accounts.get('wallet_3')!;
|
||||
const manager = accounts.get('wallet_4')!;
|
||||
const operator3 = accounts.get('wallet_5')!;
|
||||
|
||||
const contracts = {
|
||||
endpoint: 'lqstx-mint-endpoint-v1-01',
|
||||
registry: 'lqstx-mint-registry',
|
||||
vault: 'lqstx-vault',
|
||||
lqstx: 'token-lqstx',
|
||||
vlqstx: 'token-vlqstx',
|
||||
wstx: 'token-wstx',
|
||||
strategy: 'mock-strategy',
|
||||
rebase: 'lisa-rebase',
|
||||
rebase1: 'rebase-mock',
|
||||
amm: 'amm-swap-pool-v1-1',
|
||||
wlqstx: 'token-wlqstx',
|
||||
dao: 'lisa-dao',
|
||||
boot: 'regtest-boot',
|
||||
manager: 'mock-strategy-manager',
|
||||
operators: 'operators',
|
||||
proposal: 'mock-proposal',
|
||||
proposal2: 'mock-proposal',
|
||||
};
|
||||
|
||||
const prepareTest = () =>
|
||||
simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.dao,
|
||||
'construct',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.boot)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
const expectProposalDataToBe = (proposedAt: number, signals: number, executed: boolean) => {
|
||||
const proposalData = simnet.getMapEntry(
|
||||
contracts.operators,
|
||||
'proposals',
|
||||
Cl.contractPrincipal(simnet.deployer, contracts.proposal)
|
||||
) as SomeCV<TupleCV<{ 'proposed-at': UIntCV; signals: IntCV; executed: BooleanCV }>>;
|
||||
expect(proposalData.value).toStrictEqual(
|
||||
Cl.tuple({
|
||||
'proposed-at': Cl.uint(proposedAt),
|
||||
signals: Cl.int(signals),
|
||||
executed: Cl.bool(executed),
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
describe('operators contract', () => {
|
||||
it('operator extension works', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
bot
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1001));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(false));
|
||||
|
||||
responses = simnet.mineBlock([
|
||||
// signal from non-operator fails with unauthorized
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
bot
|
||||
),
|
||||
// second signal from 1st operator fails with double signal error
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
simnet.deployer
|
||||
),
|
||||
// signal from 2nd operator
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
manager
|
||||
),
|
||||
// 2nd signal from 2nd operator fails as proposal expired
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
manager
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(1001));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1002)); // err-already-signalled
|
||||
expect(responses[2].result).toBeOk(Cl.bool(true));
|
||||
expect(responses[3].result).toBeErr(Cl.uint(1003)); // err-proposal-expired
|
||||
});
|
||||
|
||||
it('contra operator out-weighs two pro operators', () => {
|
||||
prepareTest().map((e: any) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
let response;
|
||||
response = simnet.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
);
|
||||
expect(response.result).toBeOk(Cl.bool(false));
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
// signal from 2nd operator against proposal
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(false)],
|
||||
manager
|
||||
),
|
||||
// signal from 3nd operator for proposal
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'signal',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal), Cl.bool(true)],
|
||||
operator3
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(false));
|
||||
expect(responses[1].result).toBeOk(Cl.bool(false));
|
||||
});
|
||||
|
||||
it('signals should be reset when reproposed', () => {
|
||||
prepareTest().map((e: ParsedTransactionResult) => expect(e.result).toBeOk(Cl.bool(true)));
|
||||
|
||||
let responses = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
),
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
expect(responses[0].result).toBeOk(Cl.bool(false));
|
||||
expect(responses[1].result).toBeErr(Cl.uint(1005));
|
||||
expectProposalDataToBe(4, 1, false);
|
||||
|
||||
let responses2 = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
expect(responses2[0].result).toBeErr(Cl.uint(1005)); // not yet expired
|
||||
|
||||
simnet.mineEmptyBlocks(143);
|
||||
let responses3 = simnet.mineBlock([
|
||||
tx.callPublicFn(
|
||||
contracts.operators,
|
||||
'propose',
|
||||
[Cl.contractPrincipal(simnet.deployer, contracts.proposal)],
|
||||
simnet.deployer
|
||||
),
|
||||
]);
|
||||
expect(responses3[0].result).toBeOk(Cl.bool(false));
|
||||
|
||||
expectProposalDataToBe(149, 1, false);
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/// <reference types="vitest" />
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
Reference in New Issue
Block a user