I've been getting this error when I try and deploy a contract with a constructor on multiple pieces of code. I use the correct complier version too
creation of MyContract errored: Error encoding arguments: Error: invalid address (argument="address", value="", code=INVALID_ARGUMENT, version=address/5.1.0) (argument=null, value="", code=INVALID_ARGUMENT, version=abi/5.1.2)
can anyone help?
pragma solidity 0.5.1;
contract MyContract {
mapping(address => uint256) public balances;
address payable wallet;
constructor(address payable _wallet) public {
wallet = _wallet;
}
function buyToken() public payable{
//buy token
balances[msg.sender] += 1;
wallet.transfer(msg.value);
//send eth to wallet
}
}
edit: this is happening when I pass in address payable _wallet into my constructor. If I take out address payable I can deploy. This happens on my other computer too. So I know this isnt a machine related error