https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L39-L157
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/libraries/Constants.sol#L20
PreMarkets::createOffer allows a user to create an offer with eachTradeTax more than Constants.EACH_TRADE_TAX_MAXINUM.
The user can even charge eachTradeTax of 10_000 (i.e. 100%).
eachTradeTax should not be more than Constants.EACH_TRADE_TAX_MAXINUM value i.e. 2000 (20%).
The PreMarkets::createOffer only makes sure that the eachTradeTax isn't greater than Constants.EACH_TRADE_TAX_DECIMAL_SCALER i.e. 10_000.
Likelihood: High
Impact: High - User can charge a eachTradeTax value of more than EACH_TRADE_TAX_MAXINUM
Overall severity is High
Manual Review
Change the condition in PreMarkets::createOffer function
Similar to issue #1323, Despite this off-by-one error of the intended check, the difference between 99% and 100% is minimal, so I believe whether or not 100% is allowed has minimal impact. Ultimately, takers should not be realistically creating offer with such tradeTax
A maximum tradeTax could be valuable to ensure makers do not abuse the tradeTax mechanism as a form of maker bonus. However, ultimately, it would still be user responsibility to take up offers with reasonable tradeTax. In addition, a maximum is already included in the Constants contract represented by EACH_TRADE_TAX_MAXINUM as seen here https://github.com/Cyfrin/2024-08-tadle/blob/72c93f73a26ec7472868cb509e8b454286810223/src/libraries/Constants.sol#L20
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.