The identified vulnerability is in the TokenFactory
contract, specifically in the handling of asset uniqueness. The contract currently uses the token symbol as the key determinant for identifying and registering tokens. However, token symbols are not guaranteed to be unique across different tokens or collections. Two distinct tokens can have identical symbols, leading to potential conflicts and misidentification in the system.
This issue is exacerbated in the context of TokenFactory.sol
, where the mapping s_tokenToAddress
could associate multiple different tokens with the same symbol, leading to unpredictable behavior and potential for errors.
The impact of this vulnerability can be significant. If two different tokens with the same symbol are deployed through the TokenFactory
, it could lead to confusion and errors in token management. Operations intending to interact with one token might inadvertently affect another, potentially causing misallocation of assets, incorrect token balances, and other operational discrepancies.
To mitigate this risk, it is recommended to use a more reliable and unique identifier for tokens. The most suitable candidate for this unique identifier is the token's contract address. Contract addresses are inherently unique on the Ethereum blockchain, ensuring that each token deployed through the TokenFactory
is distinctly identifiable.
Modify the Identifier: Change the mapping in TokenFactory
from using token symbols to using token contract addresses as keys.
Update Deployment Logic: Ensure that the token's address, rather than its symbol, is used for all identification and registration purposes within the contract.
This approach ensures that each token registered in the TokenFactory
is uniquely identifiable by its address, eliminating the risk of symbol-based conflicts and enhancing the robustness of the token management system.
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.