Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: low
Invalid

`DEPOSIT_LIMIT` variable in L1BossBridge contract should be a constant variable to save gas.

Summary

The first variable declared in L1BossBridge contract is :

uint256 public DEPOSIT_LIMIT = 100_000 ether;

Because the value of this variable never changes, it would be better to declare it with the keyword constant.

Vulnerability Details

Not using the constant keyword for constant variable will cost gas for no reason. Indeed, the constant keyword directly integrates the value of the variable in the runtime bytecode wherever it is used. This way, there is no need to pay the gas associated with sload instruction each time the value is read.

Impact

The impact is LOW as it is just a gas related issue.

Tools Used

Manual

Recommendations

I suggest to replace the declaration of DEPOSIT_LIMIT variable with this declaration :

uint256 public constant DEPOSIT_LIMIT = 100_000 ether;
Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.