Skip to content

fix(rental-yield): guard against integer overflow - #1406

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
NickiM84:fix/rental-yield-overflow
Oct 23, 2026
Merged

nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
NickiM84:fix/rental-yield-overflow

Conversation

@NickiM84

@NickiM84 NickiM84 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1372

  • Add u128-boundary overflow tests: deposit/set_shares/claim at or beyond u128::MAX must return Error::ArithmeticOverflow without mutating state, and boundary amounts (u128::MAX / PRECISION) are accepted exactly.
  • Document the overflow-guard review and static-analysis checklist in docs/RENTAL_YIELD_OVERFLOW_AND_STATIC_ANALYSIS.md, matching the existing per-contract overflow guide convention.
  • Remove the duplicated contracts/rental-yield entry from the workspace member list.

Description

Checklist

  • Tests added or updated
  • cargo test passes locally
  • Mutation gate passes: mutants-pass (nightly CI enforces this for lending, bridge, oracle)
  • cargo deny check passes
  • No new cargo audit advisories introduced

Related Issues

…1372)

- Add u128-boundary overflow tests: deposit/set_shares/claim at or beyond
  u128::MAX must return Error::ArithmeticOverflow without mutating state,
  and boundary amounts (u128::MAX / PRECISION) are accepted exactly.
- Document the overflow-guard review and static-analysis checklist in
  docs/RENTAL_YIELD_OVERFLOW_AND_STATIC_ANALYSIS.md, matching the existing
  per-contract overflow guide convention.
- Remove the duplicated `contracts/rental-yield` entry from the workspace
  member list.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanaf6203-bit
nanaf6203-bit merged commit 2e48441 into MettaChain:main Oct 23, 2026
1 of 2 checks passed
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.

Guard RentalYield against integer overflow

2 participants