-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
Description
Design a mechanism for withdrawing residual or unclaimed funds from the contract (e.g., dust balances, expired claims) to a designated sink address or issuer.
Requirements and context
- Must define clear rules for when funds are considered residual or reclaimable.
- Must restrict withdrawal rights to appropriate admin/issuer roles.
- Must emit events describing what was withdrawn, from which offering/period, and to where.
Suggested execution
- Branch:
git checkout -b feature/residual-funds-withdrawal. - Decide whether residual accounting is per offering, per period, or global.
- Implement a function that aggregates and withdraws reclaimable balances to a configured address.
- Ensure calls cannot disrupt ongoing distributions or legitimate pending claims.
- Add tests in
src/test.rscovering valid withdrawals, forbidden withdraw attempts, and edge conditions around claim windows.
Test and commit
- Run
cargo test. - Cover scenarios with no residuals, small dust amounts, and large consolidations.
- Include test output and security commentary on how this mechanism should be used operationally.
Example commit message
feat(contracts): add residual funds withdrawal mechanism
Guidelines
- Minimum 95 percent test coverage.
- Clear documentation of reclaim conditions and security assumptions.
- Timeframe: 96 hours.
Reactions are currently unavailable