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

setting value to false in constructor, might increase gas cost a bit

Summary

In ChoosingRam.sol::isRamSelected is being set as false. Though this is fine, we are just setting the value to false which is already false by default. so, this might cost a little bit of more gas during deployment

Vulnerability Details

Proof to show that value of isRamSelected is false by default:

Place below code in Dussehra.t.sol and run command - forge test --mt test__isRamSelectedValueIsFalseByDefault

code
function test__isRamSelectedValueIsFalseByDefault() public {
ramNFT = new RamNFT();
choosingRam = new ChoosingRam(address(ramNFT));
assertEq(choosingRam.isRamSelected(), false);
}

Impact

increase in gas cost during deployment

Tools Used

Foundry

Recommendations

constructor(address _ramNFT) {
- isRamSelected = false;
ramNFT = RamNFT(_ramNFT);
}
Updates

Lead Judging Commences

bube Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Info/Gas/Invalid according to docs

Support

FAQs

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