The market currently assumes that all escrow implementations comply with the IEscrow interface. This is currently not the case, which can lead to the deposit functionality being bricked.
Proof of Concept
If the callOnDepositCallback function is set to true during construction of a market, the deposit function will attempt to call onDeposit on the escrow:
Currently, only INVEscrow implements that function, while SimpleERC20Escrow and GovTokenEscrow do not. If they were to be used on a market with said callOnDepositCallback set to true the deposit function would always revert.
Tools Used
Manual Review
Recommended Mitigation Steps
Ensure that all escrow contracts inherit from IEscrow to have compile time safety and get immediate feedback on a contract being non-compliant. For the contracts that do not need a certain function, such as onDeploy in this case, leave the function body empty.
Lines of code
https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/GovTokenEscrow.sol#L19 https://github.com/code-423n4/2022-10-inverse/blob/3e81f0f5908ea99b36e6ab72f13488bbfe622183/src/escrows/SimpleERC20Escrow.sol#L16
Vulnerability details
Impact
The market currently assumes that all escrow implementations comply with the IEscrow interface. This is currently not the case, which can lead to the deposit functionality being bricked.
Proof of Concept
If the
callOnDepositCallback
function is set totrue
during construction of a market, thedeposit
function will attempt to callonDeposit
on the escrow:Currently, only
INVEscrow
implements that function, whileSimpleERC20Escrow
andGovTokenEscrow
do not. If they were to be used on a market with saidcallOnDepositCallback
set totrue
the deposit function would always revert.Tools Used
Manual Review
Recommended Mitigation Steps
Ensure that all escrow contracts inherit from
IEscrow
to have compile time safety and get immediate feedback on a contract being non-compliant. For the contracts that do not need a certain function, such asonDeploy
in this case, leave the function body empty.