Got address from 3rd-party library:

address wallet = rlp[5].toAddress();

And wanna transfer some funds to it:


Got error:

TypeError: Member "transfer" not found or not visible after argument-dependent lookup in address.

And casts not works:

((address payable)(wallet)).transfer(amount);

Here is how to cast address to address payable:

address addr = 0x****;
address payable wallet = address(uint160(addr));

And contract cast to address payable:

MyContract addr = MyContract(0x****);
address payable wallet = address(uint160(address(addr)));
  • 1
    thank you for this @K06a – wandos Jun 11 '19 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.