Summary
Protocol fees accumulate in the contract but there is currently no function to withdraw them. Without a withdrawal path, fees are permanently locked unless the contract is replaced. An admin-controlled withdrawal function lets the team move accumulated XLM to a multisig wallet or treasury address on demand.
Scope
- Add
withdraw_treasury(amount: i128, recipient: Address) function callable only by the protocol admin
amount must be greater than zero and not exceed the contract's current XLM balance reserved for treasury
- Contract must track treasury balance separately from funds held for key payments and pending dividends to prevent over-withdrawal
- Emits
TreasuryWithdrawal { amount, recipient, remaining_balance, ledger } event
- Add
get_treasury_balance() -> i128 view function returning the withdrawable treasury balance
- Partial withdrawals are allowed; full withdrawal leaves balance at zero
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
Protocol fees accumulate in the contract but there is currently no function to withdraw them. Without a withdrawal path, fees are permanently locked unless the contract is replaced. An admin-controlled withdrawal function lets the team move accumulated XLM to a multisig wallet or treasury address on demand.
Scope
withdraw_treasury(amount: i128, recipient: Address)function callable only by the protocol adminamountmust be greater than zero and not exceed the contract's current XLM balance reserved for treasuryTreasuryWithdrawal { amount, recipient, remaining_balance, ledger }eventget_treasury_balance() -> i128view function returning the withdrawable treasury balanceAcceptance Criteria
UnauthorizedTreasuryWithdrawalevent emitted with correct fieldsget_treasury_balancereflects the correct withdrawable amount at all timesETA: 24 hours
Coordinate on Telegram