The rewards mapping in the LiquidationPool contract uses a rewards mapping to track the rewards a user can claim after assets are distributed among all stakers. The key of the mapping is the concatenation of the user address and the ERC-20 symbol. This could lead to bad consequences if two ERC-20 tokens have the same symbol, as they would be treated as the same token.
Here we can see how rewards are saved in the mapping:
And here we can see how they are claimed:
A loop over all accepted tokens is performed, and the rewards are claimed for each token.
ERC-20 symbols are not unique, so it is possible that two ERC-20 tokens have the same symbol. If this happens, the rewards of both tokens will be saved in the same mapping key. This can lead to loss for the user, or the protocol, depending on which token appears first in the list of accepted tokens and if they both vary in value.
There are more functions like for example removeCollateral
inside the SmartVaultV3 contract which rely on the token symbol:
If two ERC-20 tokens have the same symbol, the rewards of both tokens will be saved in the same mapping key. This can lead to loss for the user, or the protocol, depending on which token appears first in the list of accepted tokens and if they both vary in value. Other functionality in the contracts would also break when two tokens with the same symbol are used.
Use the token address instead of the symbol to save the rewards in the mapping.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.