> For the complete documentation index, see [llms.txt](https://elacity.gitbook.io/elacity-sdks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elacity.gitbook.io/elacity-sdks/protocol/v2.0/references/modules/verifiermodule.md).

# VerifierModule

Verifies license requests signed with EIP-712 typed data.

\_Uses generated encoder/recovery helpers from `EIP712Decoder`.

`EIP712Decoder` contract is generated by [eip712-codegen](https://github.com/danfinlay/eip712-codegen) check the [readme file](https://github.com/danfinlay/eip712-codegen#readme)

`./node_modules/.bin/712gen ./typedData.js | sed "s/0.8.13/0.8.20/g" > contracts/modules/utils/TypedDataDecoder.sol`\_

## \_\_VerifierModule\_init

```solidity
function __VerifierModule_init(string contractName, string version) internal
```

Initializes domain parameters used for EIP-712 verification.

### Parameters

| Name         | Type   | Description                                 |
| ------------ | ------ | ------------------------------------------- |
| contractName | string | Name used in the EIP-712 domain.            |
| version      | string | Protocol version string used in the domain. |

## protocolVersion

```solidity
function protocolVersion() public view returns (string)
```

Returns the configured protocol version.

### Return Values

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| \[0] | string | Protocol version string. |

## verifyLicenseRequest

```solidity
function verifyLicenseRequest(struct LicenseRequest lr, bytes sig) public view returns (address)
```

Verifies a license request signature and returns the recovered signer.

### Parameters

| Name | Type                  | Description              |
| ---- | --------------------- | ------------------------ |
| lr   | struct LicenseRequest | License request payload. |
| sig  | bytes                 | Signature bytes.         |

### Return Values

| Name | Type    | Description                      |
| ---- | ------- | -------------------------------- |
| \[0] | address | signer Recovered signer address. |

## \_getLicenseRequestTypedDataHash

```solidity
function _getLicenseRequestTypedDataHash(struct LicenseRequest lr) internal view returns (bytes32)
```

Computes the EIP-712 digest for a license request.

### Parameters

| Name | Type                  | Description              |
| ---- | --------------------- | ------------------------ |
| lr   | struct LicenseRequest | License request payload. |

### Return Values

| Name | Type    | Description                              |
| ---- | ------- | ---------------------------------------- |
| \[0] | bytes32 | Digest hash used for signature recovery. |
