Skip to content

Add fee/charity routing config so failure_destination slashes can split to a platform fee in accountability_vault #362

@1nonlypiece

Description

@1nonlypiece

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

Metadata

Metadata

Assignees

Labels

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