Skip to content

[Bug][Contract] RemittanceNFT::apply_score_delta bounds scores to 0 violating MIN_CREDIT_SCORE invariant #1662

Description

@blurbeast

Issue #44

RemittanceNFT::apply_score_delta Bounds Scores to 0 Instead of Protocol Minimum (300)

  • Title: [Bug][Contract] RemittanceNFT::apply_score_delta bounds scores to 0 violating MIN_CREDIT_SCORE invariant
  • Labels: bug, contracts, medium
  • Location: contracts/remittance_nft/src/lib.rs:803
  • Description:
    apply_score_delta computes:
    let bounded_score = next_score.clamp(0, Self::MAX_SCORE as i64);
    decrease_score enforces Self::MIN_CREDIT_SCORE (300). Clamping to 0 allows negative score deltas to reduce borrower credit scores below the protocol-wide floor.
  • Impact:
    Credit scores can drop to 0, violating credit scoring tier assumptions across lending contracts and backend scoring engines.
  • Suggested Fix:
    Clamp next_score to [Self::MIN_CREDIT_SCORE as i64, Self::MAX_SCORE as i64].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions