CRYPTO NEWS

how to resolve this error in ethereum

code:

pragma solidity ^0.8.15;

contract SendMoney{

uint public balanceRecieved; function recieveMoney() public payable {     balanceRecieved += msg.value;  // msg.value stores the amount of ether recieved when function is called }  function getBalance() public view returns(uint) {     return address(this).balance; 

}

function withdrawMoney() public{     address payable toAdress = msg.sender ;            toAdress.transfer(this.getBalance()); } 

}

error i get:

Type address is not implicitly convertible to expected type address payable.

how to resolve this error in ethereum

Shopping cart
There are no products in the cart!
Continue shopping
0