Skip to content

[Contract] Guild Treasury Withdrawal Approval Delay (Timelock) #389

@gabito1451

Description

@gabito1451

Independence Note: Implement using a simple flag and sequence check in a mock test.

Context:
Even after a withdrawal is authorized (via multi-sig or admin), it should have a 24-hour mandatory "Timelock" window during which it can be cancelled by other members, preventing 'stealth' drains.

Objective:
Enforce a time delay for large treasury withdrawals.

Acceptance Criteria:

  • For any withdrawal over a certain threshold, set an earliest_execution_ledger sequence.
  • In the final execute_withdrawal function, assert that current sequence > earliest sequence.
  • Provide a cancel_withdrawal method allowed for the first 24 hours only.
  • Write unit tests demonstrating that the withdrawal fails if called too early.

Technical Pointers:

  • Timelocks are a fundamental security primitive in decentralized finance.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions