The Treasury contract uses transfer()
for token withdrawals:
On zkSync, transfer()
has a fixed gas stipend of 2300 gas. For tokens that require more gas for transfers (e.g., tokens that have hooks or complex logic), the withdrawal will fail, potentially locking funds in the Treasury.
This is particularly dangerous because the state changes (_balances, _totalValue) happen before the transfer. If transfer fails, state is corrupted but function doesn't revert. Some tokens may become permanently locked in the contract
Use OpenZeppelin's SafeERC20 library and safeTransfer():
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.