When a user deposits collateral, _deposit_collateral emits CollateralDeposited, but that event only carries the depositor and the amount — it does not include which collateral token was deposited. The protocol accepts multiple collateral tokens (WETH, WBTC, and anything a fork swaps in), so an off-chain consumer (indexer, accounting dashboard, liquidation bot) reading these logs cannot tell which asset a given deposit was for. Notably this is asymmetric with the sibling CollateralRedeemed event, which does include the token, so deposits and withdrawals cannot be reconciled per-asset from events alone.
Likelihood: Low — the event fires on every deposit, but the consequence is limited to off-chain observability, not on-chain fund safety.
Impact: Low — indexers/monitoring cannot attribute a deposit to a specific collateral token from logs, and deposit/redeem flows can't be reconciled per asset. No funds are at risk, but accounting/monitoring tooling is silently wrong for multi-collateral deployments.
The test decodes the emitted CollateralDeposited log and shows it has no field identifying the token, even though two different collaterals (WETH, WBTC) are supported. Using titanoboa/pytest:
The failing-by-design assertion is not hasattr(dep, "token"): the deposit log carries no token, so a consumer watching deposits across WETH and WBTC cannot attribute the amount to either asset.
Add the token to the event and emit it, mirroring CollateralRedeemed.
Why this fixes it: the deposit log now identifies the exact collateral token, so off-chain indexers can attribute each deposit to the right asset and reconcile it against CollateralRedeemed (which already carries the token). Indexing token lets consumers filter the log stream by collateral. This makes per-asset accounting and monitoring correct for every supported and forked collateral type.
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.