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.

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?

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

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.