code-423n4 / 2021-10-tally-findings

0 stars 0 forks source link

Events not indexed #22

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

harleythedog

Vulnerability details

Impact

None of the events in swap.sol are indexed, so it is not easy for off-chain tools to efficiently filter these events. I would recommend adding indices to the SwappedTokens and FeesSwept events. For SwappedTokens, I would recommend adding an index on the tokenSold and tokenBought fields. For FeesSwept, I would recommend adding an index on the token and recipient fields.

Proof of Concept

See event declarations here: https://github.com/code-423n4/2021-10-tally/blob/main/contracts/swap/Swap.sol#:~:text=event-,SwappedTokens,-(

Tools Used

Manual inspection

Recommended Mitigation Steps

Added indices as described above.