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: 50/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
Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
contracts/proxy/MIMOProxyFactory.sol contracts/proxy/MIMOProxy.sol contracts/proxy/MIMOProxyRegistry.sol contracts/proxy/interfaces/IMIMOProxyFactory.sol contracts/proxy/interfaces/IMIMOProxyRegistry.sol contracts/proxy/interfaces/IMIMOProxy.sol
contracts/proxy/MIMOProxyFactory.sol:2:pragma solidity >=0.8.4; contracts/proxy/MIMOProxy.sol:2:pragma solidity >=0.8.4; contracts/proxy/MIMOProxyRegistry.sol:2:pragma solidity >=0.8.4; contracts/proxy/interfaces/IMIMOProxyFactory.sol:2:pragma solidity ^0.8.4; contracts/proxy/interfaces/IMIMOProxyRegistry.sol:2:pragma solidity ^0.8.4; contracts/proxy/interfaces/IMIMOProxy.sol:2:pragma solidity ^0.8.4;
use fixed solidity version
Use a solidity version of at least 0.8.13 to get the ability to use using for with a list of free functions
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/proxy/MIMOProxyFactory.sol#L13
contracts/proxy/MIMOProxyFactory.sol:13: using Clones for address;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOLeverage.sol#L15
contracts/actions/MIMOLeverage.sol:15: using SafeERC20 for IERC20;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMORebalance.sol
contracts/actions/automated/MIMOAutoRebalance.sol:24: using SafeERC20 for IERC20; contracts/actions/automated/MIMOAutoRebalance.sol:25: using WadRayMath for uint256;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOFlashloan.sol#L16
contracts/actions/MIMOFlashloan.sol:16: using SafeERC20 for IERC20;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOVaultActions.sol#L17
contracts/actions/MIMOVaultActions.sol:17: using SafeERC20 for IERC20;
contracts/actions/managed/MIMOManagedAction.sol:10: using WadRayMath for uint256;
contracts/actions/managed/MIMOManagedRebalance.sol:17: using SafeERC20 for IERC20; contracts/actions/managed/MIMOManagedRebalance.sol:18: using WadRayMath for uint256;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOSwap.sol#L17
contracts/actions/MIMOSwap.sol:17: using SafeERC20 for IERC20;
https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOEmptyVault.sol#L15
contracts/actions/MIMOEmptyVault.sol:15: using SafeERC20 for IERC20;
contracts/actions/MIMORebalance.sol:15: using SafeERC20 for IERC20;
contracts/actions/automated/MIMOAutoAction.sol:10: using WadRayMath for uint256;
https://code4rena.com/reports/2022-05-sturdy/#n-06-use-a-more-recent-version-of-solidity
The attacker can initialize the contract, take malicious actions, and allow it to be re-initialized by the project without any error being noticed.
contracts/proxy/interfaces/IMIMOProxy.sol:17 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/proxy/interfaces/IMIMOProxy.sol#L17
contracts/proxy/interfaces/IMIMOProxy.sol:17: function initialize() external;
Each event
should use three indexed
fields if there are three or more fields
There are 2 instances: contracts/proxy/interfaces/IMIMOProxy.sol:9 contracts/proxy/interfaces/IMIMOProxyFactory.sol:11
contracts/proxy/interfaces/IMIMOProxy.sol:9: event Execute(address indexed target, bytes data, bytes response); contracts/proxy/interfaces/IMIMOProxyFactory.sol:11: event DeployProxy(address indexed deployer, address indexed owner, address proxy);
If the intention is for the Ether to be used, the function should call another function, otherwise it should revert (e.g. require(msg.sender == address(weth)))
There are 1 instances of this issue: contracts/proxy/MIMOProxy.sol:38
contracts/proxy/MIMOProxy.sol:38: receive() external payable {}