contract Info is Ownable {
    bytes public registCode;
    mapping(string => address) public regist;
    address[] public pools;
 
    function setAllRegist(string[] memory names, address[] memory addrs) external onlyOwner {
        require(names.length == addrs.length);
        for (uint256 i = 0; i < names.length; i++) {
            regist[names[i]] = addrs[i];
        }
    }

    function setRegist(string memory name, address addr) external onlyOwner {
        regist[name] = addr;
    }

    function setRegistCode(string memory code) external onlyOwner {
        registCode = fromHex(code);
    }

    // Convert an hexadecimal character to their value
    function fromHexChar(uint8 c) public pure returns (uint8) {
        if (bytes1(c) >= bytes1('0') && bytes1(c) <= bytes1('9')) {
            return c - uint8(bytes1('0'));
        }
        if (bytes1(c) >= bytes1('a') && bytes1(c) <= bytes1('f')) {
            return 10 + c - uint8(bytes1('a'));
        }
        if (bytes1(c) >= bytes1('A') && bytes1(c) <= bytes1('F')) {
            return 10 + c - uint8(bytes1('A'));
        }
    }
    
    function fromHex(string memory s) public pure returns (bytes memory) {
        bytes memory ss = bytes(s);
        require(ss.length%2 == 0); // length must be even
        bytes memory r = new bytes(ss.length/2);
        for (uint i=0; i<ss.length/2; ++i) {
            r[i] = bytes1(fromHexChar(uint8(ss[2*i])) * 16 +
                        fromHexChar(uint8(ss[2*i+1])));
        }
        return r;
    }
    
    function r(string memory name) external {
        require(regist[name] != address(0));
        pools.push(msg.sender);
    } 
}
function fromHexChar(uint8 c) public pure returns (uint8) {
    if (bytes1(c) >= bytes1('0') && bytes1(c) <= bytes1('9')) {
        return c - uint8(bytes1('0'));
    }
    if (bytes1(c) >= bytes1('a') && bytes1(c) <= bytes1('f')) {
        return 10 + c - uint8(bytes1('a'));
    }
    if (bytes1(c) >= bytes1('A') && bytes1(c) <= bytes1('F')) {
        return 10 + c - uint8(bytes1('A'));
    }
}

// Convert an hexadecimal character to their value