Destruction derby contract:
import “./Ownable.sol”;
pragma solidity 0.5.12;
contract Destroyable is Ownable {
function destroyContract () public onlyOwner{
selfdestruct(msg.sender);
}
}
What if someone else would deploy a Ownable.sol contract with exact same functionality :
pragma solidity 0.5.12;
contract Ownable{
address public owner;
constructor () public {
// is only called when contract is created
owner = msg.sender;
}
modifier onlyOwner(){
require(msg.sender == owner);
_; // tells solidity to continue execution
}
}
Could he/she then be the owner of the parent contract in the eyes of the EVM? and thus be allowed to call the destroyContract function or withdrawAll function and get all the ethers stored in the contract?