Simply check by returned boolean value.
Change it to
require(!somethinghere)
Use require instead of &&
Issue
When there are multiple conditions in require statement, break down the require statement into
multiple require statements instead of using && can save gas.
Internal Function Called Only Once Can be Inlined
Issue
Certain function is defined even though it is called only once. Inline it instead to where it is called to avoid usage of extra gas.
PoC
Total of 2 instances found.
createEscrow() of Market.sol This function called only once at line 247 https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L226 https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L247
getWithdrawalLimitInternal() of Market.sol This function called only once at line 461 https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L353 https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/Market.sol#L461
Mitigation
I recommend to not define above functions and instead inline it at place it is called.
Boolean Comparisons
Issue
It is more gas expensive to compare boolean with "variable == true" or "variable == false" than directly checking the returned boolean value.
PoC
Mitigation
Simply check by returned boolean value. Change it to
Use require instead of &&
Issue
When there are multiple conditions in require statement, break down the require statement into multiple require statements instead of using && can save gas.
PoC
Mitigation
Break down into several require statement.