I am trying one Lottery contract in that I am using one function which give me error.

 function pickAWinner() public restricted {
    require(this.balance >= 10 ether);
    uint index = random() % players.length;
    players = new address[](0);

Getting below error, Below error I am getting other contract also as "Member "balance" not found or not visible after argument-dependent lookup in contract" I think there is issue with 'balance' keyword. however I Unable to fixed it.

  Error:-TypeError: Member "balance" not found or not visible after           
  argument-dependent lookup in contract Lottery. Use 
  "address(this).balance" to access this address member.
    require(this.balance >= 10 ether);

How can I fixed it?

  • 1
    The error message tells you "use address(this).balance to access this address member." Is there a reason you haven't tried following these instructions? @goodvibration's answer is basically a rephrasing of the error message. Jan 27, 2019 at 10:08
  • sorry @RoscoKalis, I have more careful to error massage, Next time I will thanks for notify me. Jan 27, 2019 at 10:19
  • Mooi worries, good luck developing Jan 27, 2019 at 10:19

2 Answers 2


Change this.balance to address(this).balance.

  • 1
    BTW, thought you said you needed to get some sleep. Jan 27, 2019 at 10:00
  • yes@goodvibration, however when I am trying sleep I can't because of this error and incomplete work once I get understand this issues then I can sleep. Jan 27, 2019 at 10:13
  • Again thanks@goodvibration for reply on this, because of this community I am learning now. solidity community really helpful and amazing, I hope I could also give to this community. Jan 27, 2019 at 10:16

You need to use


where transfer_address is the address of the account to which you want to transfer all ETH from the current contract

Your Answer

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

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