Why does Remix compile the below with msg.sender but not with contractOwner address variable?

Thank you

Doesn't compile


1 Answer 1


selfdestruct method sends all of the contract balance to passed address and with recent solidity breaking changes all addresses that are receiving ETH must include the keyword payable. Example:

address payable public contractOwner;
  • Thank you Miroslav
    – Picard78
    Oct 1, 2020 at 11:23

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.