This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Parent { | |
function add(uint _a, uint _b) public pure returns (uint) { | |
return _a + _b; | |
} | |
function getBalance() public view returns (uint) { | |
return address(this).balance; | |
} | |
} | |
contract Child { | |
Parent newA = new Parent(); | |
function getAdd(uint _a, uint _b) public view returns (uint) { | |
return newA.add(_a, _b); | |
} | |
function getBalance() public view returns (uint) { | |
return newA.getBalance(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment