Can you tell me, why addLiquidityETH is not working? I'm trying to call her through etherscan.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20 {
address public uniswapV2Pair;
uint256 public amountToken;
uint256 public amountETH;
uint256 public liquidity;
IUniswapV2Router public uniswapV2Router;
IUniswapV2Factory public uniswapFactory;
address router = 0x10ED43C718714eb63d5aA57B78B54704E256024E; // panceswap Router
constructor() ERC20("test", "TEST") {
uint256 initialSupply = 100000000000000000000;
_mint(msg.sender, initialSupply);
owner = msg.sender;
IUniswapV2Router _uniswapV2Router = IUniswapV2Router(router);
uniswapV2Router = _uniswapV2Router;
IUniswapV2Factory _uniswapFactory = IUniswapV2Factory(
uniswapV2Router.factory()
);
uniswapFactory = _uniswapFactory;
}
function addLiqETH2() external payable {
(amountToken, amountETH, liquidity) = uniswapV2Router.addLiquidityETH{
value: msg.value
}(
address(this),
totalSupply(),
0,
0,
address(<myAddress>),
block.timestamp
);
}