{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/lib/EIP712Base.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "keccak256(bytes)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract EIP712Base is Initializable {\n    struct EIP712Domain {\n        string name;\n        string version;\n        address verifyingContract;\n        bytes32 salt;\n    }\n\n    bytes32 internal constant EIP712_DOMAIN_TYPEHASH =\n        keccak256(\n            bytes(\n                \"EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)\"\n            )\n        );\n    bytes32 internal domainSeperator;\n    uint256 private cachedChainId;\n    string private cachedName;\n    string private cachedVersion;\n\n    // supposed to be called once while initializing.\n    // one of the contractsa that inherits this contract follows proxy pattern\n    // so it is not possible to do this in a constructor\n    function _initializeEIP712(string memory name, string memory version)\n        internal\n        initializer\n    {\n        cachedChainId = getChainId();\n        cachedName = name;\n        cachedVersion = version;\n        _setDomainSeperator(name, version);\n    }\n\n    function _setDomainSeperator(string memory name, string memory version)\n        internal\n    {\n        domainSeperator = keccak256(\n            abi.encode(\n                EIP712_DOMAIN_TYPEHASH,\n                keccak256(bytes(name)),\n                keccak256(bytes(version)),\n                address(this),\n                bytes32(getChainId())\n            )\n        );\n    }\n\n    function getDomainSeperator() public view returns (bytes32) {\n        if (getChainId() == cachedChainId) {\n            return domainSeperator;\n        } else {\n            return\n                keccak256(\n                    abi.encode(\n                        EIP712_DOMAIN_TYPEHASH,\n                        keccak256(bytes(cachedName)),\n                        keccak256(bytes(cachedVersion)),\n                        address(this),\n                        bytes32(getChainId())\n                    )\n                );\n        }\n    }\n\n    function getChainId() public view returns (uint256) {\n        return block.chainid;\n    }\n\n    /**\n     * Accept message hash and returns hash message in EIP712 compatible form\n     * So that it can be used to recover signer from signature signed using EIP712 formatted data\n     * https://eips.ethereum.org/EIPS/eip-712\n     * \"\\\\x19\" makes the encoding deterministic\n     * \"\\\\x01\" is the version byte to make it compatible to EIP-191\n     */\n    function toTypedMessageHash(bytes32 messageHash)\n        internal\n        view\n        returns (bytes32)\n    {\n        return\n            keccak256(\n                abi.encodePacked(\"\\x19\\x01\", getDomainSeperator(), messageHash)\n            );\n    }\n}"
}