I am trying to convert an address to payable address but I'm not able to do it. please find my code below:
address a = destinationAddress;
address dest = address(uint160(a));
dest.transfer(amount);
You must be using solidity 0.5 or above compiler, just declare destinationAddress as payable : address payable destinationAddress
, then you can directly use destinationAddress.transfer(amount);
.
Also check this for more breaking changes.
destinationAddress.transfer(amount);
?