Skip to content

Implement execute_proposal Function #87

@bitfalt

Description

@bitfalt

Description

Implement the logic to execute a passed proposal. This function will iterate through the proposal's defined actions and execute them, such as calling the Treasury contract to transfer funds.
Acceptance Criteria:

  1. The execute_proposal function is implemented.
  2. The function includes the following checks (reverting if any fail):
    • The proposal's state must be Succeeded (i.e., voting has ended, quorum was met, and the passing threshold was reached).
    • The proposal must not have been executed already (check is_executed flag).
  3. The function sets the is_executed flag to true to prevent re-entrancy and double execution.
  4. The function iterates through the actions array stored in the Proposal struct.
  5. For each action, it makes an external contract call using call_contract_syscall with the specified target address, function selector, and calldata.
  6. A ProposalExecuted event is emitted with the proposal_id.

Metadata

Metadata

Assignees

Labels

onlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions