Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions contracts/agent/agent-account.clar
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,32 @@
)
)

;; Execute a passed proposal through an approved voting contract
(define-public (execute-proposal
(votingContract <dao-core-proposals-trait>)
(proposalId uint)
(proposal <dao-proposal-trait>)
)
(begin
(asserts! (use-proposals-allowed) ERR_OPERATION_NOT_ALLOWED)
(asserts!
(is-approved-contract (contract-of votingContract) APPROVED_CONTRACT_VOTING)
ERR_CONTRACT_NOT_APPROVED
)
(print {
notification: "agent-account/execute-proposal",
payload: {
votingContract: (contract-of votingContract),
proposalId: proposalId,
proposal: (contract-of proposal),
sender: tx-sender,
caller: contract-caller
}
})
(as-contract (contract-call? votingContract execute-proposal proposalId proposal))
)
)

;; ============================================================
;; CONFIGURATION (owner or agent with permission)
;; ============================================================
Expand Down
5 changes: 5 additions & 0 deletions contracts/traits/agent-traits.clar
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
(<dao-core-proposals-trait> uint <dao-proposal-trait>)
(response bool uint)
)
;; Execute a passed + concluded proposal through the agent account
(execute-proposal
(<dao-core-proposals-trait> uint <dao-proposal-trait>)
(response bool uint)
)
))

;; Agent account configuration interface.
Expand Down
4 changes: 4 additions & 0 deletions contracts/traits/dao-traits.clar
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
(uint <proposal>)
(response bool uint)
)
(execute-proposal
(uint <proposal>)
(response bool uint)
)
(get-proposal-data
(uint)
(response
Expand Down