Deploying Issue!

Hey guys,
I have a contract without any error or problem in compiler but when I want to deploye it on testnet or even mainnet I get the error below, If you had this issue please let me know how to fix it' Thanks
BTW, I used these router address for mainnet: 0x10ED43C718714eb63d5aA57B78B54704E256024E
Testnet: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1

creation of yourtoken errored: Error encoding arguments: Error: invalid address (argument="address", value="", code=INVALID_ARGUMENT, version=address/5.5.0) (argument=null, value="", code=INVALID_ARGUMENT, version=abi/5.5.0)

As you can see the error says invalid address. This means somewhere in your code there could be an address entered wrong. As the value is "" there is no address but it needs one. Probably some error in the constructor. If the contract mints tokens on deployment you should check if the owner address in set

I checked all the constructor but I didn't find any missing or wrong address, could you check if I am wrong? below there is all constructors

  constructor (address _router) {
        router = _router != address(0)
        ? IDEXRouter(_router)
        // : IDEXRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E);
        : IDEXRouter(0xD99D1c33F9fC3444f8101754aBC46c52416550D1);
        _token = msg.sender;
    }


constructor(address _owner) {
        owner = _owner;
        authorizations[_owner] = true;
    }



constructor (
        address _dexRouter
    ) Auth(msg.sender) {
        router = IDEXRouter(_dexRouter);
        pair = IDEXFactory(router.factory()).createPair(WBNB, address(this));
        _allowances[address(this)][address(router)] = _totalSupply;
        WBNB = router.WETH();
        distributor = new DividendDistributor(_dexRouter);
        distributorAddress = address(distributor);

        isFeeExempt[msg.sender] = true;
        isTxLimitExempt[msg.sender] = true;
        isDividendExempt[pair] = true;
        isDividendExempt[address(this)] = true;
        isDividendExempt[DEAD] = true;
        buyBacker[msg.sender] = true;

        autoLiquidityReceiver = msg.sender;
        marketingFeeReceiver = msg.sender;

        approve(_dexRouter, _totalSupply);
        approve(address(pair), _totalSupply);
        _balances[msg.sender] = _totalSupply;
        emit Transfer(address(0), msg.sender, _totalSupply);
    }

Weird. Can you post the code of the contract yourtoken?

1 Like

It is working now, I did something wrong! :wink:
Thank you