Platform: Code4rena
Start Date: 02/08/2022
Pot Size: $50,000 USDC
Total HM: 12
Participants: 69
Period: 5 days
Judge: gzeon
Total Solo HM: 5
Id: 150
League: ETH
Rank: 49/69
Findings: 1
Award: $69.66
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0xDjango, 0xNazgul, 0xc0ffEE, 8olidity, Bnke0x0, Chom, CodingNameKiki, Deivitto, Dravee, Funen, JC, JohnSmith, NoamYakov, ReyAdmirado, Rohan16, Rolezn, Sm4rty, SooYa, TomFrenchBlockchain, TomJ, Waze, __141345__, ajtra, ak1, aysha, bin2chen, bobirichman, brgltd, bulej93, c3phas, delfin454000, durianSausage, erictee, fatherOfBlocks, gogo, horsefacts, hyh, ladboy233, mics, natzuu, nxrblsrpr, oyc_109, rbserver, samruna, sikorico, simon135, tofunmi, wagmi
69.6581 USDC - $69.66
@param
statementMIMOManagedRebalance.sol: L138-147
@param managedVault ManagedVault struct of the vault to rebalance @param rbData RebalanceData struct of the vault to rebalance @param vaultsData Cached VaultsDataProvider interface for gas saving */ function _preRebalanceChecks( ManagedVault memory managedVault, IMIMORebalance.RebalanceData calldata rbData, IVaultsDataProvider vaultsData, uint256 rebalanceAmount ) internal view {
@param
statement is missing for rebalanceAmount
The same typo (reblanced
) occurs in all three lines referenced below:
@param assets Address array with one element corresponding to the address of the reblanced asset
Change reblanced
to rebalanced
in each case
@notice Only intended to be hold the logic for paking delegateCalls from a MIMOProxy
Change paking
to packing
The same typo (aggegator
) occurs in both lines referenced below:
@param swapData SwapData struct containing aggegator swap parameters
Change aggegator
to aggregator
in both cases
@notice Helper function calculating the amount to rebalance from vault A and to mint from vault B with rebalnce formula
Change rebalnce
to rebalance
@param vaultState VaultState struct og the vault to rebalance
Change og
to of
@title A `SuperVault V2` action contract for configuring a vault to have a manged rebalance.
Change manged
to managed
// Log the proxy via en event.
Change en
to an
In theory, comments over 79 characters should wrap using multi-line comment syntax. Even if somewhat longer comments are acceptable, there are cases where very long comments interfere with readability. Below are five instances of long comments that could be improved by wrapping, as shown:
@param initiator The address of the initiator of the flashloan; used to check that only flashloans taken from this contract can do vault operations @param params Bytes sent in the _takeFlashLoan calls that encode any additional needed information to complete the transaction
Suggestion:
@param initiator The address of the initiator of the flashloan — used to check that only flashloans taken from this contract can do vault operations. @param params Bytes sent in the _takeFlashLoan calls that encode any additional needed information to complete the transaction.
/// @notice Wrap ETH and deposit WETH as collateral into a vault, all through a delegatecall to a MIMOProxy clone.
Suggestion:
/// @notice Wrap ETH and deposit WETH as collateral into a vault, /// all through a delegatecall to a MIMOProxy clone.
MIMOAutoRebalance.sol: L252-261
/** @notice Helper function performing post rebalance operation sanity checks @dev Checks that change in global vault value (vault A + B) is below allowedVaration and vault A ratio equal or above targetRatio @param autoVault AutomatedVault struct of the vault to rebalance @param rebalanceAmount Rebalanced amount @param vaultBBalanceBefore Collateral balance of the vault to be rebalanced to before the rebalance operation @param vaultId Vault id of the vault to rebalance @param vaultOwner Rebalanced vault owner @param vaultsData Cached VaultsDataProvider interface for gas saving */
Suggestion:
/** @notice Helper function performing post rebalance operation sanity checks @dev Checks that change in global vault value (vault A + B) is below allowedVaration and vault A ratio equal or above targetRatio. @param autoVault AutomatedVault struct of the vault to rebalance @param rebalanceAmount Rebalanced amount @param vaultBBalanceBefore Collateral balance of the vault to be rebalanced to before the rebalance operation. @param vaultId Vault id of the vault to rebalance @param vaultOwner Rebalanced vault owner @param vaultsData Cached VaultsDataProvider interface for gas saving */
MIMOManagedRebalance.sol: L12-15
/** @title A `SuperVault V2` action contract for configuring a vault to have a manged rebalance. @notice This contract only serves to change the access control and enforce the `managedRebalance` configuration; the actual rebalance logic is done through the `MIMORebalance` contract through a `delegateCall` from a `MIMOProxy` clone */
Suggestion:
/** @title A `SuperVault V2` action contract for configuring a vault to have a managed rebalance. @notice This contract only serves to change the access control and enforce the `managedRebalance` configuration — the actual rebalance logic is done through the `MIMORebalance` contract through a `delegateCall` from a `MIMOProxy` clone. */
/// @notice Returns a boolean flag that indicates whether the envoy has permission to call the given target contract's given selector method
Suggestion:
/// @notice Returns a boolean flag that indicates whether the envoy has permission /// to call the given target contract's given selector method.
Terms incorporating "white," "black," "master" or "slave" are potentially problematic. Substituting more neutral terminology is becoming common practice.
@dev Supports any aggregators whitelisted by the DexAddressProvider
Suggestion: Change whitelisted
to allowlisted
Similarly for the following instances of whitelist
and its variants: