# MIMOEmptyVault.sol executeOperation() does not transfer the Vault leftover assets to the owner, it is locked in the MIMOEmptyVault

MIMOEmptyVault's executeOperation repaid the flash loan but never returned leftover vault collateral to the owner, locking funds in the action contract.

- Payout: Contest reward
- Severity: high
- Program: Mimo DeFi
- Credited: bin2chen
- Disclosed: 2022-10-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-08-mimo-findings/issues/18
- Library page: https://bugbountylibrary.com/r/c4%3A2022-08-mimo%3AH-01
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** MIMOEmptyVault.sol executeOperation flash-loan callback
**Root cause:** executeOperation only approves/repays the flash loan amount but never transfers the remaining vaultCollateral balance back to the owner/mimoProxy, so excess collateral stays in the action contract.
**Steps:**
1. Deploy/execute emptyVault flow via mimoProxy.execute(emptyVault.address, MIMOProxyData) with 1inch swap.
2. Flash loan repays debt; flashloanRepayAmount < vaultCollateral.balanceOf(address(this)).
3. executeOperation returns true without transferring the surplus.
4. Log wmatic.balanceOf(emptyVault.address) before/after: 0 -> 44383268870065355782, confirming funds locked.
**How found:** Code review of executeOperation noticed the function approves the flash loan repayment but lacks any transfer of the remaining balance; confirmed by adding balance logs to the integration test showing nonzero residual balance.
**Exploitation:** Any vault owner emptying a vault via the MIMOEmptyVault action leaves surplus collateral permanently stranded in the action contract; no attacker extraction described, funds simply locked.
**Insight:** In flash-loan callback action contracts, check that surplus collateral after repayment is swept back to the owner; instrument integration tests with before/after token balances of the action contract to catch stranded funds.
