DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: low
Invalid

Possible reentrancy in `_claimPlenty()`

Summary

An attacker might claim several times with _claimPlenty().

Vulnerability Details

function _claimPlenty(address account) internal {
// Plenty is earned in the form of the sop token.
uint256 plenty = s.a[account].sop.plenty;
IWell well = IWell(s.sopWell);
IERC20[] memory tokens = well.tokens();
IERC20 sopToken = tokens[0] != C.bean() ? tokens[0] : tokens[1];
sopToken.safeTransfer(account, plenty);
delete s.a[account].sop.plenty;
emit ClaimPlenty(account, address(sopToken), plenty);
}

In _claimPlenty(), it deletes s.a[account].sop.plenty after transfer the funds. If sopToken has a hook, users can claim as much as they like using reentrancy.

Impact

Possible fund loss using _claimPlenty() using reentrancy.

Tools Used

Manual Review

Recommendations

It should delete s.a[account].sop.plenty first before starting the transfer.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Informational/Invalid

Support

FAQs

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