I am currently working on a pre-built ERC20 contract code that uses two different addresses from UniswapV2 to do validations in its logic.
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
Inside the _transfer
function it checks if from
or to
parameters equal to address(uniswapV2Router)
or uniswapV2Pair
.
I am trying to understand why and when to use each of those addresses especially uniswapV2Pair
and when my transfer
function is called with any of those addresses as input parameters.