Mimo August 2022 contest - CodingNameKiki's results

Bridging the chasm between the DeFi world and the world of regulated financial institutions.

General Information

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

Mimo DeFi

Findings Distribution

Researcher Performance

Rank: 38/69

Findings: 2

Award: $108.69

🌟 Selected for report: 0

🚀 Solo Findings: 0

1.Override function arguments that are unused should have the variable name removed or commented out to avoid compiler warnings

contracts/actions/automated/MIMOAutoAction.sol 32: function setAutomation(uint256 vaultId, AutomatedVault calldata autoParams) external override { 57: function getAutomatedVault(uint256 vaultId) external view override returns (AutomatedVault memory) { 64: function getOperationTracker(uint256 vaultId) external view override returns (uint256) {

contracts/actions/automated/MIMOAutoRebalance.sol 54: function rebalance(uint256 vaultId, IMIMOSwap.SwapData calldata swapData) external override {

contracts/actions/managed/MIMOManagedAction.sol 33: function setManagement(uint256 vaultId, ManagedVault calldata mgtParams) external override { 55: function setManager(address manager, bool isManager) external override { 70: function getManagedVault(uint256 vaultId) external view override returns (ManagedVault memory) { 77: function getOperationTracker(uint256 vaultId) external view override returns (uint256) { 84: function getManager(address manager) external view override returns (bool) {

contracts/proxy/MIMOProxy.sol 127: function multicall(address[] calldata targets, bytes[] calldata data) external override returns (bytes[] memory) {

contracts/proxy/MIMOProxyFactory.sol 33: function isProxy(address proxy) external view override returns (bool result) { 40: function deploy() external override returns (IMIMOProxy proxy) {

contracts/proxy/MIMOProxyRegistry.sol 33: function getCurrentProxy(address owner) external view override returns (IMIMOProxy proxy) {

  1. Unused/Empty receive()/fallback() function

contracts/proxy/MIMOProxy.sol 38: receive() external payable {}

  1. Unused named returns

contracts/proxy/MIMOProxyFactory.sol 40: function deploy() external override returns (IMIMOProxy proxy) {

  1. Public functions not called by the contract should be declared external instead

contracts/proxy/MIMOProxy.sol 104: function setPermission(

  1. Constants should be defined rather than using magic numbers

contracts/proxy/MIMOProxy.sol 30: minGasReserve = 5_000;

Awards

39.0334 USDC - $39.03

Labels

bug
G (Gas Optimization)
edited-by-warden

External Links

  1. Replacing && with || in the if statement saves gas

contracts/actions/automated/MIMOAutoAction.sol 36: if (mimoProxy != vaultOwner && vaultOwner != msg.sender) {

contracts/actions/managed/MIMOManagedAction.sol 37: if (mimoProxy != vaultOwner && vaultOwner != msg.sender) {

contracts/proxy/MIMOProxyRegistry.sol 49: if (address(currentProxy) != address(0) && currentProxy.owner() == owner) {

  1. Raplacing > with != in this if statement saves gas

contracts/actions/MIMOLeverage.sol 50: if (depositAmount > 0) {

contracts/actions/MIMORebalance.sol 135: if (fee > 0) {

contracts/actions/MIMOSwap.sol 56: if (response.length > 0) {

contracts/proxy/MIMOProxy.sol 92: if (response.length > 0) { 135: if (response.length > 0) {

  1. Unchecked {++i} instead of i++ and removing the applied zero to i, since the default value is zero anyways. These two things save a lot of gas. (Since it is for loop, the i can't overflow)

contracts/proxy/MIMOProxy.sol (Before) 132: for (uint256 i = 0; i < targets.length; i++) {

(After) 132: for (uint256 i; i < targets.length;) {
unchecked{ ++i; }

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter