Settings
π
Request Financing
π
The Trade Book
loadingβ¦no trades yet
β
Actions
π
How this dApp works
π£
How to use
- Connect your wallet with the top-right Connect Wallet button β the dApp runs on the Sepolia testnet (chain id 11155111), so switch your wallet to Sepolia first.
- (First run) If the setup banner appears, paste the deployed MurabahaFinancing book address and press Use this book; you can also change address/network in β Settings and press Save & reload.
- Request financing in the Request Financing card: fill supplier, guarantor, cost price (AED-S), markup (β€ 50% of cost), number of installments and the asset, then press Request trade.
- Approve & fund β in the Actions card, type the trade id shown in The Trade Book. The Shariah board presses Shariah approve, then the financier presses Pay supplier.
- Confirm delivery β the buyer presses Confirm delivery once the goods arrive; repayment starts only after delivery.
- Repay β the buyer (or guarantor) presses Pay installment each period. Prepay the remainder at a discount with Settle early (rebate); if payments lapse, anyone can Mark default and the financier can Recover to me.
β
The process - what happens on-chain
- MurabahaFinancing.requestTrade() stores the supplier, guarantor, cost price, fixed markup, installment schedule, invoice hash and asset description, and sets the trade to Requested (markup capped at 50% of cost).
- MurabahaFinancing.approveTrade() β only a SHARIAH_ROLE holder (enforced by AccessControl) may move the trade to Approved.
- MurabahaFinancing.purchaseAsset() β the FINANCIER_ROLE pays the supplier directly in AED-S (MockStable), so title passes to the financier first (status Purchased).
- MurabahaFinancing.confirmDelivery() β the buyer confirms receipt, the trade becomes Delivered and the repayment clock starts.
- MurabahaFinancing.payInstallment() β the buyer or guarantor pays each due installment; missed payments add a late fee (latePenaltyBps) routed to the charity address, never to the financier. The last installment sets the trade to Settled.
- MurabahaFinancing.settleEarly() prepays the remaining installments with a rebate on the remaining markup; if missedInstallments exceed maxMissedInstallments, anyone may markDefault() and the financier may recover() the collected funds.
πΊ
Flow graph
Lifecycle: Requested β Approved β Purchased β Delivered β Repaying β Settled / Defaulted. Every transition is validated by the MurabahaFinancing state machine; role checks come from AccessControl.