This document is the canonical reference for every Soroban event emitted by QuickLendX. Off-chain indexers and analytics tools must use these exact topic strings and field positions.
Topics are frozen. Once deployed on a network, no existing topic string will be renamed or removed. New events may be added in future contract upgrades. Payload fields follow append-only ordering: existing field positions are frozen; new fields are appended at the end.
| Property | Guarantee |
|---|---|
| Timestamps | Always from env.ledger().timestamp() — tamper-proof Soroban clock |
| No PII | Only addresses, identifiers, and amounts are emitted |
| Auth context | All state-mutating events are gated by require_auth() upstream |
| Read-only purity | Getter functions emit zero events |
| Topic | Symbol | Description |
|---|---|---|
inv_up |
TOPIC_INVOICE_UPLOADED |
Business uploads a new invoice |
inv_ver |
TOPIC_INVOICE_VERIFIED |
Admin verifies an invoice |
inv_canc |
TOPIC_INVOICE_CANCELLED |
Business cancels an invoice |
inv_set |
TOPIC_INVOICE_SETTLED |
Invoice fully settled |
inv_def |
TOPIC_INVOICE_DEFAULTED |
Invoice marked as defaulted |
inv_exp |
TOPIC_INVOICE_EXPIRED |
Invoice bidding window expired |
inv_pp |
TOPIC_PARTIAL_PAYMENT |
Partial payment recorded |
pay_rec |
TOPIC_PAYMENT_RECORDED |
Atomic payment record stored |
inv_stlf |
TOPIC_INVOICE_SETTLED_FINAL |
All payments done, invoice Settled |
inv_fnd |
(inline) | Invoice transitions to Funded |
inv_meta |
(inline) | Invoice metadata updated |
inv_mclr |
(inline) | Invoice metadata cleared |
(invoice_id: BytesN<32>, business: Address, amount: i128,
currency: Address, due_date: u64, timestamp: u64)
| # | Field | Type | Description |
|---|---|---|---|
| 0 | invoice_id |
BytesN<32> |
SHA-256 derived unique identifier |
| 1 | business |
Address |
Authenticated uploading business |
| 2 | amount |
i128 |
Invoice face value |
| 3 | currency |
Address |
Token contract address |
| 4 | due_date |
u64 |
Payment deadline (Unix seconds) |
| 5 | timestamp |
u64 |
Ledger time of upload |
(invoice_id: BytesN<32>, business: Address, timestamp: u64)
(invoice_id: BytesN<32>, business: Address, timestamp: u64)
(invoice_id: BytesN<32>, business: Address, investor: Address,
investor_return: i128, platform_fee: i128, timestamp: u64)
investor_return + platform_fee ≤ payment_amount— enforced inprofits.rs.
(invoice_id: BytesN<32>, business: Address, investor: Address, timestamp: u64)
Emitted only after the grace period has elapsed past
due_date.
(invoice_id: BytesN<32>, business: Address, due_date: u64)
(invoice_id: BytesN<32>, business: Address, payment_amount: i128,
total_paid: i128, progress_bps: u32, transaction_id: String)
progress_bpsis in basis points (0–10 000).total_paidis monotonically increasing.
(invoice_id: BytesN<32>, payer: Address, amount: i128,
transaction_id: String, timestamp: u64)
(invoice_id: BytesN<32>, business: Address, investor: Address,
total_paid: i128, timestamp: u64)
Emitted exactly once per invoice when status transitions to
Settled.
| Topic | Symbol | Description |
|---|---|---|
bid_plc |
TOPIC_BID_PLACED |
Investor places a bid |
bid_acc |
TOPIC_BID_ACCEPTED |
Business accepts a bid |
bid_wdr |
TOPIC_BID_WITHDRAWN |
Investor withdraws bid |
bid_exp |
TOPIC_BID_EXPIRED |
Expired bid cleaned up |
(bid_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address,
bid_amount: i128, expected_return: i128, timestamp: u64, expiration_timestamp: u64)
(bid_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address,
business: Address, bid_amount: i128, expected_return: i128, timestamp: u64)
(bid_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address,
bid_amount: i128, timestamp: u64)
(bid_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address,
bid_amount: i128, expiration_timestamp: u64)
| Topic | Symbol | Description |
|---|---|---|
esc_cr |
TOPIC_ESCROW_CREATED |
Escrow created on bid acceptance |
esc_rel |
TOPIC_ESCROW_RELEASED |
Funds released to business |
esc_ref |
TOPIC_ESCROW_REFUNDED |
Funds returned to investor |
(escrow_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address,
business: Address, amount: i128)
(escrow_id: BytesN<32>, invoice_id: BytesN<32>, business: Address, amount: i128)
(escrow_id: BytesN<32>, invoice_id: BytesN<32>, investor: Address, amount: i128)
| Topic | Symbol | Description |
|---|---|---|
dsp_cr |
(inline) | Dispute opened |
dsp_ur |
(inline) | Dispute escalated to UnderReview |
dsp_rs |
(inline) | Dispute resolved |
(invoice_id: BytesN<32>, created_by: Address, reason: String, timestamp: u64)
(invoice_id: BytesN<32>, reviewed_by: Address, timestamp: u64)
(invoice_id: BytesN<32>, resolved_by: Address, resolution: String, timestamp: u64)
| Topic | Symbol | Description |
|---|---|---|
fee_upd |
(inline) | Platform fee configuration updated |
fee_rout |
(inline) | Fee routed to treasury |
fee_cfg |
(inline) | Fee bps reconfigured |
trs_cfg |
(inline) | Treasury address configured |
(fee_bps: i128, updated_at: u64, updated_by: Address)
| Topic | Symbol | Description |
|---|---|---|
aud_val |
(inline) | Audit integrity validated |
aud_qry |
(inline) | Audit logs queried |
(invoice_id: BytesN<32>, is_valid: bool, timestamp: u64)
(query_type: OpType, result_count: u32)
OpType is a #[contracttype] enum defined in audit.rs with variants: InvoiceCreated, InvoiceUploaded, InvoiceVerified, InvoiceFunded, InvoicePaid, InvoiceDefaulted, InvoiceStatusChanged, InvoiceRated, BidPlaced, BidAccepted, BidWithdrawn, EscrowCreated, EscrowReleased, EscrowRefunded, PaymentProcessed, SettlementCompleted.
When upgrading to a new contract version:
- Check the changelog for any new events (new topics will be documented here).
- Never rely on event position in the transaction events array — filter by topic.
- Field positions are frozen — you can safely deserialize by position index.
- New fields will only ever appear at the end of the payload tuple.
- Dropped events will never happen — topics are permanent once deployed.
cd quicklendx-contracts
cargo test test_events -- --nocaptureAll tests in src/test_events.rs pin exact topic strings and payload field order.