Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: low
Valid

s_tokenToAddress mapping can lead to collision

Summary

The mapping uses string tokenSymbol to store the tokenAddress addresses.

Vulnerability Details

The mapping s_tokenToAddress uses string tokenSymbol for key, as token symbol is usually comprised of 3 letters which can easily be reused and thus lead to overwriting existing entries and ultimately to loss of funds.

mapping(string tokenSymbol => address tokenAddress) private s_tokenToAddress;

This may lead to overwriting existing address and may cause lost of funds.

Impact

High as it may lead to loss of funds

Tools Used

Manual Review

Recommendations

Change the key of the mapping to a more robust implementation.

Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

deployToken: non-unique symbol for tokens

Support

FAQs

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