Smart contract deploy error

Hi, I'm a beginner at creating contracts, I've error when I deploy my contract with truffle and ganache-cli:

"Owo" 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.

this is my constructor code:

    constructor (address payable charityWalletAddress) public {
        _charityWalletAddress = charityWalletAddress;
        _rOwned[_msgSender()] = _rTotal;

        IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
        // pancakeswapv2 for BSC network
        // 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;

        emit Transfer(address(0), _msgSender(), _tTotal);
    }

3_deploy.js

const Owo = artifacts.require("Owo");

module.exports = async function (deployer) {
    const accounts = await web3.eth.getAccounts()
    await deployer.deploy(Owo, accounts[0]);
};

can anyone explain to me where is the problem with my code?

Hi Komeil! Welcome to Open Zeppelin.

Looking at your code

IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);

Which network are you deploying to? If you are deploying to a test net, this router address needs to change. The router doesn't exist anywhere, but on BSC's live net.

As you mentioned you are new, I highly recommend doing this tutorial.

You don't have to understand it 100%, but it's a great way to get you up to speed and get a developer environment going.

After that check out

I know it's a pain to go through all this, but as you learn you will give yourself the skills needed to create any type of smart contract you want.

1 Like

how I can find my network address? I use rinkeby network.
is there any possibility to test my token in PancakeSwap for adding liquidity and etc?
btw Thanks for your usefull information.

Yes absolutely you can use https://pancake.kiemtienonline360.com/#/swap for testing with pancakeswap, the router address is 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3

For your network address, I’m a little confused at what you mean. Your wallet in metamask should remain the same. For network address you can find it with your API key if you are using Alchemy.

1 Like

Hi again and thanks for your response, I’ve another question How can I see the chart of my test token? Is there any website to show bsc testnet tokens chart?