Skip to content

core: implement vendor payment escrow in creditline #19

@EmeditWeb

Description

@EmeditWeb

Problem

When a loan is approved, there is no mechanism to
actually pay the vendor. The vendor never receives
funds.

What To Build

  1. Add vendor_paid flag to Loan struct
  2. Add pay_vendor() function
  3. Integrate with approve_loan() flow

Files To Touch

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

Acceptance Criteria

  • Vendor receives loan amount on approval
  • vendor_paid flag prevents double payment
  • Event emitted with payment details
  • Default scenario handled correctly
  • Token transfer uses stored token contract

Mandatory Checks Before PR

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

Metadata

Metadata

Assignees

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