Because routers are stateless and do not hold token balances, they can be replaced safely and trustlessly, if necessary. This may happen if more efficient smart contract patterns are discovered, or if additional functionality is desired. For this reason, routers have release numbers, starting at 01
. This is currently recommended release, 02
.
Code
Address
UniswapV2Router02
is deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
on the Ethereum mainnet, and the Ropsten, Rinkeby, Görli, and Kovan testnets. It was built from commit 6961711.
Read-Only Functions
factory
function factory() external pure returns (address);
Returns factory address.
WETH
function WETH() external pure returns (address);
Returns the canonical WETH address on the Ethereum mainnet, or the Ropsten, Rinkeby, Görli, or Kovan testnets.
quote
See quote.
getAmountOut
See getAmountOut.
getAmountIn
See getAmountIn.
getAmountsOut
function getAmountsOut(uint amountIn, address[] memory path) public view returns (uint[] memory amounts);
See getAmountsOut.