I read the documentation of the changes on 0.5.0 but I do not know how to get this done with my code snippet. I tried to make the constructor payable but this does not work. Can someone help me. The line "wallet.transfer(msg.value) always through this error: "transfer" not found or not visible after argument-dependent lookup in address" I know that something changed with the namespaces but I cannot figure out how to workaround
contract WalletFactory {
mapping(address => address[]) wallets;
function newWallet(address _owner) payable public returns(address wallet) {
wallet = (address)(new createWallet(msg.sender));
wallets[msg.sender].push(wallet);
wallet.transfer(msg.value);
}
}
contract createWallet {
address public owner;
constructor(address _owner) payable public {
owner = _owner;
}
}