Code has been added to clipboard!
Solidity Inheritance Example 3
Example
pragma solidity ^0.4.0;
contract ownedContract {
function ownedContract() { ownerAddress = msg.sender; }
address ownerAddress;
}
contract mortalContract is ownedContract {
function killOwner() {
if (msg.sender == ownerAddress) selfdestruct(ownerAddress);
}
}
contract BaseNo1 is mortalContract {
function killOwner() { /* do cleanup 1 */ super.killOwner(); }
}
contract BaseNo2 is mortalContract {
function killOwner() { /* do cleanup 2 */ super.killOwner(); }
}
contract Final is BaseNo2, BaseNo1 {
}