How to Get a FewToken Address via FewFactory
๐ Example Guide: How to Get a FewToken Address via FewFactory
In Ring Swap, all tokens used in liquidity pools and swaps are wrapped tokens (FewTokens). To maintain compatibility with Uniswap V2 across multiple blockchain networks, Ring Protocol introduces a wrapping layer called Few Protocol. This layer ensures that all original ERC20 tokens are wrapped into their respective FewToken counterparts before being added to liquidity pools or used in swaps.
๐งฉ Why FewTokens?
All tokens in Ring Swap are wrapped ERC20 tokens (FewTokens).
When quoting token prices or building a swap path, you must use the FewToken address, not the original token.
Before using any token with Ring Swap, you must either:
Wrap the original token into its FewToken version, or
Fetch the FewToken address from FewFactory.
๐ How to Fetch FewToken Address Using FewFactory
๐ FewFactory Interface
๐ Example: Solidity Code to Query FewToken
๐งช Use Case: Building a Swap Path
Suppose you want to swap from tokenA โ USDC โ tokenB via Ring Swap:
Query FewTokens for each token:
Construct the path:
Use the path with the Ring Swap router:
โ Summary
Always use FewToken addresses in any interaction with Ring Swap (swaps, quotes, liquidity).
Use FewFactory to resolve the FewToken address of any original ERC20 token.
Last updated