The Treasury contract has critical flaws in its token handling mechanisms that can lead to permanent loss of funds and broken accounting. The issues stem from:
Incorrect accounting for fee-on-transfer tokens
Unsafe token transfer handling
There are multiple related vulnerabilities in the token handling:
Fee-on-transfer token accounting
Unsafe Transfers
The contract:
It does not confirm successful transfers but updates balances. If a transfer fails or returns false the accounting will be off.
Uses input amounts rather than actual transferred amounts making it incompatible with fee-on transfer or rebasing tokens.
Cannot correct accounting discrepancies.
Permanent Loss of Funds: Any tokens sent directly to the contract become permanently locked
Broken Accounting: Fee-on-transfer tokens will cause the internal accounting to become incorrect
Failed Transfers: Unsafe transfer handling could lead to state inconsistencies
Compounding Issues: Problems compound over time as more transactions occur
Severity: HIGH - Due to permanent fund loss potential and broken core functionality
Manual review
Use ERC20 `balanceOf` checks for accurate accounting on deposits and withdraws.
Use SafeERC20 for all transfers.
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.