In Treasury.sol file
The contract assumes all tokens behave like standard ERC-20, but some tokens have fee-on-transfer mechanisms or non-standard return values (e.g., USDT, BNB, etc.).
So if IERC20(token).transferFrom fails, it will not revert and return false.
But the function didn't check the return value.
As result, the contract didn't receive token and increase _balances[token].
The function withdraw() uses the standard IERC20.transferFrom() method.
Some ERC-20 tokens (e.g., USDT) return false on failure instead of reverting.
The contract does not validate the return value of transfer().
If transferFrom() fails silently, the contract may assume the transfer succeeded and increase _balances.
Even though the sender's transferfrom fails, _balances and _totalValue is increased, it will be different with real balance.
SO contract will occur unexpected behavior.
manual
Use OpenZeppelin’s SafeERC20.safeTransfer() to ensure compatibility with all ERC-20 tokens, including those that return false instead of reverting.
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.