The contract currently hardcodes token-to-symbol logic for a fixed set of tokens (wETH, wBTC, wSOL). While the owner is allowed to authorize additional tokens via setAllowedSellToken, the system lacks a dynamic mechanism to associate symbols with these new tokens. As a result, future tokens will not have a readable symbol in getOrderDetailsString, degrading UX and possibly affecting front-end or off-chain integrations.
The function getOrderDetailsString(uint256 _orderId) returns order details as a string. It relies on hardcoded if/else if logic to determine the token's symbol:
However, the setAllowedSellToken(...) function allows the owner to add support for arbitrary ERC-20 tokens. These newly added tokens will not have an associated symbol, causing the tokenSymbol to remain an empty string. This results in misleading or incomplete output.
Ambiguous or incomplete order data may mislead users and reduce trust in the UI
Off-chain services parsing or indexing orders may fail or misinterpret data.
Manual addition of new tokens to the frontend becomes error-prone and inconsistent with contract logic.
There is no scalable way to associate new tokens with their display names
Even though no funds are at risk, it disrupts a feature already exposed in the contract (setAllowedSellToken). The current implementation misleads developers and users by supporting dynamic tokens on-chain but hardcoding the rendering logic, which breaks UX and expected behavior.
Use the following POC inside testOrderBook.t.sol that assert that it missing the token symbol (in the order detail it is just empty)
Manual Code review
Refactor the contract to introduce a dynamic mapping of token addresses to their display symbols.
1/ Add a new state variable :
2/ Update setAllowedSellToken(...) to also accept a symbol:
3/ Modify getOrderDetailsString(...) to get the token symbol based on the mapping
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.