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

Users might be DoS'd if a well is temporarily not soppable

Summary

Users might be DoS'd if a well is temporarily not soppable

Vulnerability Details

When it starts raining, the contract fetches the currently soppable wells and sets for these wells the current season's PerRootPlenty (PRP) to the values of the previous season.

} else if (!s.sys.season.raining) {
s.sys.season.raining = true;
address[] memory wells = LibWhitelistedTokens.getCurrentlySoppableWellLpTokens();
// Set the plenty per root equal to previous rain start.
uint32 season = s.sys.season.current;
uint32 rainstartSeason = s.sys.season.rainStart;
for (uint i; i < wells.length; i++) {
s.sys.sop.sops[season][wells[i]] = s.sys.sop.sops[rainstartSeason][wells[i]];
}
s.sys.season.rainStart = s.sys.season.current;
s.sys.rain.pods = s.sys.fields[s.sys.activeField].pods;
s.sys.rain.roots = s.sys.silo.roots;

If a Well is temporarily not soppable, this would mean that the PRP for said season will not be set. As it is not set, it will also not be restarted for subsequent seasons.

Then, when users attempt to mow, it will revert as the user's saved previous PRP is higher and it would cause underflow

if (s.sys.season.lastSop > s.accts[account].lastUpdate) {
uint256 plentyPerRoot = s.sys.sop.sops[s.sys.season.lastSop][well].sub(previousPPR);
plenty = plenty.add(plentyPerRoot.mul(s.accts[account].roots).div(C.SOP_PRECISION));
}

The users would also be unable to withdraw any plenty that they've accrued prior to switching the well to non-soppable.

Impact

DoS, Loss of funds

Tools Used

Manual review

Recommendations

Fetch all whitelisted LP tokens instead of just the soppable ones

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Appeal created

deadrosesxyz Submitter
about 1 year ago
inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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