-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from aibtcdev/feat/add-dao-skeleton
Implement collective functionality
- Loading branch information
Showing
104 changed files
with
1,973 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
contracts/dao/extensions/actions/aibtc-action-send-message.clar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(impl-trait .aibtcdev-dao-traits-v1.extension) | ||
(impl-trait .aibtcdev-dao-traits-v1.action) | ||
|
||
(define-constant ERR_UNAUTHORIZED (err u10001)) | ||
(define-constant ERR_INVALID_PARAMS (err u10002)) | ||
|
||
(define-public (callback (sender principal) (memo (buff 34))) (ok true)) | ||
|
||
(define-public (run (parameters (buff 2048))) | ||
(begin | ||
(try! (is-dao-or-extension)) | ||
(contract-call? .aibtc-onchain-messaging send (unwrap! (from-consensus-buff? (string-ascii 2043) parameters) ERR_INVALID_PARAMS) true) | ||
) | ||
) | ||
|
||
(define-private (is-dao-or-extension) | ||
(ok (asserts! (or (is-eq tx-sender .aibtcdev-base-dao) | ||
(contract-call? .aibtcdev-base-dao is-extension contract-caller)) ERR_UNAUTHORIZED | ||
)) | ||
) |
Oops, something went wrong.