Maia DAO Ecosystem - Qeew's results

Efficient liquidity renting and management across chains with Curvenized Uniswap V3.

General Information

Platform: Code4rena

Start Date: 30/05/2023

Pot Size: $300,500 USDC

Total HM: 79

Participants: 101

Period: about 1 month

Judge: Trust

Total Solo HM: 36

Id: 242

League: ETH

Maia DAO Ecosystem

Findings Distribution

Researcher Performance

Rank: 57/101

Findings: 2

Award: $205.71

Analysis:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

10.4044 USDC - $10.40

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-577

External Links

Lines of code

https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/talos/base/TalosBaseStrategy.sol#L206-L207

Vulnerability details

Impact

In the deposit function within the TalosBaseStrategy contract, both slippage for two tokens (amount0Min and amount1Min) are hardcoded to zero. This can have severe implications as users may unintentionally accept a minimum of zero output tokens from a swap.

Proof of Concept

https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/talos/base/TalosBaseStrategy.sol#L206-L207.

As seen here, the hardcoding of zero slippage could potentially result in significant losses for users due to receiving no output tokens from the swap.

Tools Used

Manual Review

It is advised to enable users to specify their preferred slippage. This will provide users with greater control reducing the risk of unexpected losses due to accepting swaps with no output tokens.

Assessed type

Other

#0 - c4-judge

2023-07-09T17:37:07Z

trust1995 marked the issue as duplicate of #828

#1 - c4-judge

2023-07-09T17:37:14Z

trust1995 marked the issue as satisfactory

#2 - c4-judge

2023-07-11T17:03:33Z

trust1995 marked the issue as duplicate of #177

#3 - c4-judge

2023-07-11T17:04:19Z

trust1995 changed the severity to 3 (High Risk)

#4 - c4-judge

2023-07-25T08:54:03Z

trust1995 changed the severity to 2 (Med Risk)

Findings Information

Awards

195.3093 USDC - $195.31

Labels

grade-b
satisfactory
sponsor confirmed
analysis-advanced
A-08

External Links

Codebase Analysis

The Evaluation of the codebase was adopted through Two approach: Firstly, an in-depth review of the documentation paired with a thorough examination of the implementation within the code. Secondly, the previous audit by Zellic was also dissected to better comprehend their suggestions and ensure the corrections are implemented.

An intriguing issue surfaced from this evaluation: a particular fix linked to the 'delete' keyword in Solidity. The link to this fix is: https://github.com/Maia-DAO/maia-ecosystem-monorepo/commit/a0dd03114eee73e8be2bb822a626faaade5b6452.

In Solidity, the 'delete' keyword traditionally resets a variable back to its initial state. However, for a struct containing a mapping, Solidity does not provide a distinct "zero" state to reset the mapping. This is primarily because mapping keys can neither be iterated nor cleared out.

Yet, upon careful observation, the 'Deposit' struct seemed devoid of any mappings. Consequently, the 'delete' operation should function as anticipated - it should eliminate the deposit information from the storage and prohibit any potential repetitive fund withdrawals.

Architecture Evaluation The architecture adheres to the industry standards. It is well-structured and clearly outlined, showcasing a meticulous design process.

Centralization Risks There are notable centralization risks present, particularly surrounding the OnlyOwner role. This single entity has the power to make critical changes, which could lead to significant issues if the account were compromised.

Systemic Risks The project's reliance on the Anycall router by Multichain presents a substantial systemic risk. Recently, Multichain suspended services for several chains due to issues with its Router5 network. The team was unable to resolve these issues as they could not contact CEO Zhaojun, who was arrested, for necessary server access. More details on this situation can be found here: https://twitter.com/MultichainOrg/status/1663941611380965376.

Other Recommendations

While the provided documentation offers a helpful overview of the contract ecosystem, I found that details about Flywheel contracts are missing. This omission could create confusion for users trying to understand the technical aspects of the system. Therefore, I recommend the project team to prioritize providing clear and accurate information about these contracts.

Furthermore, I identified some mismatches between the comments and the actual code implementation, which could lead to confusion. It is essential to maintain consistency between the two to ensure better code readability and understanding.

Time Spent Over two weeks was spent on this

Time spent:

140 hours

#0 - c4-judge

2023-07-11T09:36:25Z

trust1995 marked the issue as grade-b

#1 - c4-judge

2023-07-11T09:36:31Z

trust1995 marked the issue as satisfactory

#2 - c4-sponsor

2023-07-12T23:20:00Z

0xBugsy marked the issue as sponsor confirmed

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