Here's the function:
function withdrawMoney() public {
address payable to = msg.sender;
to.transfer(this.getBalance());
}
And the error:
TypeError: Type address is not implicitly convertible to expected type address payable.
--> pay.sol:16:9:
|
16 | address payable to = msg.sender;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
someone suggested to remove the payable keyword, but then I can't use transfer keyword on the next line.