Skip to content

[Contracts] RemittanceNFT update_score has a redundant/unreachable minimum-repayment check #13

@grantfox-oss

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

In remittance_nft/src/lib.rs update_score, after repayment_amount < min_repayment returns BelowMinimum, the next check if repayment_amount < Self::MIN_SCORE_UPDATE_REPAYMENT (100) returns InvalidRepaymentAmount, and later let points_i128 = repayment_amount / 100; if points_i128 == 0 { return Ok(()) } is dead because amounts below 100 already returned. The overlapping floors are confusing and partly unreachable.

Acceptance criteria

  • Consolidate the repayment-floor logic into a single clear check with one error variant
  • Remove or justify the now-unreachable points_i128 == 0 early return
  • Add tests for amounts at the boundaries (99, 100, below configured min) asserting the documented error
  • Update the doc comment to match the final logic

Files to touch

  • remittance_nft/src/lib.rs

Out of scope

  • Changing the points-per-repayment formula
  • Token-denomination handling

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

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