Submitted by neumo, also found by minhtrng, ladboy233, BClabs, and rvierdiiev
Market.sol#L281-L283
If a user creates a market with the INVEscrow implementation as escrowImplementation and false as callOnDepositCallback, the deposits made by users in the escrow (through the market) would not mint xINV tokens for them. As callOnDepositCallback is an immutable variable set in the constructor, this mistake would make the market a failure and the user should deploy a new one (even worse, if the error is detected after any user has deposited funds, some sort of migration of funds should be needed).
Both escrowImplementation and callOnDepositCallback are immutable:
and its value is set at creation:
When the user deposits collateral, if callOnDepositCallback is true, there is a call to the escrows onDeposit callback:
This is INVEscrows onDeposit function:
The thing is if callOnDepositCallback is false, this function is never called and the user does not turn his/her collateral (INV) into xINV.
Either make callOnDepositCallback a configurable parameter in Market.sol or always call the onDeposit callback (just get rid of the callOnDepositCallback variable) and leave it empty in case theres no extra functionality that needs to be executed for that escrow. In the case that the same escrow has to execute the callback for some markets and not for others, this solution would imply that there should be two escrows, one with the callback to be executed and another with the callback empty.
08xmt (Inverse) acknowledged, but disagreed with severity and commented:
