5

https://solidity.readthedocs.io/en/latest/solidity-by-example.html#simple-open-auction

pragma solidity ^0.4.22;    
contract SimpleAuction {
    address payable public beneficiary;

What exactly does payable mean here? Are there non-payable addresses? Should one always explicitly declare state variables of type address like so?

-1

I tried to compile the entire code. It doesn't go past that line. Payable shouldn't be declared with the name variable else you are getting

'Expected identifier but got 'payable' at address payable public beneficiary;'

I assume it's just an error. If you remove 'payable' in line 7 and line 35 the code works fine, else it doesn't compile.

  • I find it weird, that an example in the documentation is wrong. However, it is possible that it is also a deprecated feature .. I will take a look to the GitHub repository – Briomkez Sep 23 '18 at 5:27

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.