github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/execution/wasm/parent.sol (about)

     1  pragma solidity >0.6.3;
     2  
     3  import "./child.sol";
     4  
     5  contract Parent {
     6  
     7  
     8      address payable owner;
     9      address[] public children; // public, list, get a child address at row #
    10  
    11  
    12      constructor () public payable{
    13          owner = msg.sender;
    14      }
    15  
    16  
    17      function createChild() public {
    18          Child child = new Child();
    19          children.push(address(child)); // you can use the getter to fetch child addresses
    20      }
    21      
    22      function getChild(uint256 index) public returns (address) {
    23          return children[index];
    24      }
    25      
    26      function close() public { 
    27          selfdestruct(owner); 
    28      }
    29      
    30      function txPrice() public returns (uint) {
    31          return tx.gasprice;
    32      }
    33      
    34      function blockDifficulty() public returns (uint256) {
    35          return block.difficulty;
    36      }
    37  }