Skip to content

Implement Withdrawing Undistributed or Residual Funds Mechanism #100

@thlpkee20-wq

Description

@thlpkee20-wq

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.rs covering 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions