Canto Liquidity Mining Protocol - gzeon's results

Execution layer for original work.

General Information

Platform: Code4rena

Start Date: 03/10/2023

Pot Size: $24,500 USDC

Total HM: 6

Participants: 62

Period: 3 days

Judge: LSDan

Total Solo HM: 3

Id: 288

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 40/62

Findings: 1

Award: $4.94

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

4.9369 USDC - $4.94

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
sponsor acknowledged
sufficient quality report
Q-15

External Links

Lines of code

https://github.com/code-423n4/2023-10-canto/blob/40edbe0c9558b478c84336aaad9b9626e5d99f34/canto_ambient/contracts/mixins/LiquidityMining.sol#L184-L186

Vulnerability details

Impact

The loop the calculate inRangeLiquidityOfPosition might go above tx gas limit when the liquidity position have a large range (i.e. upperTick - lowerTick is huge). The user would not be able to claim reward.

Proof of Concept

https://github.com/code-423n4/2023-10-canto/blob/40edbe0c9558b478c84336aaad9b9626e5d99f34/canto_ambient/contracts/mixins/LiquidityMining.sol#L184-L186

for (int24 j = lowerTick + 10; j <= upperTick - 10; ++j) { inRangeLiquidityOfPosition += timeWeightedWeeklyPositionInRangeConcLiquidity_[poolIdx][posKey][week][j]; }

One solution is to add a function that allow user to pre-calc inRangeLiquidityOfPosition with pagination.

Assessed type

DoS

#0 - c4-pre-sort

2023-10-09T16:59:21Z

141345 marked the issue as sufficient quality report

#1 - c4-sponsor

2023-10-11T11:01:10Z

OpenCoreCH (sponsor) acknowledged

#2 - OpenCoreCH

2023-10-11T11:02:13Z

Technically true, in practice it is questionable if this will be a large problem, as a user can create Ambient positions (covering the whole range) instead of huge concentrated positions.

#3 - c4-judge

2023-10-18T22:15:22Z

dmvt changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-10-18T22:52:57Z

dmvt marked the issue as grade-b

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