Skip to content

feat: implement fee calculation and splitting logic for escrow contract#134

Merged
mikewheeleer merged 2 commits intoTalenttrust:mainfrom
winnpxl:feature/contracts-44-fee-accounting-tests
Apr 1, 2026
Merged

feat: implement fee calculation and splitting logic for escrow contract#134
mikewheeleer merged 2 commits intoTalenttrust:mainfrom
winnpxl:feature/contracts-44-fee-accounting-tests

Conversation

@winnpxl
Copy link
Copy Markdown
Contributor

@winnpxl winnpxl commented Mar 24, 2026

feat: Fee calculation and splitting for escrow contract
Closes #94

Description:

Changes

  • Implement fee calculation with floor rounding strategy
  • Add fee splitting among multiple recipients with primary recipient remainder handling
  • Integrate Treasury tracking for accumulated fees
  • Add data structures: FeeConfig, FeeRecipient, FeeSplit, Treasury

Testing

  • All 24 contract tests passing
  • 4 new fee splitting tests covering:
    • No remainder scenario
    • Remainder distribution to primary recipient
    • Multiple recipients (3+)
    • Edge cases

Verification

  • cargo +nightly check passes
  • cargo +nightly test --all-features passes
  • ✅ Compiled with nightly Rust 1.84.1

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@winnpxl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@winnpxl winnpxl force-pushed the feature/contracts-44-fee-accounting-tests branch 3 times, most recently from 66c84c0 to 180518f Compare March 25, 2026 10:22
@mikewheeleer
Copy link
Copy Markdown
Contributor

@winnpxl Resolve the conflicts

@mikewheeleer mikewheeleer assigned winnpxl and unassigned winnpxl Mar 27, 2026
- Add FeeConfig, FeeRecipient, FeeSplit, and Treasury data structures
- Implement calculate_fee() with floor rounding strategy
- Implement split_fee() with primary recipient remainder handling
- Implement update_treasury() for fee accumulation
- Add comprehensive tests for fee splitting scenarios (4 tests)
- All tests passing (20 contract tests + 2 additional tests)
- Support multiple fee authorization schemes (client-only, arbiter-only, multi-sig)
- Resolved conflicts with upstream/main
@winnpxl winnpxl force-pushed the feature/contracts-44-fee-accounting-tests branch from 277decb to ff0e60f Compare March 28, 2026 00:15
@winnpxl
Copy link
Copy Markdown
Contributor Author

winnpxl commented Mar 28, 2026

conflicts resolved @mikewheeleer , kindly merge

@mikewheeleer mikewheeleer merged commit df4af18 into Talenttrust:main Apr 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mike] 44. Fee accounting tests

2 participants