QuickSwap and StellaSwap contest - mics's results

A concentrated liquidity DEX with dynamic fees.

General Information

Platform: Code4rena

Start Date: 26/09/2022

Pot Size: $50,000 USDC

Total HM: 13

Participants: 113

Period: 5 days

Judge: 0xean

Total Solo HM: 6

Id: 166

League: ETH

QuickSwap and StellaSwap

Findings Distribution

Researcher Performance

Rank: 39/113

Findings: 2

Award: $79.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Table Of Content

QA REPORT

Unused success return value

The following calls ignores the return value of the called function that might indicate the the call failed.

Code Instances:

Use safe math for solidity version <8

You should use safe math for solidity version <8 since there is no default over/under flow check it those versions.'

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:

Require with empty error message

The following instances of a require statements comes with no popper error message. That means in case of error thrown the user will not know the reason for the error. Consider adding an error message.

Code Instances:

Loss of precision by using division over possible multiplication

In cases of computing a / b < c you could improve precision by doing instead a < c * b.

Code Instances:

Use safeTransfer() instead transfer()

Use openzeppelin safeTransfer() method instead of transfer() in the following locations.

Code Instances:

Array access is out of bounds

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

Code Instances:

Missing two steps verification process

The process of transferring ownership is dangerous since typing the wrong address can lead to severe implications. It is better to have to steps verification process with set and claim functions to decrease the chances of human error. Consider changing to two steps verification process of transferring privileges. Human mistakes can happen.

Code Instances:

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:

Magical number should be documented and explained. Use a constant instead

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.

Code Instances:

Consider adding constant variables instead of hardcoded strings

A good practice is to use constant variables instead of hardcoded strings in the code.

Code Instances:

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:

#0 - 0xean

2022-10-06T17:17:29Z

Many of these findings are in out of scope test files.

Table Of Content

GAS REPORT

Not Efficient Struct Packing

By reordering the struct variables you can decrease the number of slots in use and therefore reduce the gas cost of using the struct.

For instance, AlgebraPool.sol#L675

Use assembly opcodes iszero instead of solidity equation to save gas

Code Instances:

Caching array size

In the following for loops consider caching the array size instead of loading it every iteration.

For instance, DataStorageTest.sol#L55

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