Root Cause: Misuse of the ERC20 constructor parameters.
Impact: The token name is incorrectly set, which can cause display issues in wallets, explorers, and dApps.
Medium: Medium Severity: It introduces functional confusion and can affect adoption, It introduces functional confusion and can affect adoption
The WToken contract incorrectly passes the symbol_ parameter twice in the ERC20 constructor instead of providing a proper name and symbol separately. This issue affects the readability and proper identification of the token in various platforms. While it does not impact the contract's functionality in transfers, approvals, and minting, it can create confusion for users and prevent proper integration with third-party services.
The constructor is incorrectly initialized with:
Instead of:
where name_ should be the full name of the token (e.g., "Wrapped Token"), and symbol_ should be the shorthand symbol (e.g., "WTK").
The developer mistakenly assumed that ERC20 only requires a symbol and duplicated its value instead of correctly assigning a token name.
Token explorers, wallets, and dApps may display the symbol in place of the name, leading to inconsistencies.
Some platforms require the name to be unique for proper indexing, which could affect visibility.
It can mislead users and developers interacting with the token.
Hardhat: For compiling and testing the contract.
OpenZeppelin ERC20: Reference documentation for expected behavior.
The following Hardhat test validates the issue by deploying the contract and checking if the token name is the same as the symbol:
Fail if the contract is correct (name ≠ symbol).
Pass if the contract is incorrect (name == symbol).
Modify the constructor to correctly accept a name_ parameter and pass it to the ERC20 constructor:
Added name_ as an explicit parameter.
Passed name_ instead of symbol_ in ERC20(name_, symbol_).
Ensured correct token metadata for wallet and dApp compatibility.
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.