Notional x Index Coop - ElKu's results

A collaboration between Notional and Index Coop to create fixed rate yield index tokens.

General Information

Platform: Code4rena

Start Date: 07/06/2022

Pot Size: $75,000 USDC

Total HM: 11

Participants: 77

Period: 7 days

Judge: gzeon

Total Solo HM: 7

Id: 124

League: ETH

Notional

Findings Distribution

Researcher Performance

Rank: 72/77

Findings: 1

Award: $47.43

🌟 Selected for report: 0

🚀 Solo Findings: 0

  1. Inside the for loop, the loop increment can be done within an unchecked block. As its unlikely we will reach the limit of uint256 for the loop index. Like below: for (uint256 i; i < i_max; ) { //some operation unchecked { i++; } } a. https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/index-coop-notional-trade-module/contracts/protocol/modules/v1/NotionalTradeModule.sol#L238 and Line 254, 393, 605, 618.

  2. Instead of require statement we can use custom error messages. Also require statements with an && can be split into two statements. For example: require(futureA_ > 0 && futureA_ < MAX_A, "futureA_ must be > 0 and < MAX_A");

can be rewritten as:

if(futureA_ == 0) futureA_must_be_gt0(); if(futureA_ >= MAX_A) futureA_must_notbe_gtMAX();

References below: a. https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/index-coop-notional-trade-module/contracts/protocol/modules/v1/NotionalTradeModule.sol#L169 and Lines 199, 227, 234, 269, 280, 378,449, 485 and 573. b. https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/notional-wrapped-fcash/contracts/wfCashBase.sol#L37 and Lines 40. c. https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/notional-wrapped-fcash/contracts/wfCashERC4626.sol#L23 d. https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/notional-wrapped-fcash/contracts/wfCashLogic.sol#L57 and Lines 116, 129, 211, 225.

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