Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas Optimizations #197

Open
code423n4 opened this issue Oct 23, 2022 · 2 comments
Open

Gas Optimizations #197

code423n4 opened this issue Oct 23, 2022 · 2 comments
Labels
bug Something isn't working G (Gas Optimization) G-29 grade-a high quality report This report is of especially high quality

Comments

@code423n4
Copy link
Contributor

code423n4 commented Oct 23, 2022

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.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Oct 23, 2022
code423n4 added a commit that referenced this issue Oct 23, 2022
code423n4 added a commit that referenced this issue Oct 23, 2022
@drgorillamd drgorillamd added the high quality report This report is of especially high quality label Oct 25, 2022
@c4-judge
Copy link
Contributor

c4-judge commented Nov 8, 2022

Picodes marked the issue as grade-b

@c4-judge
Copy link
Contributor

c4-judge commented Nov 8, 2022

Picodes marked the issue as grade-a

@c4-judge c4-judge added grade-a and removed grade-b labels Nov 8, 2022
@C4-Staff C4-Staff added the G-29 label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) G-29 grade-a high quality report This report is of especially high quality
Projects
None yet
Development

No branches or pull requests

4 participants