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

Protocol don't support some tokens will cause `LibFertilizer#addFertilizer` function revert

Summary

Protocol don't support some tokens will cause LibFertilizer#addFertilizer function revert.

Vulnerability Details

When call LibFertilizer#addFertilizer function, it call IERC20(barnRaiseToken).approve(barnRaiseWell, uint256(tokenAmountIn)) directly, some tokens like USDT will revert by calling approve function from non-zero to non-zero, see code detail.

Impact

Protocol will revert when call LibFertilizer#addFertilizer function with some tokens like USDT.

Tools Used

vscode, Manual Review

Recommendations

Call IERC20(barnRaiseToken).approve(barnRaiseWell, 0) before call IERC20(barnRaiseToken).approve(barnRaiseWell, uint256(tokenAmountIn)).

Updates

Lead Judging Commences

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

Informational/Invalid

Support

FAQs

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