For offchain orders to get fill according to the protocol if its a buy order the fill price must be less than or equal to the target price and if its a sell order the fill price must be greater than or equal to the target price and this isn't correctly implemented in the code.
We refer to settlementBranch.sol function fillOffchainOrders
from this portion of the code notice the comment section says the corrrect thing but the if statement for isBuyOrder being true is saying targetPrice is less than or equal to fillPrice which is contrary to the logic of the protocol and likewise the second part of the check for sellOrder is checking targetPrice is greater than or equal to fill price which is contrary to the logic of the protocol.
This could lead to buy orders being filled price greater than the target and sell orders being filled at price less than the target
manual review
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.