Any implementation relying on the getTokenAddressFromSymbol(...)
function could be returned a wrong address as a result over overwriting the token address.
Whenever the deployToken(...)
function is called by the owner to create a new token, the token address is stored in the s_tokenToAddress
mapping with the key being the token symbol. There are no checks preventing an overwrite to a previously initialized mapping key. This means that users relying on getTokenAddressFromSymbol(...)
could unknowingly be returned the wrong address at any point.
Users could unknowingly be returned the wrong address for a given symbol as a result of re-initialization of the s_tokenToAddress
mapping.
Test:
Result:
Manual review
Foundry
add the following to the top of the deployToken(...)
function:
require(s_tokenToAddress[symbol] == address(0), "Symbol already registered.");
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.