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

Findings: 2

Award: $310.26

🌟 Selected for report: 0

🚀 Solo Findings: 0

Table Of Content

QA REPORT

Missing 0 address check at transfer

Some contracts does not support 0 transfer, then the transaction will revert with no explanation. We recommend to add a require statement that the amount is not 0.

Code Instances:

Avoid floating pragma

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. (SWC-103)

Code Instances:

SPDX license not provided in source file

Before publishing, consider adding a comment containing 'SPDX-License-Identifier: MIT' at the beginning of each source file.

Code Instances:

Contract should have pause/unpause functionality

In case a hack is occuring or an exploit is discovered, the team (or validators in this case) should be able to pause functionality until the necessary changes are made to the system. Additionally, the gravity.sol contract should be manged by proxy so that upgrades can be made by the validators. Because an attack would probably span a number of blocks, a method for pausing the contract would be able to interrupt any such attack if discovered.)

Code Instances:

Array access is out of bounds

There is no check for the access to be in the array bounds.

Code Instances:

Make sure the following functions has to be payable

I didn't see a use of using payable in the following functions, consider changing it.

Code Instances:

Usage of pragma experimental ABIEncoder

ABIEncoder is turned on by default from version 8 For instance, DexAddressProvider.sol

Some of the following function specification is missing

Code Instances:

Several functions are declaring named returns but then are using return statements. I suggest choosing only one for readability reasons.

Using both named returns and a return statement isn't necessary. Removing one of those can improve code clarity. For instance, MIMOAutoRebalance.sol#L151

Events not emitted for important state changes

When changing state variables events are not emitted. Emitting events allows monitoring activities with off-chain monitoring tools.

Code Instances:

Add event to the following functions

Code Instances:

Consider removing the unused parameters names in the following functions

Code Instances:

Table Of Content

GAS REPORT

Using abiEncodePacked() is more efficient that abiEncode()

Code Instances:

The following assignments are not in use

Code Instances:

Don't cache msg.sender

reading msg.sender is 2 gas units which is less than a read of a local var + the unnecessary store operation.

Code Instances:

Use custom errors

In the following require statements you can use custom errors to save gas and improve code quality.

Code Instances:

Use assembly opcodes iszero instead of solidity equation to save gas

Code Instances:

If the function is onlyOwner you may make it payable to reduce gas usage.

For instance, DexAddressProvider.sol#L39

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