Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: medium
Invalid

TokenManager.sol tillIn and withdraw functions do not revert on 0 amount but return, which is troublesome if called by another contract

Summary

TokenManager.sol tillIn and withdraw functions do not revert on 0 amount but return, which could induce errors in another contract using them if it's not expecting a successful function execution but a revert

Vulnerability Details

TokenManager.sol tillIn and withdraw functions do not revert on 0 amount but return, which could induce errors in another contract using them if it's not expecting a successful function execution but a revert.

function withdraw(
address _tokenAddress,
TokenBalanceType _tokenBalanceType
) external whenNotPaused {
uint256 claimAbleAmount = userTokenBalanceMap[_msgSender()][
_tokenAddress
][_tokenBalanceType];
if (claimAbleAmount == 0) {
return;
}
...

Impact

Not properly handling the successful function call could result in a wrong state or a wrong execution of other functions that use the TokenManager's tillInand withdrawfunctions.

Tools Used

Manual review

Recommendations

Change the empty returns on lines #69 and #146 to revert Errors.AmountIsZero();

Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi 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.