Nice solution @Rafael_Albuquerque
You have done a good job of using the appropriate syntax for Solidity v.0.8.1
Well done for realising that you needed to make the owner
address payable
, so that selfdestruct() is called with a payable address and, therefore, any remaining ether in the contract is paid/transferred to the owner when selfdestruct() is triggered.
Do you mean in the Destroyable contract, as follows?
function close() public onlyOwner {
selfdestruct(payable(msg.sender));
}
…meaning that you can leave owner as a non-payable address (in Ownable) as follows?
address public owner;
constructor() {
owner = msg.sender;
}
If you define an address state variable as payable, then it will be payable whenever it is referenced without having to explicitly convert it each time. This is why in your posted solution you are able to call selfdestruct() as follows:
selfdestruct(owner);
However, if your address state variable only needs to be payable in specific situations, it is better practice (and more secure) to store it in the contract state as a non-payable address, and then convert it locally whenever it needs to be payable e.g.
selfdestruct(payable(owner));
… or use a suitable alternative such as   payable(msg.sender)
Can we also see what modifications you’ve made to the start of your Bank.sol file, and Bank contract header, for the inheritance? This is an important part of the solution, because the aim of this assignment is for our Bank contract to inherit both the selfdestruct() and contract ownership functionalities, so that both are available when we just deploy Bank i.e. we should be able to deploy Bank, perform some transactions, then destroy the Bank contract, transferring any remaining ether balance to the caller of the selfdestruct function (here, the contract owner).
Let me know if anything is unclear, if I have misunderstood your question, or if you have any further questions