Submitted by kenzo, also found by IllIllI
Across the codebase, the protocol is usually checking that ERC20 transfers have succeeded by checking their return value.
This check is missing in MerkleVestings withdraw function.
If for some reason the ERC20 transfer is temporarily failing, the user would totally lose his allocation and funds.
All the state variables would already have been updated at this stage, so he cant call withdraw again.
There is no way to withdraw these locked tokens.
At the last point of withdraw, the function is sending the funds to the user, and does not check the return value - whether it has succeeded:
Note that this is (nicely and rightfully) done after all the state variables have been updated.
As the return value of the external call is not checked, if it has failed, the contract wouldnt know about it, and the function will finish successfully.
As done throughout the rest of the protocol, add a check that verifies that the transfer has succeeded.
illuzen (FactoryDAO) acknowledged, disagreed with severity and commented:
Justin Goro (judge) commented:
