Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CurrencySettler to use SafeERC20 #46

Open
ivanvolov opened this issue Feb 25, 2025 · 0 comments
Open

Update CurrencySettler to use SafeERC20 #46

ivanvolov opened this issue Feb 25, 2025 · 0 comments

Comments

@ivanvolov
Copy link

Motivation

The CurrencySettler is used to create custom hooks, but it's not working with tokens like USDT.

Details

Update CurrencySettler to use safeTransfer and safeTransferFrom instead of transfer and transferFrom.

        } else {
            manager.sync(currency);
            if (payer != address(this)) {
                IERC20(Currency.unwrap(currency)).safeTransferFrom(payer, address(manager), amount);
            } else {
                IERC20(Currency.unwrap(currency)).safeTransfer(address(manager), amount);
            }
            manager.settle();
        }
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

No branches or pull requests

1 participant