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

Unnecessary imports #50

Open
code423n4 opened this issue Oct 13, 2021 · 4 comments
Open

Unnecessary imports #50

code423n4 opened this issue Oct 13, 2021 · 4 comments
Assignees
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Warden finding disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

There are imports that are not necessary. They will increase the size of deployment with no real benefit. Consider removing them to save some gas.
Examples of such imports are:
in contract DrawBuffer imported twice:
import "./interfaces/IDrawBeacon.sol";

in contract DrawCalculator:
import "./libraries/DrawRingBufferLib.sol";
import "./PrizeDistributor.sol";

in contract PrizeDistributor:
import "./interfaces/IDrawBeacon.sol";

Recommended Mitigation Steps

Consider removing imports that are not actually used in the contract.

code423n4 added a commit that referenced this issue Oct 13, 2021
@asselstine asselstine self-assigned this Oct 14, 2021
@asselstine asselstine added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Oct 14, 2021
@asselstine
Copy link
Collaborator

Actually, imports don't increase the bytecode size. I've tested this.

@asselstine asselstine added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) and removed G (Gas Optimization) sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue labels Oct 14, 2021
@asselstine
Copy link
Collaborator

asselstine commented Oct 14, 2021

I think this is still valuable though, as we should remove any unnecessary imports. It's not an optimization though, so I updated the change.

@asselstine
Copy link
Collaborator

pooltogether/v4-core#239

@PierrickGT PierrickGT added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Oct 14, 2021
@GalloDaSballo
Copy link
Collaborator

The sponsor confirms the finding and has mitigated by removing unnecessary imports.
I agree with the change of label to Non-Critical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Warden finding disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

4 participants