https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L49
PreMarktes.createOffer()
has a bunch of checks to ensure that created offer is correct. One of them checks whether user-provided eachTradeTax
parameter is correct. But instead of checking that this parameter doesn't exceed the maximum value for each trade tax, it checks whether it doesn't exceed 100% which is incorrect.
Users that willing to interact with this offer would need to pay a much bigger fee than it should be if offer owner wants to set it. Maker can make such huge eachTradeTax
in case there is a lot of demand where buy/sell points with this offer or resell points using this initial offer.
Check whether eachTradeTax
doesn't exceed EACH_TRADE_TAX_MAXINUM
instead of EACH_TRADE_TAX_DECIMAL_SCALER
:
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
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.