Skip to content

Commit

Permalink
fix: use mainnet contracts directly for reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
whoabuddy committed Nov 25, 2024
1 parent d792ad5 commit 4bc0884
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 148 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
.cache/**
history.txt
node_modules
lcov.info
lcov.info
.aider*
.env
7 changes: 5 additions & 2 deletions Clarinet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ telemetry = true
cache_dir = './.cache'

[[project.requirements]]
contract_id = 'ST1NXBK3K5YYMD6FD41MVNP3JS1GABZ8TRVX023PT.nft-trait.nft-trait'
contract_id = 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait'

[[project.requirements]]
contract_id = 'ST1NXBK3K5YYMD6FD41MVNP3JS1GABZ8TRVX023PT.sip-010-trait-ft-standard'
contract_id = 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard'

[[project.requirements]]
contract_id = 'ST000000000000000000002AMW42H.pox-4'

[contracts.aibtc001-bootstrap]
path = 'contracts/dao/proposals/aibtc001-bootstrap.clar'
Expand Down
23 changes: 8 additions & 15 deletions contracts/dao/extensions/aibtcdev-treasury.clar
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
;;

(impl-trait .aibtcdev-extension-trait.extension-trait)
;; MAINNET: 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait
(use-trait ft-trait 'ST1NXBK3K5YYMD6FD41MVNP3JS1GABZ8TRVX023PT.sip-010-trait-ft-standard.sip-010-trait)
;; MAINNET: 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait
(use-trait nft-trait 'ST1NXBK3K5YYMD6FD41MVNP3JS1GABZ8TRVX023PT.nft-trait.nft-trait)
(use-trait ft-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
(use-trait nft-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)

;; constants
;;
Expand All @@ -18,11 +16,6 @@
(define-constant ERR_UNKNOWN_ASSSET (err u2001))
(define-constant TREASURY (as-contract tx-sender))

;; data vars
;;
(define-data-var poxContract principal 'SP000000000000000000002Q6VF78.pox-4)


;; data maps
;;

Expand Down Expand Up @@ -83,7 +76,7 @@
;; deposit FT to the treasury
(define-public (deposit-ft (ft <ft-trait>) (amount uint))
(begin
(asserts! (is-allowed (contract-of ft)) ERR_UNKNOWN_ASSSET)
(asserts! (is-allowed-asset (contract-of ft)) ERR_UNKNOWN_ASSSET)
(print {
notification: "deposit-ft",
payload: {
Expand All @@ -101,7 +94,7 @@
;; deposit NFT to the treasury
(define-public (deposit-nft (nft <nft-trait>) (id uint))
(begin
(asserts! (is-allowed (contract-of nft)) ERR_UNKNOWN_ASSSET)
(asserts! (is-allowed-asset (contract-of nft)) ERR_UNKNOWN_ASSSET)
(print {
notification: "deposit-nft",
payload: {
Expand Down Expand Up @@ -137,7 +130,7 @@
(define-public (withdraw-ft (ft <ft-trait>) (amount uint) (recipient principal))
(begin
(try! (is-dao-or-extension))
(asserts! (is-allowed (contract-of ft)) ERR_UNKNOWN_ASSSET)
(asserts! (is-allowed-asset (contract-of ft)) ERR_UNKNOWN_ASSSET)
(print {
notification: "withdraw-ft",
payload: {
Expand All @@ -155,7 +148,7 @@
(define-public (withdraw-nft (nft <nft-trait>) (id uint) (recipient principal))
(begin
(try! (is-dao-or-extension))
(asserts! (is-allowed (contract-of nft)) ERR_UNKNOWN_ASSSET)
(asserts! (is-allowed-asset (contract-of nft)) ERR_UNKNOWN_ASSSET)
(print {
notification: "withdraw-nft",
payload: {
Expand Down Expand Up @@ -183,7 +176,7 @@
sender: tx-sender
}
})
(match (as-contract (contract-call? (var-get poxContract) delegate-stx maxAmount to none none))
(match (as-contract (contract-call? 'SP000000000000000000002Q6VF78.pox-4 delegate-stx maxAmount to none none))
success (ok success)
err (err (to-uint err))
)
Expand All @@ -201,7 +194,7 @@
sender: tx-sender
}
})
(match (as-contract (contract-call? (var-get poxContract) revoke-delegate-stx))
(match (as-contract (contract-call? 'SP000000000000000000002Q6VF78.pox-4 revoke-delegate-stx))
success (begin (print success) (ok true))
err (err (to-uint err))
)
Expand Down
130 changes: 0 additions & 130 deletions deployments/default.simnet-plan.yaml

This file was deleted.

0 comments on commit 4bc0884

Please sign in to comment.