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

Overwrite mappings symbol -> ERC20

Summary

The TokenFactory contract uses a mapping from token symbols to addresses (s_tokenToAddress). However, it does not prevent the reuse of symbols. If the same symbol is used more than once, the new address will overwrite the previous one in the mapping. This could lead to confusion or misrepresentation of tokens, especially if symbols are expected to uniquely identify a token.

Vulnerability Details

If the owner of TokenFactory deploy a new contract using an already used symbol, accidentialy or not, the value will be overwritten and the previous mapping will be lost.

Impact

This can lead to the loss of mappings.

Tools Used

Manual analysis

Recommendations

Add checks to revert if a symbol is already used before deploying the new contract in deployToken function.

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.