Mimo August 2022 contest - samruna'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: 46/69

Findings: 2

Award: $106.54

🌟 Selected for report: 0

🚀 Solo Findings: 0

##1. Different version of solidity used It's better to use the same version of solidity for all contracts. In some of the contracts 0.8.4 is used and in some 0.8.10 is used. Make sure all references are corrected.

Code: https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/proxy/MIMOProxy.sol#L2 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOEmptyVault.sol#L2

Awards

39.0334 USDC - $39.03

Labels

bug
G (Gas Optimization)
sponsor disputed

External Links

1. Use of != 0 instead of > 0 for integer comparison

Use of != 0 instead of > 0 is more cheaper. Below code references can be updated to use !=0

Code: https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOLeverage.sol#L50 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMORebalance.sol#L135

2. Use of custom error and revert() instead of require()

Starting from Solidity v0.8.4, there is a convenient and gas-efficient way to explain to users why an operation failed through the use of custom errors. Until now, you could already use strings to give more information about failures (e.g., revert("Insufficient funds.");), but they are rather expensive, especially when it comes to deploy cost, and it is difficult to use dynamic information in them.

In the below code references, require can be replaced with if (a != b) revert ERROR()

Code: https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOEmptyVault.sol#L96 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOLeverage.sol#L130 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMORebalance.sol#L129 https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/actions/MIMOSwap.sol#L47-48

#0 - RayXpub

2022-08-10T16:06:22Z

Our documentation clearly states that item 1 should not be considered as a gas optimisation issue. As for item 2 some requires instead of custom errors are necessary here when the function is ran through delegatecall otherwise error message will not be decoded correctly see : https://github.com/paulrberg/prb-proxy/discussions/47

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