> ## 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.

# CulturaRightsBoundAccount

# Solidity API

# Contract: IRoyaltyInfo

## External Functions

### getRoyaltyInfo

```solidity theme={null}
function getRoyaltyInfofunction getRoyaltyInfo(uint256 rightsId) external view returns (address[] parents, uint256[] percentages)
```

Returns the royalty splits for the rights.

#### Parameters

| Name       | Description          |
| ---------- | -------------------- |
| `rightsId` | The rights token ID. |

#### Return Values

| Description                                                                             |
| --------------------------------------------------------------------------------------- |
| An array of beneficiary addresses.                                                      |
| An array of their corresponding split percentages (in basis points, e.g. 10000 = 100%). |

# Contract: CulturaRightsBoundAccount

This contract is "bound" to a specific rights.

There are two main functions:

1. setPaymentInfo
   * Intended to be called by a royalty module.
   * Requires a valid EIP‑712 signature from the rights holder.
   * Accepts payment data (beneficiaries and ERC20 token amounts) for a given payment period,
     representing 75% of the total payment.
   * Pulls ERC20 tokens from the rights holder into the contract.
   * Then appends the mandatory splits (Cultura Treasury and Verifier Module) so that
     the total payment is divided as:
     • Provided splits: 75%
     • Cultura Treasury: 5%
     • Verifier Module: 20%

2. claim
   * Each beneficiary can claim their individual share for a given period.

### setPaymentInfo

```solidity theme={null}
function setPaymentInfofunction setPaymentInfo(struct ICulturaRightsBoundAccount.PaymentInput input) external
```

Sets the payment info for the current period.

#### Parameters

| Name    | Description                                                                       |
| ------- | --------------------------------------------------------------------------------- |
| `input` | PaymentInput containing participants, amounts, totalAmount, signature and signer. |

The function sets individual claimable amounts for each beneficiary in a mapping,
combines the copying and summing loops for gas efficiency, and emits an event with
all assigned values for transparency. |

### claim

```solidity theme={null}
function claimfunction claim(uint256 period) external
```

Allows individual beneficiaries to claim their share for a given payment period.

#### Parameters

| Name     | Description                    |
| -------- | ------------------------------ |
| `period` | The payment period identifier. |

Each beneficiary can claim only once per period. On a successful claim,
their allocated amount is set to zero to prevent re-claims. |

### claimForVerifierModule

```solidity theme={null}
function claimForVerifierModulefunction claimForVerifierModule(uint256 period) external
```

Allows the verifier module to claim its share for a given payment period

#### Parameters

| Name     | Description                   |
| -------- | ----------------------------- |
| `period` | The payment period identifier |

### getPaymentAmount

```solidity theme={null}
function getPaymentAmountfunction getPaymentAmount(uint256 period, address beneficiary) external view returns (uint256 amount)
```

Gets the payment info for a given period and beneficiary

#### Parameters

| Name          | Description                    |
| ------------- | ------------------------------ |
| `period`      | The payment period             |
| `beneficiary` | The address of the beneficiary |

#### Return Values

| Description                             |
| --------------------------------------- |
| The amount allocated to the beneficiary |

## Public Functions

### constructor

```solidity theme={null}
function constructorconstructor(address _rightsContract, uint256 _rightsId, address _tokenAddress, address _culturaTreasury, address _verifierModule) public
```

Initialize the contract with the rights and ERC20 token addresses,
plus the fixed addresses for Cultura Treasury and Verifier Module.

The EIP‑712 domain is set with name "RightsControlledClaim" and version "1".

#### Parameters

| Name               | Description                                        |
| ------------------ | -------------------------------------------------- |
| `_rightsContract`  | The address of the rights contract.                |
| `_rightsId`        | The rights's token ID.                             |
| `_tokenAddress`    | The ERC20 token address used for royalty payments. |
| `_culturaTreasury` | The address that always receives 5% of the total.  |
| `_verifierModule`  | The address that always receives 20% of the total. |

## Events

### `PaymentInfoSet`

```solidity theme={null}
event PaymentInfoSetevent PaymentInfoSet(uint256 period, address[] beneficiaries, uint256[] amounts, uint256 totalAmount)
```

Emitted when the payment info for a period has been set.

### `Claimed`

```solidity theme={null}
event Claimedevent Claimed(uint256 period, address beneficiary, uint256 amount)
```

Emitted when a beneficiary successfully claims their share for a payment period.

## Custom Errors

### `ZeroAddressNotAllowed`

```solidity theme={null}
error ZeroAddressNotAllowederror ZeroAddressNotAllowed(string paramName)
```

### `InvalidSignature`

```solidity theme={null}
error InvalidSignatureerror InvalidSignature(string reason)
```

### `ArrayLengthMismatch`

```solidity theme={null}
error ArrayLengthMismatcherror ArrayLengthMismatch()
```

### `PaymentInfoAlreadySet`

```solidity theme={null}
error PaymentInfoAlreadySeterror PaymentInfoAlreadySet()
```

### `InvalidProvidedAmount`

```solidity theme={null}
error InvalidProvidedAmounterror InvalidProvidedAmount()
```

### `NoPaymentInfoForPeriod`

```solidity theme={null}
error NoPaymentInfoForPerioderror NoPaymentInfoForPeriod()
```

### `NothingToClaim`

```solidity theme={null}
error NothingToClaimerror NothingToClaim()
```

### `VerifiersShouldClaimThroughModule`

```solidity theme={null}
error VerifiersShouldClaimThroughModuleerror VerifiersShouldClaimThroughModule()
```

### `OnlyVerifierModuleCanCall`

```solidity theme={null}
error OnlyVerifierModuleCanCallerror OnlyVerifierModuleCanCall()
```

### `VerifierModuleNotEnabled`

```solidity theme={null}
error VerifierModuleNotEnablederror VerifierModuleNotEnabled()
```
