Skip to content

feat(contracts): add proposal expiry to MultisigGovernance #436

@Akpolo

Description

@Akpolo

💬 Want to contribute? Join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

Problem

Proposals in the MultisigGovernance contract never expire. Once created, a proposal can be finalized at any time in the future regardless of how old it is. This means:

  1. Old proposals with enough approvals can be executed years later
  2. No way to clean up stale proposals
  3. A compromised signer key could approve old dormant proposals

Expected Behavior

Proposals should have a configurable expiry window. After the expiry:

  1. The proposal cannot be approved or finalized
  2. Anyone should be able to call a cancel_expired_proposal(proposal_id) function to clean it up
  3. The expiry window should be configurable by admin (e.g. 30 days worth of ledgers)

Suggested Fix

In contracts/multisig_governance/src/lib.rs:

  1. Add an expires_at field to the Proposal struct (set to current_ledger + expiry_window on creation)
  2. In approve_proposal() and finalize_proposal(), check current_ledger <= proposal.expires_at
  3. Add a cancel_expired_proposal(proposal_id) function
  4. Add an expiry_window config stored in instance storage, settable by admin

Location

contracts/multisig_governance/src/lib.rs

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions