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

The function `Dussehra::enterPeopleWhoLikeRam` tracks the number participants by pushing addresses into an array. This is gas inefficient.

[L-14] The function Dussehra::enterPeopleWhoLikeRam tracks the number addresses of participants by pushing them into an array. This is costs a lot of gas, it is better to use a counter instead.

Description: The function Dussehra::enterPeopleWhoLikeRam tracks the number addresses of participants by pushing them into an array. This is costs a lot of gas. It is better to use a counter instead.

Recommended Mitigation: Change WantToBeLikeRam from an address[] to a uint256 and use it as a counter.

- address[] public WantToBeLikeRam;
+ uint256 public WantToBeLikeRam;
.
.
.
peopleLikeRam[msg.sender] = true;
- WantToBeLikeRam.push(msg.sender);
+ WantToBeLikeRam++;
ramNFT.mintRamNFT(msg.sender);
.
.
.
- uint256 totalAmountByThePeople = WantToBeLikeRam.length * entranceFee;
+ uint256 totalAmountByThePeople = WantToBeLikeRam * entranceFee;
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.