dsc_engine.vy emits a CollateralDeposited event on every deposit, but the event only carries the depositor and the amount — it does not include which collateral token was deposited:
The deposit path logs it without the token:
By contrast the sibling event CollateralRedeemed (same file) does include token. Because the engine supports two collateral tokens (WETH and WBTC), and is explicitly designed to be forked with an arbitrary basket of assets, an off-chain indexer, accounting system, or monitoring bot consuming CollateralDeposited cannot attribute a deposit to a specific collateral asset. This is an information-completeness defect, not a fund-loss bug: on-chain state (user_to_token_address_to_amount_deposited) remains correct, but any consumer that relies on events to reconstruct per-asset deposit balances is broken.
Likelihood: High
The malformed event is emitted on every single call to deposit_collateral / deposit_collateral_and_mint_dsc, for both supported collateral tokens.
Impact: Low
No funds are lost or stolen; contract accounting is unaffected.
Off-chain systems (indexers, dashboards, risk/liquidation monitors, accounting) that rebuild per-collateral deposit balances from logs produce incorrect results, and deposits of different tokens are indistinguishable in the event stream. This can cause operational errors and mis-reporting.
Add to tests/unit/test_dsc_engine.py (uses the existing dsce, some_user, weth, wbtc fixtures). The same user deposits two different collateral tokens; both emitted CollateralDeposited events are indistinguishable because neither exposes a token field.
Running mox test (or pytest) passes, confirming the deposit event stream cannot distinguish WETH deposits from WBTC deposits.
Add the collateral token to the event and log it, mirroring CollateralRedeemed:
After this change, each deposit event carries the collateral token, so off-chain consumers can attribute deposits per asset, consistent with CollateralRedeemed.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.