Skip to content

fix: check ERC20 transfer return value in executeWithdrawal()#6

Open
FoxPink wants to merge 1 commit into
natalya-bbr:developfrom
FoxPink:fix/erc20-transfer-return-value
Open

fix: check ERC20 transfer return value in executeWithdrawal()#6
FoxPink wants to merge 1 commit into
natalya-bbr:developfrom
FoxPink:fix/erc20-transfer-return-value

Conversation

@FoxPink

@FoxPink FoxPink commented Jun 9, 2026

Copy link
Copy Markdown

Bug Fix: Silent ERC20 Transfer Failure

\executeWithdrawal()\ calls \IERC20(token).transfer(to, amount)\ without checking the return value. Tokens like USDT (common on Base) return \ alse\ instead of reverting on failure, causing the withdrawal to be marked as \Executed\ while funds remain in the treasury.

Fix: Check the return value of .transfer()\ and revert if it returns \ alse.

Gas Optimization

  • Cache
    egistry\ address in memory in _updateRegistryState()\ and \createEscrow()\ to avoid unnecessary SLOADs

Testing

  • \ orge test\ — all tests pass

- Bug fix: USDT returns false instead of reverting on failure; the contract
  would mark withdrawal as Executed despite funds not being sent
- Add require on IERC20.transfer() return value
- Gas: cache registry address in memory in _updateRegistryState() and createEscrow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant