Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
In loan_manager/src/lib.rs deposit_collateral, the loan is loaded and status-checked, then token_client.transfer(&loan.borrower, contract, &amount) runs, and only afterward the loan is re-fetched (expect("loan not found")) and collateral_amount updated. The token transfer (an external call) happens between the read and the write, violating checks-effects-interactions; with a malicious or reentrant token the loan record could change or be removed between the two reads, and the second expect would panic or operate on stale state.
Acceptance criteria
Files to touch
Out of scope
- Supporting a separate collateral token
- Collateral valuation oracle
Why this matters
In loan_manager/src/lib.rs deposit_collateral, the loan is loaded and status-checked, then token_client.transfer(&loan.borrower, contract, &amount) runs, and only afterward the loan is re-fetched (expect("loan not found")) and collateral_amount updated. The token transfer (an external call) happens between the read and the write, violating checks-effects-interactions; with a malicious or reentrant token the loan record could change or be removed between the two reads, and the second expect would panic or operate on stale state.
Acceptance criteria
Files to touch
Out of scope