mirror of
https://github.com/zhigang1992/liquid-stacking.git
synced 2026-01-12 17:23:23 +08:00
Merge pull request #26 from alexgo-io/feat/empty-wallet
Remove sip 10, fix constant case
This commit is contained in:
@@ -151,10 +151,6 @@ epoch = 2.4
|
||||
path = "contracts/strategies/public-pools/xverse-member.clar"
|
||||
epoch = 2.4
|
||||
|
||||
[contracts.sip-010-trait]
|
||||
path = "contracts/traits/sip-010-trait.clar"
|
||||
epoch = 2.4
|
||||
|
||||
[contracts.rebase-strategy-trait]
|
||||
path = "contracts/deployed/rebase-strategy-trait.clar"
|
||||
epoch = 2.4
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;; lqstx-mint-registry
|
||||
;;
|
||||
|
||||
(use-trait sip-010-trait .sip-010-trait.sip-010-trait)
|
||||
(use-trait sip-010-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
(define-constant err-unknown-request-id (err u1008))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
;;
|
||||
;; lqstx-mint-endpoint
|
||||
;;
|
||||
(use-trait sip-010-trait .sip-010-trait.sip-010-trait)
|
||||
(use-trait sip-010-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
||||
(use-trait rebase-strategy-trait .rebase-strategy-trait.rebase-strategy-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
;;
|
||||
;; lqstx-mint-endpoint-v1-01
|
||||
;;
|
||||
(use-trait sip-010-trait .sip-010-trait.sip-010-trait)
|
||||
(use-trait sip-010-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u1000))
|
||||
(define-constant err-paused (err u1001))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .trait-sip-010.sip-010-trait)
|
||||
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
||||
|
||||
(define-fungible-token wlqstx)
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
(define-data-var contract-owner principal tx-sender)
|
||||
|
||||
;; errors
|
||||
(define-constant ERR-NOT-AUTHORIZED (err u1000))
|
||||
(define-constant ERR-MINT-FAILED (err u6002))
|
||||
(define-constant ERR-BURN-FAILED (err u6003))
|
||||
(define-constant ERR-TRANSFER-FAILED (err u3000))
|
||||
(define-constant ERR-NOT-SUPPORTED (err u6004))
|
||||
(define-constant err-not-authorized (err u1000))
|
||||
(define-constant err-mint-failed (err u6002))
|
||||
(define-constant err-burn-failed (err u6003))
|
||||
(define-constant err-transfer-failed (err u3000))
|
||||
(define-constant err-not-supported (err u6004))
|
||||
|
||||
(define-read-only (get-contract-owner)
|
||||
(ok (var-get contract-owner))
|
||||
@@ -32,7 +32,7 @@
|
||||
)
|
||||
|
||||
(define-private (check-is-owner)
|
||||
(ok (asserts! (is-eq tx-sender (var-get contract-owner)) ERR-NOT-AUTHORIZED))
|
||||
(ok (asserts! (is-eq tx-sender (var-get contract-owner)) err-not-authorized))
|
||||
)
|
||||
|
||||
(define-public (set-name (new-name (string-ascii 32)))
|
||||
@@ -71,7 +71,7 @@
|
||||
;; @returns (response uint)
|
||||
(define-read-only (get-total-supply)
|
||||
;; least authority Issue D
|
||||
ERR-NOT-SUPPORTED
|
||||
err-not-supported
|
||||
)
|
||||
|
||||
;; @desc get-name
|
||||
@@ -118,7 +118,7 @@
|
||||
;; @returns (response bool uint)/ error
|
||||
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 2048))))
|
||||
(begin
|
||||
(asserts! (or (is-eq tx-sender sender) (is-eq contract-caller sender)) ERR-NOT-AUTHORIZED)
|
||||
(asserts! (or (is-eq tx-sender sender) (is-eq contract-caller sender)) err-not-authorized)
|
||||
(contract-call? .token-lqstx transfer (/ (* amount (pow u10 (unwrap-panic (get-base-decimals)))) (pow-decimals)) sender recipient memo)
|
||||
)
|
||||
)
|
||||
@@ -150,7 +150,7 @@
|
||||
;; @returns (response uint)
|
||||
(define-read-only (get-total-supply-fixed)
|
||||
;; least authority Issue D
|
||||
ERR-NOT-SUPPORTED
|
||||
err-not-supported
|
||||
)
|
||||
|
||||
;; @desc get-balance-fixed
|
||||
@@ -172,11 +172,11 @@
|
||||
)
|
||||
|
||||
(define-public (mint (amount uint) (recipient principal))
|
||||
ERR-MINT-FAILED
|
||||
err-mint-failed
|
||||
)
|
||||
|
||||
(define-public (burn (amount uint) (sender principal))
|
||||
ERR-BURN-FAILED
|
||||
err-burn-failed
|
||||
)
|
||||
|
||||
(define-public (mint-fixed (amount uint) (recipient principal))
|
||||
@@ -204,7 +204,7 @@
|
||||
)
|
||||
|
||||
(define-private (transfer-from-tuple (recipient { to: principal, amount: uint }))
|
||||
(ok (unwrap! (transfer-fixed (get amount recipient) tx-sender (get to recipient) none) ERR-TRANSFER-FAILED))
|
||||
(ok (unwrap! (transfer-fixed (get amount recipient) tx-sender (get to recipient) none) err-transfer-failed))
|
||||
)
|
||||
|
||||
(define-public (send-many (recipients (list 200 { to: principal, amount: uint})))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(impl-trait .sip-010-trait.sip-010-trait)
|
||||
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
||||
|
||||
(define-constant err-unauthorised (err u3000))
|
||||
(define-constant err-not-token-owner (err u4))
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
;; SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
(define-trait sip-010-trait
|
||||
(
|
||||
;; Transfer from the caller to a new principal
|
||||
(transfer (uint principal principal (optional (buff 2048))) (response bool uint))
|
||||
|
||||
;; the human readable name of the token
|
||||
(get-name () (response (string-ascii 32) uint))
|
||||
|
||||
;; the ticker symbol, or empty if none
|
||||
(get-symbol () (response (string-ascii 32) uint))
|
||||
|
||||
;; the number of decimals used, e.g. 6 would mean 1_000_000 represents 1 token
|
||||
(get-decimals () (response uint uint))
|
||||
|
||||
;; the balance of the passed principal
|
||||
(get-balance (principal) (response uint uint))
|
||||
|
||||
;; the current total supply (which does not need to be a constant)
|
||||
(get-total-supply () (response uint uint))
|
||||
|
||||
;; an optional URI that represents metadata of this token
|
||||
(get-token-uri () (response (optional (string-utf8 256)) uint))
|
||||
)
|
||||
)
|
||||
@@ -127,11 +127,6 @@ plan:
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/lisa-dao.clar
|
||||
clarity-version: 2
|
||||
- emulated-contract-publish:
|
||||
contract-name: sip-010-trait
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/traits/sip-010-trait.clar
|
||||
clarity-version: 2
|
||||
- emulated-contract-publish:
|
||||
contract-name: lqstx-mint-registry
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
@@ -227,14 +222,14 @@ plan:
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/strategies/public-pools/fastpool-member.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 2
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: xverse-member1
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/strategies/public-pools/xverse-member.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 2
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: xverse-member10
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
@@ -355,14 +350,14 @@ plan:
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/traits/rebase-strategy-trait.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 3
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: regtest-boot
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
path: contracts/regtest-boot.clar
|
||||
clarity-version: 2
|
||||
epoch: "2.4"
|
||||
- id: 3
|
||||
transactions:
|
||||
- emulated-contract-publish:
|
||||
contract-name: simnet-boot
|
||||
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
|
||||
Reference in New Issue
Block a user