There isn't any kind of checks to stop the token factory owner from accidentally (or by being a victim of social engineering) deploying another token with same symbol as an already deployed token.
In TokenFactory
contract, s_tokenToAddress
uses token symbol as keys for the mapping. When a new token is stored to the mapping there are no checks if a token already has been deployed with the same symbol.
The address of the token will be overwritten with the new token's address and the old token's address will not be in the mapping anymore.
src/TokenFactory.sol
Tokens that were deployed in the past will not show as deployed anymore since they will not be in s_tokenToAddress
mapping.
Have a check to see if a token with that symbol was already deployed. If yes, do not deploy it again as this would overwrite the existing entry in s_tokenToAddress
mapping.
There could be valid reasons to update an address of a deployed token. Updating an address should be a deliberate action and a new function could be created that would update an address of an already deployed token.
Manual Audit
Foundry
New copy of L1Token is created my malicious actor
Token deployed with same symbol as an already-deployed token
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.