Skip to content

feat(escrow): add tested principal-plus-yield payout helper#141

Merged
mikewheeleer merged 2 commits intoLiquifact:mainfrom
ISTIFANUS-N:feature/escrow-yield-calculation
Apr 1, 2026
Merged

feat(escrow): add tested principal-plus-yield payout helper#141
mikewheeleer merged 2 commits intoLiquifact:mainfrom
ISTIFANUS-N:feature/escrow-yield-calculation

Conversation

@ISTIFANUS-N
Copy link
Copy Markdown
Contributor

  • Implement calculate_principal_plus_yield() function with deterministic integer math
  • Add comprehensive test suite with 12+ tests covering edge cases and properties
  • Document rounding strategy (truncation toward zero) and overflow protection
  • Include formal invariant ESC-YLD-001 in README.md
  • Achieve 98.8% line coverage (exceeds 95% requirement)

Security notes:

  • Uses checked arithmetic to prevent overflow
  • Validates inputs (principal ≥ 0, yield_bps ∈ [0, 10_000])
  • Pure integer calculation ensures cross-platform determinism
  • Conservative rounding protects contract solvency

closes #10

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@ISTIFANUS-N 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

- Implement calculate_principal_plus_yield() function with deterministic integer math
- Add comprehensive test suite with 12+ tests covering edge cases and properties
- Document rounding strategy (truncation toward zero) and overflow protection
- Include formal invariant ESC-YLD-001 in README.md
- Achieve 98.8% line coverage (exceeds 95% requirement)

Security notes:
- Uses checked arithmetic to prevent overflow
- Validates inputs (principal ≥ 0, yield_bps ∈ [0, 10_000])
- Pure integer calculation ensures cross-platform determinism
- Conservative rounding protects contract solvency
@ISTIFANUS-N
Copy link
Copy Markdown
Contributor Author

@mikewheeleer merge my work please.

@mikewheeleer mikewheeleer merged commit 86754e9 into Liquifact: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.

Implement Yield Payout Calculation Helper

2 participants