fix: use SafeERC20 for all token transfers#71
Merged
RonTuretzky merged 2 commits intodevfrom Apr 6, 2026
Merged
Conversation
5e1a2ca to
2d22c28
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RonTuretzky
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IERC20.transfer/IERC20.transferFromcalls withSafeERC20.safeTransfer/SafeERC20.safeTransferFromTransferFailederrorSafeERC20FailedOperationinstead ofTransferFailedWhy
Raw
IERC20.transfer/transferFromrely on the token returning abool. Tokens like USDT don't return a value, which would cause the call to revert even on success. OZ'sSafeERC20wrapper handles non-standard return values correctly, making the contract safe to use with any ERC20 token.Test plan
forge test— all 97 tests pass🤖 Generated with Claude Code