The buyOrder
function never checks that msg.sender
(buyer) is different from order.seller
. As a result, a seller can call buyOrder
on their own order. In that case, they effectively pay the protocol fee to the contract and receive their tokens back:
Since order.seller == msg.sender
, the contract sends the seller’s USDC back to themselves and returns the locked tokens. The seller only loses the fee. While not immediately catastrophic, this is unintended behavior and could waste fees or be used for manipulation (e.g. inflating volume).
Likelihood: Low
The seller would need to hold sufficient USDC to pay the fee. Usually sellers lock their tokens and have no remaining USDC, so this scenario is uncommon.
Impact: Low
The seller only pays a 3% fee (which goes to the protocol owner) and reclaims their tokens. No tokens are stolen, but fees are unnecessarily paid. It is still an inconsistent logic hole.
Here, the contract does not block Alice from buying her own order, and she ends up paying fees for no effective trade.
Simply adding a check at the start of buyOrder prevents this case. This ensures only third-party buyers can fill an order.
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.