Skip to content

core: implement guarantee deposit locking in creditline #13

@EmeditWeb

Description

@EmeditWeb

Problem

The parameters contract requires a minimum guarantee
of 20% of the loan amount. But create_loan() never
actually verifies or locks this guarantee deposit.

What To Build

  1. Verify guarantee in create_loan()
  2. Add guarantee_amount to Loan struct
  3. Return guarantee on repayment
  4. Forward guarantee to pool on default

Files To Touch

  • contracts/creditline-contract/src/lib.rs
  • contracts/creditline-contract/src/types.rs
  • contracts/creditline-contract/src/tests.rs

Acceptance Criteria

  • create_loan() verifies guarantee amount
  • Insufficient guarantee rejected with typed error
  • Guarantee returned on repayment
  • Guarantee forwarded to pool on default
  • All existing tests updated and passing

Mandatory Checks Before PR

  • cargo build passes
  • All tests pass
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    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