Skip to content

[Contracts] RemittanceNFT update_score has an unreachable points_i128==0 early-return after the MIN_SCORE_UPDATE_REPAYMENT guard #1147

Description

@grantfox-oss

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

Why this matters

remittance_nft/src/lib.rs:656-669: update_score rejects repayment_amount < MIN_SCORE_UPDATE_REPAYMENT (100) at line 656, then computes points_i128 = repayment_amount/100 (line 666) and does if points_i128 == 0 { return Ok(()) } (667-669). Once the 100-floor passes, repayment_amount>=100 so points_i128>=1, making the zero-branch dead code that can never execute.

Acceptance criteria

  • Remove the unreachable points_i128==0 branch (or add a comment/debug_assert documenting why it is retained)
  • Confirm existing update_score tests still pass

Files to touch

  • contracts/remittance_nft/src/lib.rs

Out of scope

  • Changing the MIN_SCORE_UPDATE_REPAYMENT value or scoring formula

Metadata

Metadata

Assignees

No one assigned

    Labels

    contractsIssues related to smart contractsgood first issueGood for newcomersnftNFT functionalityoptimizationCode optimizationrustPull requests that update rust code

    Type

    No type

    Fields

    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