veRWA - ch0bu's results

Incentivization Primitive for Real World Assets on Canto

General Information

Platform: Code4rena

Start Date: 07/08/2023

Pot Size: $36,500 USDC

Total HM: 11

Participants: 125

Period: 3 days

Judge: alcueca

Total Solo HM: 4

Id: 274

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 102/125

Findings: 1

Award: $4.23

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L69-L83 https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L95-L109

Vulnerability details

Impact

If gas limit is reached transaction will revert

Proof of Concept

There are two for loops in GaugeController.sol contract that iterate 500 times, and since they are writing to a state variables there is a potential that they will reach gas limit and revert.

69 for (uint256 i; i < 500; ++i) { 70 if (t > block.timestamp) break; 71 t += WEEK; 72 uint256 d_bias = pt.slope * WEEK; 73 if (pt.bias > d_bias) { 74 pt.bias -= d_bias; 75 uint256 d_slope = changes_sum[t]; 76 pt.slope -= d_slope; 77 } else { 78 pt.bias = 0; 79 pt.slope = 0; 80 } 81 points_sum[t] = pt; 82 if (t > block.timestamp) time_sum = t; 83 }

https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L69-L83 https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L95-L109

Tools Used

Manual review

Reduce the number of iteration in loop, and iterate in batches.

Assessed type

Invalid Validation

#1 - c4-pre-sort

2023-08-12T09:38:31Z

141345 marked the issue as duplicate of #160

#2 - c4-judge

2023-08-24T05:47:59Z

alcueca marked the issue as unsatisfactory: Insufficient proof

#3 - c4-judge

2023-08-28T14:32:01Z

alcueca changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-08-28T14:32:32Z

alcueca 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