Overview
Build a reputation system that tracks on-chain behaviour for addresses. Payers earn points for paying on time; creators earn points for invoices that successfully release. Reputation scores can be queried and used as optional gate conditions on future invoices.
Requirements
rep_key(address) storage key (persistent) storing RepScore { paid_on_time: u32, late_pays: u32, invoices_released: u32, invoices_refunded: u32 }
- Update rep scores automatically on
release (creator + payers) and refund (creator penalty)
get_rep(env, address) -> RepScore read function
- Extend
InvoiceOptions with optional min_payer_rep: Option<u32> — reject pay calls from addresses below threshold
- Emit
RepUpdated { address, score } event after each update
- Write tests covering all rep update paths and the min_rep gate
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Build a reputation system that tracks on-chain behaviour for addresses. Payers earn points for paying on time; creators earn points for invoices that successfully release. Reputation scores can be queried and used as optional gate conditions on future invoices.
Requirements
rep_key(address)storage key (persistent) storingRepScore { paid_on_time: u32, late_pays: u32, invoices_released: u32, invoices_refunded: u32 }release(creator + payers) andrefund(creator penalty)get_rep(env, address) -> RepScoreread functionInvoiceOptionswith optionalmin_payer_rep: Option<u32>— rejectpaycalls from addresses below thresholdRepUpdated { address, score }event after each updateAcceptance Criteria
min_payer_repgate rejects low-rep payersget_repreturns correct accumulated scoresrep_keycargo test --workspacepasses with zero failurescargo clippy --all-targets -- -D warningsproduces zero warningsDefinition of Done
All CI checks must pass before the PR is reviewed.