Algo Ssstablecoinsss

AI First Flight #2
Beginner FriendlyDeFi
EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

CollateralDeposited event does not log the collateral token address

Root + Impact

Description

The CollateralDeposited event logs only the user and the amount — it does not record which collateral token was deposited. In a two-collateral system (WETH and WBTC) there is no way to tell from the event whether a deposit was WETH or WBTC. The sibling event CollateralRedeemed does include the token, so this is also inconsistent.

@> event CollateralDeposited:
@> user: indexed(address)
@> amount: indexed(uint256)

Compare with the redeem event, which logs the token:

event CollateralRedeemed:
token: indexed(address)
amount_collateral: indexed(uint256)
_from: address
_to: address

Risk

Likelihood: High — every single deposit emits this event, so the missing field affects all deposits.

Impact: Low — no funds are at risk, but off-chain indexers, dashboards, and monitoring cannot attribute deposits to a collateral type, and deposit/withdraw accounting cannot be reconciled from events alone.

Proof of Concept

Depositing WETH and depositing WBTC emit byte-identical events (same user, same amount, no token field), so an observer cannot distinguish them. This is visible by inspection of the event definition and the _deposit_collateral log line:

log CollateralDeposited(msg.sender, amount_collateral)

Recommended Mitigation

Add the token address to the event, matching CollateralRedeemed.

event CollateralDeposited:
user: indexed(address)
+ token: indexed(address)
amount: indexed(uint256)
...
- log CollateralDeposited(msg.sender, amount_collateral)
+ log CollateralDeposited(msg.sender, token_collateral_address, amount_collateral)
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge 24 minutes ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!