Reputation: 2856
People can swap token though with UniSwap Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)
and also UniSwap Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f)
But what's the different? Why there are two contract exists for swaping token?
I saw there are many old txs on UniSwap Factory
, Seems UniSwap Factory
is not much active than UniSwap Router
, Is it mean UniSwap Router
is a new tech to replace UniSwap Factory
?
Upvotes: 3
Views: 2925
Reputation: 91
With the Uniswap Factory, it's purpose is actually in it's name. It is a Factory contract which allows you to create uniswap liquidity pair contracts. And from the Uniswap Factory you can fetch the pair address of any ERC20 token that has an active pair.
The Uniswap Router on the other hand contains functions that allow trading of ERC20 tokens as well as adding/removing liquidity and hence essentially acts as the primary "back-end" for the Uniswap interface. More info about the router can be found here.
Upvotes: 4
Reputation: 83828
Here is a Python dataclass that explains some aspects of Uniswap v2 deployment.
Upvotes: 5