contract ChainCoOwner is ChainOwner {

    mapping(address=>bool) internal coOwner;
    
    address[] internal coOwnerList;

    /**
     * @param _parent The parent smart contract
     * @param _coOwner Array of coOwner
    */
    function ChainCoOwner(OwnerERC20 _parent, address[] _coOwner) ChainOwner(_parent) internal {
        _addCoOwners(_coOwner);
    }
    
    function _addCoOwners(address[] _coOwner) internal {
        uint len = _coOwner.length;
        for (uint i=0; i < len; i++) {
            coOwner[_coOwner[i]] = true;
            coOwnerList.push(_coOwner[i]);
        }
    }

    function _addCoOwner(address _coOwner) internal {
        coOwner[_coOwner] = true;
        coOwnerList.push(_coOwner);
    }

    function _disableCoOwners(address[] _coOwner) internal {
        uint len = _coOwner.length;
        for (uint i=0; i < len; i++) {
            coOwner[_coOwner[i]] = false;
        }
    }

    function _disableCoOwner(address _coOwner) internal {
        coOwner[_coOwner] = false;
    }

    /**
     * @dev Check address is valid owner (owner or coOwner)
     * @param _address Address to check
     * 
    */
    function isValidOwner(address _address) public view returns(bool) {
        if (_address == owner() || coOwner[_address] == true) {
            return true;
        }
        return false;
    }

}
/**
 * @title Utility smart contracts
 * @author Biglabs Pte. Ltd.
 * @dev Chain smart contract with the same owner
 */
function ChainCoOwner(OwnerERC20 _parent, address[] _coOwner) ChainOwner(_parent) internal {
    _addCoOwners(_coOwner);
}

/**
 * @param _parent The parent smart contract
 * @param _coOwner Array of coOwner
 */