-
-
Save Hebilicious/f578932146f68ceff1ec650a00b90733 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= | |
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { | |
// approve token transfer to cover all possible scenarios | |
_approve(address(this), address(uniswapV2Router), tokenAmount); | |
// add the liquidity | |
uniswapV2Router.addLiquidityETH{value: ethAmount}( | |
address(this), | |
tokenAmount, | |
0, // slippage is unavoidable | |
0, // slippage is unavoidable | |
owner(), | |
block.timestamp | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment