Search
K
Links
Comment on page

MIMOEmptyVault

The MIMOEmptyVault action contracts handle the super vault empty vault logic described in Empty Vault.

Process Flow

Write Methods

executeAction(bytes calldata _calldata) external

Uses a flashloan to repay all debts for a vault and send all collateral in the vault to the owner.
Requirements :
  • Contract must be unpaused
  • Must be called through the MIMOProxy execute() function
  • Targeted vault must have been created by the MIMOProxy
Param Name
Type
Description
_callData
bytes
Abi encoded bytes with :
  • uint256 vaultId
  • FlashloanData flData
  • SwapData swapData

executeOperation(address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata params

AAVE Pool contract flash loan callback function.
Requirements :
  • Contract must be unpaused
  • Can only be called by the AAVE Pool contract
  • Flash loan initiator must be the MIMOProxy
Param Name
Type
Description
assets
address[]
Address array with one element corresponding to the address of the target vault asset
amounts
uint256[]
Uint array with one element corresponding to the amount of the target vault asset
premiums
uint256[]
Uint array with one element corresponding to the flashLoan fees
initiator
address
Initiator of the flashloan; can only be MIMOProxy owner
params
bytes
Bytes sent by this contract containing MIMOProxy owner, target vault id, SwapData struct

emptyVaultOperation(address owner, IERC20 vaultCollateral, uint256 vaultId, uint256 swapAmount, uint256 flashLoanRepayAmount, SwapData calldata swapData)

Performs a empty vault logic within MIMOProxy context.
Requirements :
  • Contract must be unpaused
  • Must be called through the MIMOProxy execute() function
Param Name
Type
Description
owner
address
Address of the MIMOProxy owner
vaultCollateral
IERC20
Collateral of the vault to empty
vaultId
uint256
Vault id of the vault to be emptied
swapAmount
uint256
Amount of collateral to swap to for par to repay vault debt
flashLoanRepayAmount
uint256
Amount of collateral to repay to flash loan protocol at the end of the transaction
swapData
struct
SwapData passed from the flash loan call

View Methods

proxyFactory()
Returns the MIMOProxyFactory address.