contract SubChain {

  address[] public subChains;
  mapping(address => bool) public isSubChain;

  event SubChainAdded(address indexed subChain);

  constructor() public {}

  /// @notice list all sub chains
  function getSubChains() public view returns (address[] memory) {return subChains;}

  /// @notice add a sub chain
  function addSubChain() external {
    isSubChain[msg.sender] = true;
    subChains.push(msg.sender);
    emit SubChainAdded(msg.sender);
  }
}
/// @notice providing an sub chain mechanism
function getSubChains() public view returns (address[] memory) {return subChains;}

/// @notice list all sub chains