DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

" _claimPlenty" can be revert on zero plenty value

Summary

Some ERC20 tokens do not allow zero value transfers, reverting such attempts.

This way, a combination of zero treasury fee and such a token set as a collect fee currency will revert any collect operations, rendering collect functionality unavailable

Vulnerability Details

function _claimPlenty(address account) internal {
// Plenty is earned in the form of the non-Bean token in the SOP Well.
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);
}

}

Impact

Some ERC20 tokens revert on zero value transfers:

https://github.com/d-xo/weird-erc20#revert-on-zero-value-transfers

Tools Used

Recommendations

if(plenty>0)
@> sopToken.safeTransfer(account, plenty);

Updates

Lead Judging Commences

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

Informational/Invalid

Support

FAQs

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