Smart contract unable to operate due to lack of token funds
Permanent freezing of funds
Description
Brief/Intro
MoonwellUSDCStrategy and MoonwellWETHStrategy contracts interact with Moonwell mToken contracts (mint and redeemUnderlying) during allocation and deallocation but do not check the return values from these calls. Moonwell's mToken operations return error codes rather than reverting on failure, which means these strategy contracts proceedz as if operations succeeded when they actually failed, potentially leaving funds stuck or the protocol in an inconsistent state.
Vulnerability Details
According to Moonwell's documentation and contract code , , mToken operations follow a specific pattern:
The operations return uint error codes from the TokenErrorReporter enum , which includes various failure scenarios such as:
MATH_ERROR
INSUFFICIENT_LIQUIDITY
INSUFFICIENT_SHORTFALL
PRICE_ERROR
REJECTION
MoonwellUSDCStrategy and MoonwellWETHStrategy however do not check for this return value and proceed as if the operation succeeded, which can lead to silent failures. This means, upon allocation or deallocation, mint or redeemUnderlying may fail, return an error code, which the strategies do not check for.
Impact Details
Because the error code is not checked, allocations, deallocations will silently fail, and internal accounting may diverge from its actual holdings in Moonwell, potentially making the protocol unable to fulfill withdrawal requests. In worst-case scenarios, user funds could become permanently stuck in the strategy without a clear way to recover them.