Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Commit 7802d55

Browse files
committed
style: Standardize formatting for action contracts
1 parent fb00c9f commit 7802d55

9 files changed

+184
-21
lines changed

contracts/dao/extensions/actions/aibtc-action-configure-timed-vault-sbtc.clar

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22
;; version: 1.0.0
33
;; summary: A predefined action to configure the BTC timed vaults.
44

5+
;; traits
6+
;;
7+
58
(impl-trait .aibtc-dao-traits-v3.extension)
69
(impl-trait .aibtc-dao-traits-v3.action)
710

11+
;; constants
12+
;;
13+
814
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
915
(define-constant ERR_INVALID_PARAMS (err u1101))
1016

17+
;; template variables
18+
;;
19+
1120
(define-constant CFG_MESSAGE "Executed Action Proposal: Updated configuration in BTC timed vault extension")
1221

22+
;; public functions
23+
;;
24+
1325
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1426

1527
(define-public (run (parameters (buff 2048)))
@@ -53,6 +65,9 @@
5365
)
5466
)
5567

68+
;; private functions
69+
;;
70+
5671
(define-private (is-dao-or-extension)
5772
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
5873
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION

contracts/dao/extensions/actions/aibtc-action-configure-timed-vault-stx.clar

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22
;; version: 1.0.0
33
;; summary: A predefined action to configure the STX timed vaults.
44

5+
;; traits
6+
;;
7+
58
(impl-trait .aibtc-dao-traits-v3.extension)
69
(impl-trait .aibtc-dao-traits-v3.action)
710

11+
;; constants
12+
;;
13+
814
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
915
(define-constant ERR_INVALID_PARAMS (err u1101))
1016

17+
;; template variables
18+
;;
19+
1120
(define-constant CFG_MESSAGE "Executed Action Proposal: Updated configuration in STX timed vault extension")
1221

22+
;; public functions
23+
;;
24+
1325
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1426

1527
(define-public (run (parameters (buff 2048)))
@@ -53,6 +65,9 @@
5365
)
5466
)
5567

68+
;; private functions
69+
;;
70+
5671
(define-private (is-dao-or-extension)
5772
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
5873
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION

contracts/dao/extensions/actions/aibtc-action-pmt-dao-toggle-resource.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-pmt-dao-toggle-resource
2+
;; version: 1.0.0
3+
;; summary: A predefined action to toggle a resource in the DAO payment processor extension.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Toggled resource status by name in the DAO payment processor extension")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -19,8 +35,11 @@
1935
)
2036
)
2137

38+
;; private functions
39+
;;
40+
2241
(define-private (is-dao-or-extension)
2342
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
24-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
43+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2544
))
2645
)

contracts/dao/extensions/actions/aibtc-action-pmt-sbtc-add-resource.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-pmt-sbtc-add-resource
2+
;; version: 1.0.0
3+
;; summary: A predefined action to add a resource in the BTC payment processor extension.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Added a resource in the BTC payment processor extension")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -22,8 +38,11 @@
2238
)
2339
)
2440

41+
;; private functions
42+
;;
43+
2544
(define-private (is-dao-or-extension)
2645
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
27-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
46+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2847
))
2948
)

contracts/dao/extensions/actions/aibtc-action-pmt-sbtc-toggle-resource.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-pmt-sbtc-toggle-resource
2+
;; version: 1.0.0
3+
;; summary: A predefined action to toggle a resource in the BTC payment processor extension.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Toggled resource status by name in the BTC payment processor extension")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -19,8 +35,11 @@
1935
)
2036
)
2137

38+
;; private functions
39+
;;
40+
2241
(define-private (is-dao-or-extension)
2342
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
24-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
43+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2544
))
2645
)

contracts/dao/extensions/actions/aibtc-action-pmt-stx-add-resource.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-pmt-stx-add-resource
2+
;; version: 1.0.0
3+
;; summary: A predefined action to add a resource in the STX payment processor extension.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Added a resource in the STX payment processor extension")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -22,8 +38,11 @@
2238
)
2339
)
2440

41+
;; private functions
42+
;;
43+
2544
(define-private (is-dao-or-extension)
2645
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
27-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
46+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2847
))
2948
)

contracts/dao/extensions/actions/aibtc-action-pmt-stx-toggle-resource.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-pmt-stx-toggle-resource
2+
;; version: 1.0.0
3+
;; summary: A predefined action to toggle a resource in the STX payment processor extension.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Toggled resource status by name in the STX payment processor extension")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -19,8 +35,11 @@
1935
)
2036
)
2137

38+
;; private functions
39+
;;
40+
2241
(define-private (is-dao-or-extension)
2342
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
24-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
43+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2544
))
2645
)

contracts/dao/extensions/actions/aibtc-action-send-message.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
;; title: aibtc-action-send-message
2+
;; version: 1.0.0
3+
;; summary: A predefined action to send a message through the onchain messaging system.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
19+
20+
;; public functions
21+
;;
622

723
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
824

@@ -16,8 +32,11 @@
1632
)
1733
)
1834

35+
;; private functions
36+
;;
37+
1938
(define-private (is-dao-or-extension)
2039
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
21-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
40+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2241
))
2342
)

contracts/dao/extensions/actions/aibtc-action-treasury-allow-asset.clar

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
;; title: aibtc-action-treasury-allow-asset
2+
;; version: 1.0.0
3+
;; summary: A predefined action to allow or enable an asset for use in the treasury.
4+
5+
;; traits
6+
;;
7+
18
(impl-trait .aibtc-dao-traits-v3.extension)
29
(impl-trait .aibtc-dao-traits-v3.action)
310

4-
(define-constant ERR_UNAUTHORIZED (err u10001))
5-
(define-constant ERR_INVALID_PARAMS (err u10002))
11+
;; constants
12+
;;
13+
14+
(define-constant ERR_NOT_DAO_OR_EXTENSION (err u1100))
15+
(define-constant ERR_INVALID_PARAMS (err u1101))
16+
17+
;; template variables
18+
;;
619

720
(define-constant CFG_MESSAGE "Executed Action Proposal: Allowed or enabled asset for use in the treasury")
821

22+
;; public functions
23+
;;
24+
925
(define-public (callback (sender principal) (memo (buff 34))) (ok true))
1026

1127
(define-public (run (parameters (buff 2048)))
@@ -19,8 +35,11 @@
1935
)
2036
)
2137

38+
;; private functions
39+
;;
40+
2241
(define-private (is-dao-or-extension)
2342
(ok (asserts! (or (is-eq tx-sender .aibtc-base-dao)
24-
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED
43+
(contract-call? .aibtc-base-dao is-extension contract-caller)) ERR_NOT_DAO_OR_EXTENSION
2544
))
2645
)

0 commit comments

Comments
 (0)