# Action Contracts

### Super vault specific action contracts

Just like with the `PRBProxy` you need a "target" contract to do anything meaningful with `MIMOProxy`. This is basically a collection of stateless scripts executing specific logic. In the case of super vaults there are 5 different action contracts (one for each functionality) :&#x20;

* [MIMOEmptyVault](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimoemptyvault)
* [MIMOLeverage](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimoleverage)
* [MIMORebalance](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimorebalance)
* [MIMOAutoRebalance](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimoautorebalance)
* [MIMOManagedRebalance](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimomanagedrebalance)

All actions on the SuperVault contracts require flash loans and DEX aggregator swaps, and to perform these actions, the contracts must have permission to call back the delegate call through the `MIMOProxy` `execute` function. This is because the action contracts interact with other contracts, such as the Mimo core protocol or DEX aggregators, within the same transaction and are executed within the context of the `MIMOProxy`.&#x20;

However, when the AAVE Pool contract performs a callback through the `executeOperation` function, the logic switches from the `MIMOProxy` context to the action contract's context, preventing any access-controlled actions on `VaultsCore`. To reenter the `MIMOProxy` context, the action contract must perform a callback by calling the `MIMOProxy` `execute` with itself as the target. For this to happen, the action contract must be granted the correct permission by the `MIMOProxy` owner.

<figure><img src="https://1576197425-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdnKrtV1Ev2ILZ6C4SC%2Fuploads%2Fi8Fn91MncR6GJWkIyXbG%2FAction%20Contracts.svg?alt=media&#x26;token=6c3d8129-f502-4b92-932c-939463b3fbb2" alt=""><figcaption></figcaption></figure>

All of the above action contracts share 2 common struct passed in as arguments for flash loan and swaps :&#x20;

**`FlashLoanData`**

| Param Name    | Type    | Description                                              |
| ------------- | ------- | -------------------------------------------------------- |
| `asset`       | address | Asset to flash loan                                      |
| `proxyAction` | address | Address of the action contract performing the flash loan |
| `amount`      | uint256 | Flash loan amount                                        |

**`SwapData`**

| Param Name  | Type    | Description                                  |
| ----------- | ------- | -------------------------------------------- |
| `dexIndex`  | uint256 | Aggregator index in the `DexAddressProvider` |
| `dexTxData` | bytes   | Off chain route fetched from aggregator API  |

### Non super vault specific action contracts

The `MIMOProxy` also comes with non super vault specific action contracts :&#x20;

* [MIMOProxyActions](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimoproxyactions)
* [MIMOVaultActions](https://docs.parallel.best/developers-hub/parallel-v2/super-vault-sv/action-contracts/mimovaultactions)
