Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
883 changes: 269 additions & 614 deletions docs/contracts/dispute.md

Large diffs are not rendered by default.

352 changes: 213 additions & 139 deletions docs/contracts/settlement.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion quicklendx-contracts/src/analytics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ impl AnalyticsCalculator {

Ok(InvestorPerformanceMetrics {
total_investors: total_investors as u32,
verified_investors: verified_investors.len() as u32,
verified_investors: verified_investors.len(),
pending_investors: pending_investors.len() as u32,
rejected_investors: rejected_investors.len() as u32,
investors_by_tier,
Expand Down
13 changes: 13 additions & 0 deletions quicklendx-contracts/src/dispute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ fn assert_is_admin(_env: &Env, _admin: &Address) -> Result<(), QuickLendXError>
Ok(())
}

/// @notice Create a dispute on an invoice (standalone storage variant).
/// @dev Validates:
/// - No duplicate dispute for the same invoice
/// - Invoice exists and is in a disputable status (Pending/Verified/Funded/Paid)
/// - Creator is the business owner or investor on the invoice
/// - Reason is non-empty and <= MAX_DISPUTE_REASON_LENGTH (1000 chars)
/// - Evidence is non-empty and <= MAX_DISPUTE_EVIDENCE_LENGTH (2000 chars)
/// @param env The contract environment.
/// @param invoice_id The invoice to dispute.
/// @param creator The address creating the dispute (must be authorized).
/// @param reason The dispute reason (1–1000 chars).
/// @param evidence Supporting evidence (1–2000 chars).
/// @return Ok(()) on success, Err with typed error on failure.
#[allow(dead_code)]
pub fn create_dispute(
env: &Env,
Expand Down
Loading
Loading