Hello, I’m trying to implement this contract.
But I am having this error as a return:
Error: *** Deployment Failed ***
“MoonContract” hit a require or revert statement somewhere in its constructor. Try:
Verifying that your constructor params satisfy all require conditions.
Adding reason strings to your require statements.
Contract:
pragma solidity ^0.6.12;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
This file has been truncated. show original
@abcoathup
1 Like
Hi @weslley ,
Sorry I don’t know anything about this contract.
My guess would be the hardcoded address for the IUniswapV2Router02. Depending what network you are deploying to, then you would need this deployed too, and then pass in the address in your constructor.
modifier lockTheSwap {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor () public {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0xd0942B4bA551a8525d21C43d51f22F30D425E6Ab);
// Create a uniswap pair for this new token
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
// set the rest of the contract variables
uniswapV2Router = _uniswapV2Router;
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
Hello, I also ran into the same issue deploying to Ropsten testnet. I have already change the UniswapV2Router contract address to the correct address here https://ropsten.etherscan.io/address/0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D but still run into this issue.
Were you able to fix it?