Add fee/charity routing config so failure_destination slashes can split to a platform fee in accountability_vault
Description
slash_on_miss in contracts/accountability_vault/src/lib.rs sends the entire slashed amount to failure_destination. Add an optional basis-points platform fee routed to a fee address, with the remainder going to failure_destination (e.g. charity). This supports the backend Capital Flow & Fee Reporting domain. Validate the fee bps bound and ensure the split sums exactly to staked.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Add fee bps + fee address to
create_vault in contracts/accountability_vault/src/lib.rs
- Split the slash between fee and failure destinations
- Validate fee bps (0..=10000) and exact summation
- Add fee-split tests in
contracts/accountability_vault/src/test.rs
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/slash-fee-routing
- Implement changes
- Modify
contracts/accountability_vault/src/lib.rs
- Add tests in
contracts/accountability_vault/src/test.rs
- Document fee model in
contracts/README.md
- Add bps bound validation
- Test and commit
- Run tests, cover edge cases
- Include test output and notes
Example commit message
feat: add platform fee routing to slash settlement
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Add fee/charity routing config so failure_destination slashes can split to a platform fee in accountability_vault
Description
slash_on_missincontracts/accountability_vault/src/lib.rssends the entire slashed amount tofailure_destination. Add an optional basis-points platform fee routed to a fee address, with the remainder going tofailure_destination(e.g. charity). This supports the backend Capital Flow & Fee Reporting domain. Validate the fee bps bound and ensure the split sums exactly tostaked.Requirements and context
create_vaultincontracts/accountability_vault/src/lib.rscontracts/accountability_vault/src/test.rsSuggested execution
git checkout -b feat/slash-fee-routingcontracts/accountability_vault/src/lib.rscontracts/accountability_vault/src/test.rscontracts/README.mdExample commit message
feat: add platform fee routing to slash settlementGuidelines