Uniswap pools may be created without the underlying tokens existence, which means that someone may do this before Codeup::claimCodeupERC20() is ever called, making it revert when UniswapV2Factory::createPair() is called as the pool has already been created.
Recommendation
UniswapV2Router::addLiquidity() creates the pool if it does not yet exist, so there is not need to directly created it. The only concern is setting the uniswapV2Pool variable, which may be performed for example by doing:
Description
Uniswap
pools may be created without the underlying tokens existence, which means that someone may do this beforeCodeup::claimCodeupERC20()
is ever called, making it revert whenUniswapV2Factory::createPair()
is called as the pool has already been created.Recommendation
UniswapV2Router::addLiquidity()
creates the pool if it does not yet exist, so there is not need to directly created it. The only concern is setting theuniswapV2Pool
variable, which may be performed for example by doing: