-
-
Save aeharvlee/b3b4359af6b81c14604cdd5f01a4e317 to your computer and use it in GitHub Desktop.
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
pragma solidity ^0.5.0; | |
contract Daughter { | |
string public name; | |
uint public age; | |
constructor( | |
string memory _daughtersName, | |
uint _daughtersAge | |
) | |
public | |
{ | |
name = _daughtersName; | |
age = _daughtersAge; | |
} | |
} | |
contract Mom { | |
string public name; | |
uint public age; | |
Daughter public daughter; | |
function build( | |
string memory _momsName, | |
uint _momsAge, | |
string memory _daughtersName, | |
uint _daughtersAge | |
) public { | |
daughter = new Daughter(_daughtersName, _daughtersAge); | |
name = _momsName; | |
age = _momsAge; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment