code-423n4 / 2022-10-juicebox-findings

2 stars 0 forks source link

Gas Optimizations #197

Open code423n4 opened 1 year ago

code423n4 commented 1 year ago

Table of Contents

[G-01] Tier removal check is not necessary in JBTiered721DelegateStore.recordAddTiers

Description

A tier is considered removed if the bit in the _isTierRemoved bitmap is set accordingly. The function JBTiered721DelegateStore.recordAddTiers adds new tiers and sorts them by contributionFloor, no matter if a tier is removed or not. Therefore, the _isTierRemoved bitmap reads are unnecessary and can be safely removed.

Findings

JBTiered721DelegateStore.sol#L724-L725\ JBTiered721DelegateStore.sol#L717

Recommended mitigation steps

Consider removing the _isTierRemoved bitmap reads.

c4-judge commented 1 year ago

Picodes marked the issue as grade-b

c4-judge commented 1 year ago

Picodes marked the issue as grade-a