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.
Solidity API
Contract: CRS
registerRoyaltyDue
function registerRoyaltyDuefunction registerRoyaltyDue(uint256 tokenId, uint256 amountDue, uint256 startDate, uint256 endDate, uint256 royaltyInfoIndex) external
Registers or updates the royalty amount due for a specific token and period index.
Parameters
| Name | Description |
|---|
tokenId | The ID of the token. |
amountDue | The amount of royalty due for the period. |
startDate | The start date of the royalty period (Unix timestamp). |
endDate | The end date of the royalty period (Unix timestamp). |
royaltyInfoIndex | The index for the royalty period (0-based). |
Dev: Can only be called by the VR creator. Creates a new period if index equals current count.
payRoyalty
function payRoyaltyfunction payRoyalty(uint256 tokenId, uint256 amountPaid, uint256 periodIndex, address culturaBoundAccount, bytes signature) external
Processes an on-chain royalty payment for a specific token and period.
Parameters
| Name | Description |
|---|
tokenId | The ID of the token. |
amountPaid | The amount being paid on-chain. |
periodIndex | The index of the royalty period being paid. |
culturaBoundAccount | The address of the associated Cultura Rights Bound Account. |
signature | Signature required by the CulturaRightsBoundAccount’s setPaymentInfo function. |
Dev: Can only be called by the VR creator. Interacts with the CulturaRightsBoundAccount.
reportOffChainPayment
function reportOffChainPaymentfunction reportOffChainPayment(uint256 tokenId, uint256 periodIndex, uint256 amount, string metadata) external
Reports an off-chain payment made for a specific royalty period.
Parameters
| Name | Description |
|---|
tokenId | The ID of the VR token. |
periodIndex | The index of the royalty period. |
amount | The amount reported as paid off-chain. |
metadata | Optional metadata about the payment (e.g., transaction ID). |
Dev: Can only be called by the VR creator. Sets the payment status to PENDING.
acceptOffChainPayment
function acceptOffChainPaymentfunction acceptOffChainPayment(uint256 tokenId, uint256 periodIndex, address culturaBoundAccount, bytes signature) external
Accepts a pending off-chain payment report.
Parameters
| Name | Description |
|---|
tokenId | The ID of the VR token. |
periodIndex | The index of the royalty period. |
culturaBoundAccount | The address of the associated Cultura Rights Bound Account. |
signature | The VR owner’s EIP712 signature confirming acceptance. |
Dev: Can only be called by the current owner of the VR. Requires EIP712 signature.
Transfers calculated fees from the VR owner to the Cultura Rights Bound Account.
denyOffChainPayment
function denyOffChainPaymentfunction denyOffChainPayment(uint256 tokenId, uint256 periodIndex, bytes signature) external
Denies a pending off-chain payment report.
Parameters
| Name | Description |
|---|
tokenId | The ID of the VR token. |
periodIndex | The index of the royalty period. |
signature | The VR owner’s EIP712 signature confirming denial. |
Dev: Can only be called by the current owner of the VR. Requires EIP712 signature.
getFullRoyaltyInfo
function getFullRoyaltyInfofunction getFullRoyaltyInfo(uint256 tokenId) external view returns (struct ICRS.RoyaltyInfoView[])
Retrieves all royalty information views for a specific token.
Parameters
| Name | Description |
|---|
tokenId | The ID of the token. |
Return Values
| Description |
|---|
| An array of RoyaltyInfoView structs. |
getRoyaltyInfoPeriod
function getRoyaltyInfoPeriodfunction getRoyaltyInfoPeriod(uint256 tokenId, uint256 periodIndex) external view returns (uint256 periodStart, uint256 periodEnd, uint256 amountDue, uint256 amountPaid, uint256[] parentPendingClaims)
Retrieves royalty information for a specific token and period index.
Parameters
| Name | Description |
|---|
tokenId | The ID of the token. |
periodIndex | The index of the royalty period. |
Return Values
| Description |
|---|
| The start of the royalty period. |
| The end of the royalty period. |
| The amount currently due for the period. |
| The amount already paid for the period. |
| Empty array (placeholder for signature compatibility). |
getRoyaltyInfoCount
function getRoyaltyInfoCountfunction getRoyaltyInfoCount(uint256 tokenId) external view returns (uint256)
Retrieves the count of royalty periods registered for a specific token.
Parameters
| Name | Description |
|---|
tokenId | The ID of the token. |
Return Values
| Description |
|---|
| The number of royalty periods. |
Public Functions
constructor
function constructorconstructor(address _culturaDigitalAssetAddress, address _culturaPaymentTokenAddress) public
Dev: Initializes the contract with necessary addresses and EIP712 domain.
Custom Errors
InvalidAddress
error InvalidAddresserror InvalidAddress()
NotCreatorOfVR
error NotCreatorOfVRerror NotCreatorOfVR()
NotOwnerOfParentVR
error NotOwnerOfParentVRerror NotOwnerOfParentVR()
NoParentDigitalAssetToPay
error NoParentDigitalAssetToPayerror NoParentDigitalAssetToPay()
NoRoyaltyDue
error NoRoyaltyDueerror NoRoyaltyDue()
AmountPaidExceedsDue
error AmountPaidExceedsDueerror AmountPaidExceedsDue()
InvalidDateRange
error InvalidDateRangeerror InvalidDateRange()
InvalidPeriodIndex
error InvalidPeriodIndexerror InvalidPeriodIndex()
RoyaltyInfoIndexOutOfBounds
error RoyaltyInfoIndexOutOfBoundserror RoyaltyInfoIndexOutOfBounds()
RoyaltyInfoAlreadyExists
error RoyaltyInfoAlreadyExistserror RoyaltyInfoAlreadyExists()
NotVROwner
error NotVROwnererror NotVROwner()
IncorrectOffChainPaymentStatus
error IncorrectOffChainPaymentStatuserror IncorrectOffChainPaymentStatus(enum ICRS.OffChainPaymentStatus currentStatus, enum ICRS.OffChainPaymentStatus requiredStatus)
InsufficientBalanceForFees
error InsufficientBalanceForFeeserror InsufficientBalanceForFees(uint256 required, uint256 available)
InsufficientAllowanceForFees
error InsufficientAllowanceForFeeserror InsufficientAllowanceForFees(uint256 required, uint256 allowed)
OffChainPaymentAlreadyExists
error OffChainPaymentAlreadyExistserror OffChainPaymentAlreadyExists()
InvalidSignature
error InvalidSignatureerror InvalidSignature()
InvalidCulturaBoundAccount
error InvalidCulturaBoundAccounterror InvalidCulturaBoundAccount()
RoyaltyPeriodNotFound
error RoyaltyPeriodNotFounderror RoyaltyPeriodNotFound()
InvalidFeeCalculation
error InvalidFeeCalculationerror InvalidFeeCalculation()