The internal balance can be not correct if we have fee-on-transfer tokens in FertilizerFacet::claimFertilized, FertilizerFacet::payFertilizer and UnripeFacet::pick functions.
The FertilizerFacet::claimFertilized, FertilizerFacet::payFertilizer and UnripeFacet::pick functions call the LibTransfer::sendToken function and assume that the amount of token transferred after calling token.safeTransfer(recipient, amount); is the passed amount to the function.
FertilizerFacet:
UnripeFacet:
LibTransfer::sendToken:
Also, the LibTransfer::sendToken function updates the internal balance according to this amount.
If the token is a transfer-on-fee token or a deflationary/rebasing token the received/send amount will be less than the accounted amount in the state variables.
Manual Review
It is important to get the actual received amount of token. This can be done by calculating the difference of token balance before and after transfer as in the LibTransfer::reciveToken is done.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.