Skip to content

[Contract] Guild Treasury Withdrawal Cap (Per Transaction) #374

@gabito1451

Description

@gabito1451

Independence Note: Write this as a checking function inside a mock test scenario.

Context:
To mitigate impact of admin keys being compromised, we want a hard cap on how much can be withdrawn in a single transaction from the guild treasury.

Objective:
Implement a maximum withdrawal amount check.

Acceptance Criteria:

  • Add a max_withdrawal parameter in the Guild Configuration.
  • In the withdraw function, assert that amount <= max_withdrawal.
  • Return a custom ErrorCode::LimitExceeded if the amount is too high.
  • Include unit tests attempting to withdraw amounts both below and over the limit.

Technical Pointers:

  • This provides an extra layer of protection for the guild's long-term sustainability.

Metadata

Metadata

Assignees

No one assigned

    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