Submitted by 0xRajeev, also found by adelamo and pauliax_
Low-level calls call/delegatecall/staticcall return true even if the account called is non-existent (per EVM design).
Solidity documentation warns:
Market address may not exist as a contract (e.g. incorrect EOA address used in orders), in which case low-level calls still returns true/success. But the trade is assumed to have been successfully executed.
As a result, executeTrade() executes batch orders against a non-existing market contract due to a mistake in the trading interface. The transaction executes successfully without any side-effects because the market doesnt exist. Internal accounting is updated incorrectly.
See related High-severity finding in ToBs Audit of Hermez and ToBs Audit of Uniswap V3. Also see Warning in solidity documentation.
https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/Trader.sol#L121-L129
Recommend that makeOrder.market should be checked for contract existence before the low-level call, and then verified to be the actual market contract (but it is not verified as noted in the comment). Evaluate if this is a greater concern than undefined behavior.
