The constructor of the OrderBook
contract does not validate the integrity of core token assignments, allowing logically incorrect token roles to go unnoticed.”
The deployer may accidentally or intentionally swaps the order of constructor arguments, (e.g., passing WSOL
where WETH
should be and vice versa, the contract will store incorrect references for core tokens)
Likelihood: Medium
Human error in deployment is common, especially when constructor arguments are similar in type and not validated.
Impact: Medium
Misclassification of core tokens may break the logic and assumption of the contract, affect UX
Users may be misled into buying or selling the wrong asset.
Add a new orderbook into contract TestOrderBook
Add the following test, then run forge test -vv --match-test test_misconfiguredOrderBook_swappedWETHandWSOL
PoC Results:
Inside OrderBook.sol
:
import IERC20Metadata
Add the name check for each core token into constructor
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.