Context: Treasury.sol#L50, Treasury.sol#L75
The deposit and withdraw functions in the Treasury contract use IERC20(token).transferFrom and IERC20(token).transfer, respectively, for transferring ERC20 tokens. However, this approach does not handle the case where a non-standard ERC20 token does not return a boolean value, leading to potential transaction failures.
The contract directly calls transfer and transferFrom when handling ERC20 tokens. Some tokens (e.g., USDT, BNB, OMG) do not return a boolean value, causing transactions to fail unexpectedly. Additionally, some tokens may return false instead of reverting on failure, which the contract does not check.
Users may lose funds due to silent transfer failures or failed transactions for certain tokens.
Manual review
Use OpenZeppelin’s SafeERC20 library to replace transfer with safeTransfer and transferFrom with safeTransferFrom. This ensures proper handling of token transfers and prevents unexpected failures.
LightChaser Low-60
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.