contract_new.sol 408 B

1234567891011121314151617181920
  1. contract hatchling {
  2. string name;
  3. address private origin;
  4. constructor(string id, address parent) {
  5. require(id != "", "name must be provided");
  6. name = id;
  7. origin = parent;
  8. }
  9. function root() public returns (address) {
  10. return origin;
  11. }
  12. }
  13. contract adult {
  14. function test() public {
  15. hatchling h = new hatchling("luna", address(this));
  16. }
  17. }