DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Invalid

it is better to implement the while loop like this.

Summary

Implementing the while loop in this way can consume less gas

Vulnerability Details

https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/4e0ad0b964f74a1b4880114f4dd5b339bc69cd3e/protocol/contracts/beanstalk/market/MarketplaceFacet/MarketplaceFacet.sol#L179-L183

Impact

gas consumption

Tools Used

Recommendations

like this :

for (uint256 i; i < ids.length;) {
uint256 amount = validatePlotAndReturnPods(fieldId, sender, ids[i], starts[i], ends[i]);
if (s.sys.podListings[fieldId][ids[i]] != bytes32(0)) {
LibMarket._cancelPodListing(sender, fieldId, ids[i]);
unchecked {
++i;
}
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
Assigned finding tags:

Quality

Support

FAQs

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