veRWA - 0xWaitress'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: 108/125

Findings: 1

Award: $4.23

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

[L-1] loop unnecessarily does 1 calculation when i = lastUserUpdateEpoch

i is the same as lastUserUpdateEpoch, which is the retrieved value.

            uint256 lastUserBalance = lendingMarketBalances[_market][_lender][lastUserUpdateEpoch];
            for (uint256 i = lastUserUpdateEpoch; i <= updateUntilEpoch; i += WEEK) {
                lendingMarketBalances[_market][_lender][i] = lastUserBalance;
            }

Recommendation

            uint256 lastUserBalance = lendingMarketBalances[_market][_lender][lastUserUpdateEpoch];
+++             for (uint256 i = lastUserUpdateEpoch+1; i <= updateUntilEpoch; i += WEEK) {
---             for (uint256 i = lastUserUpdateEpoch; i <= updateUntilEpoch; i += WEEK) {
                lendingMarketBalances[_market][_lender][i] = lastUserBalance;
            }

#0 - c4-judge

2023-08-22T14:20:36Z

alcueca marked the issue as grade-a

#1 - c4-judge

2023-08-22T14:20:46Z

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