Skip to content

Improve swap routing guide #1023

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rocconmarco
Copy link

This PR introduces improvements in three main areas of the guide:

  1. Missing imports: The sample code was missing imports for StateLibrary and the PoolKey type, which are required for the code to compile correctly.

  2. Universal Router interface: Replacing the direct contract instantiation with the IUniversalRouter interface solves the following Solidity error: Explicit type conversion not allowed from non-payable "address" to "contract UniversalRouter", which has a payable fallback function. (solidity 7398)
    This also brings consistency with how other external contracts (PoolManager, Permit2) are handled via interfaces.

  3. Currency type unwrap: Unwrapping key.currency1 using the Currency type from v4-core fixes the following error: Explicit type conversion not allowed from "Currency" to "contract IERC20". (solidity 9640)

Copy link

vercel bot commented Jul 28, 2025

@rocconmarco is attempting to deploy a commit to the Uniswap Team on Vercel.

A member of the Team first needs to authorize it.

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