Skip to content

[contracts] Implement Treasury.withdraw_fees() #965

Description

@Ehonrie

Implement withdraw_fees() in contracts/treasury/src/lib.rs.

What to implement:

  • admin.require_auth() as first call
  • Verify amount <= BALANCE, panic otherwise
  • Deduct amount from BALANCE, transfer XLM to recipient
  • Append (recipient, amount, timestamp) to WITHDRAWAL_LOG
  • Emit FeesWithdrawn event

Acceptance Criteria:

  • Non-admin panics
  • Panics if amount exceeds balance
  • Balance decreases correctly
  • Withdrawal logged in WITHDRAWAL_LOG
  • Unit tests cover happy path and all errors

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