Hi @gunnarseay,
You’re nearly there with this: just a few things that need modifying, and some syntax to tidy up…
(1)
Why are you using compiler v.0.5.12? This is quite out-dated now, so use either v0.7.5 (the Solidity version used in the course videos) or v0.8.
(2) If you use v0.5.12, you need to mark your constructor with public
visibility or it will throw a compiler error…
constructor() public {
owner = msg.sender;
}
It’s only from v0.7 that the visibility is ignored in constructors. So if you use v0.7 or above, your current constructor will compile as it is …
(3)
You need to correct the characters at the end of this require() statement in your modifier.
(4)
This last line of your Ownable contract will also throw an error.
(5)
You need to use these quotes: " "
in your code, and not: “ ”
otherwise your code won’t compile. You’ve used the wrong characters for your quotes in both import statements.
(6) If you read the compiler error message you get for this line of code …
… you will see that owner
needs to be explicity converted to a payable address. This is because owner
is defined in your Ownable contract as a non-payable address, but the selfdestruct
method requires a payable address argument.
You can easily fix this is several different ways. Which would you choose? If you’re not sure, have a look at some of the other students’ solutions, and the feedback and comments they’ve received, posted here in this discussion topic. You will find a lot of useful information here.
(7)
You are right that HelloWorld/Bank only needs to inherit Destroyable, because it will inherit Ownable implicitly via Destroyable. This gives you a multi-level inheritance structure. However, this means that this file needs to import the file that contains your Destroyable contract, not Ownable.sol
If you post your corrected version, we’ll take a look at it for you. But let us know if anything is unclear, if you need any more help, or if you have any questions