> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cultura.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# VerifierModule

# Solidity API

# Contract: VerifierModule

### registerVerifierBond

```solidity theme={null}
function registerVerifierBondfunction registerVerifierBond(address digitalAssetAddress, uint256 digitalAssetId, address verifier, uint256 bondedAmount) external
```

#### Parameters

| Name                  | Description                                 |
| --------------------- | ------------------------------------------- |
| `digitalAssetAddress` | The address of the digital asset contract   |
| `digitalAssetId`      | The token ID of the digital asset           |
| `verifier`            | The address of the verifier                 |
| `bondedAmount`        | The amount of tokens bonded by the verifier |

*Dev:* Register a verifier's bond for a specific verified rights

### receiveFees

```solidity theme={null}
function receiveFeesfunction receiveFees(address digitalAssetAddress, uint256 digitalAssetId, uint256 amount, address sender) external
```

#### Parameters

| Name                  | Description                                                      |
| --------------------- | ---------------------------------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract                         |
| `digitalAssetId`      | The token ID of the DigitalAsset                                 |
| `amount`              | The amount of tokens that should have been sent to this contract |
| `sender`              | The address that sent the tokens                                 |

*Dev:* Receive rewards for a specific VR (called by CulturaRightsBoundAccount)

### claimRewards

```solidity theme={null}
function claimRewardsfunction claimRewards(address digitalAssetAddress, uint256 digitalAssetId) external
```

#### Parameters

| Name                  | Description                              |
| --------------------- | ---------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract |
| `digitalAssetId`      | The token ID of the DigitalAsset         |

*Dev:* Allow an verifier to claim their rewards for a specific VR

### distributeRewards

```solidity theme={null}
function distributeRewardsfunction distributeRewards(address digitalAssetAddress, uint256 digitalAssetId, address boundAccount, uint256 period) external
```

#### Parameters

| Name                  | Description                                  |
| --------------------- | -------------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract     |
| `digitalAssetId`      | The token ID of the DigitalAsset             |
| `boundAccount`        | The address of the CulturaRightsBoundAccount |
| `period`              | The payment period to claim from             |

*Dev:* Allows any verifier to trigger the distribution of rewards from the bound account

### getVerifierBond

```solidity theme={null}
function getVerifierBondfunction getVerifierBond(address digitalAssetAddress, uint256 digitalAssetId, address verifier) external view returns (uint256)
```

#### Parameters

| Name                  | Description                              |
| --------------------- | ---------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract |
| `digitalAssetId`      | The token ID of the DigitalAsset         |
| `verifier`            | The address of the verifier              |

#### Return Values

| Description                                 |
| ------------------------------------------- |
| The amount of tokens bonded by the verifier |

*Dev:* Get the amount of tokens an verifier has bonded for a specific VR

### getTotalBondedAmount

```solidity theme={null}
function getTotalBondedAmountfunction getTotalBondedAmount(address digitalAssetAddress, uint256 digitalAssetId) external view returns (uint256)
```

#### Parameters

| Name                  | Description                              |
| --------------------- | ---------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract |
| `digitalAssetId`      | The token ID of the DigitalAsset         |

#### Return Values

| Description                                  |
| -------------------------------------------- |
| The total amount of tokens bonded for the VR |

*Dev:* Get the total amount of tokens bonded for a specific VR

## Public Functions

### constructor

```solidity theme={null}
function constructorconstructor(address _paymentToken, address _casAddress) public
```

#### Parameters

| Name            | Description                                      |
| --------------- | ------------------------------------------------ |
| `_paymentToken` | The address of the ERC20 token used for payments |
| `_casAddress`   | The address of the Cultura Attestation Service   |

*Dev:* Initialize the contract with payment token address and CAS address

### calculateClaimableRewards

```solidity theme={null}
function calculateClaimableRewardsfunction calculateClaimableRewards(address digitalAssetAddress, uint256 digitalAssetId, address verifier) public view returns (uint256 claimableAmount)
```

#### Parameters

| Name                  | Description                              |
| --------------------- | ---------------------------------------- |
| `digitalAssetAddress` | The address of the DigitalAsset contract |
| `digitalAssetId`      | The token ID of the DigitalAsset         |
| `verifier`            | The address of the verifier              |

#### Return Values

| Description                                 |
| ------------------------------------------- |
| The amount of tokens the verifier can claim |

*Dev:* Calculate the claimable rewards for an verifier for a specific VR

## Events

### `VerifierRegistered`

```solidity theme={null}
event VerifierRegisteredevent VerifierRegistered(bytes32 vrId, address verifier, uint256 bondedAmount)
```

### `RewardsReceived`

```solidity theme={null}
event RewardsReceivedevent RewardsReceived(bytes32 vrId, uint256 amount)
```

### `RewardsClaimed`

```solidity theme={null}
event RewardsClaimedevent RewardsClaimed(bytes32 vrId, address verifier, uint256 amount)
```

### `RewardsDistributed`

```solidity theme={null}
event RewardsDistributedevent RewardsDistributed(bytes32 vrId, address boundAccount, uint256 period, uint256 amount)
```

## Custom Errors

### `ZeroAddress`

```solidity theme={null}
error ZeroAddresserror ZeroAddress(string paramName)
```

### `OnlyCASCanRegisterVerifiers`

```solidity theme={null}
error OnlyCASCanRegisterVerifierserror OnlyCASCanRegisterVerifiers()
```

### `NoVerifiersRegisteredForVR`

```solidity theme={null}
error NoVerifiersRegisteredForVRerror NoVerifiersRegisteredForVR()
```

### `TokenTransferFailed`

```solidity theme={null}
error TokenTransferFailederror TokenTransferFailed()
```

### `NoRewardsToClaim`

```solidity theme={null}
error NoRewardsToClaimerror NoRewardsToClaim()
```

### `NotAnVerifierForVR`

```solidity theme={null}
error NotAnVerifierForVRerror NotAnVerifierForVR()
```

### `NoRewardsToDistribute`

```solidity theme={null}
error NoRewardsToDistributeerror NoRewardsToDistribute()
```
