When a maker creates an offer and sets a tax rate, the intention is for the maker to take a share of the future negotiations involving the points they have listed. However, the current implementation incorrectly sends the collected taxes to the reseller instead of the maker.
The issue stems from the logic in PreMarkets::_updateTokenBalanceWhenCreateTaker
, which does not correctly handle the tax distribution for offers marked with OfferSettleType.Protected. The current implementation mistakenly directs the trade tax to the reseller when it should be directed to the maker, as shown below:
This vulnerability leads to unexpected financial losses by the makers as the taxes intended for them are misallocated to resellers, who will in turn receive unintended financial benefits.
The impact is demonstrated in the test case below, which can be included in the PreMarkets.t.sol file:
Manual code review.
To avoid this issue, adjust the function PreMarkets::_updateTokenBalanceWhenCreateTaker
to send the tax income to the maker instead of the offer authority:
Valid high severity, In `settleAskTaker/closeBidTaker`, by assigning collateral token to user balance instead of point token, if collateral token is worth more than point, this can cause stealing of other users collateral tokens within the CapitalPool contract, If the opposite occurs, user loses funds based on the points they are supposed to receive
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.