Skip to content
Smart contracts Audit finding Intermediate

The return value of mint is not checked

The strategy contract calls the Moonwell mUSDC mint function but ignores its return value, which signals failure with a non-zero error code instead of reverting. If minting fails silently, the USDC transferred in for allocation can become stuck in the strategy and excluded from the vault's total assets.

ox9527 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

56737 sc medium the return value of mint is not checked

Submitted on Oct 20th 2025 at 04:25:20 UTC by @ox9527 for Audit Comp | Alchemix V3

Description

Brief/Intro

The MoonwellUSDCStrategy.sol::_allocate() invoke mUSDC::mint() to allocate assets , however the return value of it is not checked

Vulnerability Details

In the MoonwellUSDCStrategy.sol::_allocate()

Solidity
    function _allocate(uint256 amount) internal override returns (uint256) {
        require(TokenUtils.safeBalanceOf(address(usdc), address(this)) >= amount, "Strategy balance is less than amount");
        TokenUtils.safeApprove(address(usdc), address(mUSDC), amount);
        // Mint mUSDC with underlying USDC
        mUSDC.mint(amount); //@audit return value is not checked.
        return amount;
    }

Assets are first transferred from the Morpho V2 Vault, and then MYTStrategy.sol::deallocate() is invoked. If the mint operation fails silently (i.e., without reverting), the transferred assets can become stuck in the contract.

Impact Details

1.assets become stuck in the contract 2.Those assets are not included in the newTotalAssets calculation within the Morpho V2 Vault

References

Proof of Concept

Proof of Concept

Frist we can find the address of mUSDC on op network via this link https://docs.moonwell.fi/moonwell/protocol-information/contracts#op-mainnet-contract-addresses

The address is : https://optimistic.etherscan.io/address/0x8E08617b0d66359D73Aa11E11017834C29155525

the mint function :

Solidity

    /**
     * @notice Sender supplies assets into the market and receives mTokens in exchange
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param mintAmount The amount of the underlying asset to supply
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function mint(uint mintAmount) external override returns (uint) {
        (uint err, ) = mintInternal(mintAmount);
        return err;
    }


    function mintInternal(
        uint mintAmount
    ) internal nonReentrant returns (uint, uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
            return (
                fail(Error(error), FailureInfo.MINT_ACCRUE_INTEREST_FAILED),
                0
            );
        }
        // mintFresh emits the actual Mint event if successful and logs on errors, so we don't need to
        return mintFresh(msg.sender, mintAmount);
    }

@return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)

The original report as published on Immunefi, by ox9527. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The strategy ignores the error code returned by the external mint call, which reports failure by return value rather than by reverting.

Impact

Assets could become permanently stuck in the strategy and would not be counted in the vault's newTotalAssets calculation.

What the attacker needed

Mint call returns an error instead of reverting

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract can report a problem in two ways: by stopping everything (reverting) or by returning an error code. Here the lending market returns an error code when a deposit fails, but the strategy never looks at it, so it carries on as if the deposit worked. The money sent in for that deposit then sits in the wrong place and is not counted.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by ox9527

View all

13 more disclosed reports, best first.

More from Alchemix V3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.