Join our community: https://t.me/+DOylgFv1jyJlNzM0
Description
The event indexer in backend/src/services/eventIndexer.ts has a parser for a Seized event. If the contract emits this event under a different name (e.g., CollateralSeized, LoanDefaulted with a sub-type, or a different topic structure), the parser will never match it and seized loans will not be reflected in the database.
A mismatch between the event name in contracts/loan_manager/src/events.rs and the parser key in eventIndexer.ts means seized collateral is invisible to the backend.
Expected Behavior
- Audit
contracts/loan_manager/src/events.rs to confirm the exact event topic for collateral seizure
- Verify the event parser in
eventIndexer.ts uses the same exact string as the contract emits
- Add an integration test that runs the full flow: seize collateral on a test contract, run the indexer, and verify the loan status in the DB is updated to
Defaulted
Impact
Medium. If seized events are missed, defaulted loans show as still active in the UI and the borrower's credit score is never penalized.
Description
The event indexer in
backend/src/services/eventIndexer.tshas a parser for aSeizedevent. If the contract emits this event under a different name (e.g.,CollateralSeized,LoanDefaultedwith a sub-type, or a different topic structure), the parser will never match it and seized loans will not be reflected in the database.A mismatch between the event name in
contracts/loan_manager/src/events.rsand the parser key ineventIndexer.tsmeans seized collateral is invisible to the backend.Expected Behavior
contracts/loan_manager/src/events.rsto confirm the exact event topic for collateral seizureeventIndexer.tsuses the same exact string as the contract emitsDefaultedImpact
Medium. If seized events are missed, defaulted loans show as still active in the UI and the borrower's credit score is never penalized.