I ran into problems around âPayableâ so I changed âaddress public ownerâ to âaddress payable public ownerâ
I was hoping to be able to do it without Destroyable having to import Ownable, but I couldnât figure out if that could be done.
Iâm assuming it works because the smart contract no longer gives me back data. I was expecting to get error messages at that stage, but I didnât.
import "./Ownable.sol";
pragma solidity 0.5.12;
contract Destroyable is Ownable {
function close() public onlyOwner { //onlyOwner is custom modifier
selfdestruct(owner); // `owner` is the owners address
}
}
pragma solidity 0.5.12;
contract Ownable {
address payable public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_; //Continue execution
}
constructor() public{
owner = msg.sender;
}
}