0

recievers_address.transfer(address(this).balance);

when I use this from one of the functions of my smart contract

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

red underlined under the receivers-address!

to be noted: recievers_address is a private field.

1 Answer 1

2

Without seeing your code, this is just a guess, but maybe you're using Solidity 0.5.x and recievers_address is declared as an address rather than an address payable?

2
  • exactly, do I need to make every address to address payable for being able to send ether using transfer? Jan 26, 2019 at 0:29
  • 2
    Any address you send ether to should be address payable, yes.
    – user19510
    Jan 26, 2019 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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