Skip to main content

Solidity API

Contract: ICRS

External Functions

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

NameDescription
tokenIdThe ID of the token.
amountDueThe amount of royalty due for the period.
startDateThe start date of the royalty period (Unix timestamp).
endDateThe end date of the royalty period (Unix timestamp).
royaltyInfoIndexThe 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

NameDescription
tokenIdThe ID of the token.
amountPaidThe amount being paid on-chain.
periodIndexThe index of the royalty period being paid.
culturaBoundAccountThe address of the associated Cultura Rights Bound Account.
signatureSignature 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

NameDescription
tokenIdThe ID of the VR token.
periodIndexThe index of the royalty period.
amountThe amount reported as paid off-chain.
metadataOptional 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

NameDescription
tokenIdThe ID of the VR token.
periodIndexThe index of the royalty period.
culturaBoundAccountThe address of the associated Cultura Rights Bound Account.
signatureThe 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

NameDescription
tokenIdThe ID of the VR token.
periodIndexThe index of the royalty period.
signatureThe 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

NameDescription
tokenIdThe 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

NameDescription
tokenIdThe ID of the token.
periodIndexThe 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

NameDescription
tokenIdThe ID of the token.

Return Values

Description
The number of royalty periods.

Events

RoyaltyDueRegistered

event RoyaltyDueRegisteredevent RoyaltyDueRegistered(uint256 tokenId, address creator, uint256 startDate, uint256 endDate, uint256 amountDue, uint256 periodIndex)

RoyaltyPaid

event RoyaltyPaidevent RoyaltyPaid(uint256 tokenId, address payer, uint256 periodStart, uint256 periodEnd, uint256 amountPaid)

OffChainPaymentReported

event OffChainPaymentReportedevent OffChainPaymentReported(uint256 tokenId, uint256 periodIndex, address reporter, uint256 reportedAmount, string metadata)

OffChainPaymentAccepted

event OffChainPaymentAcceptedevent OffChainPaymentAccepted(uint256 tokenId, uint256 periodIndex, address acceptor, uint256 acceptedAmount, bytes signature)

OffChainPaymentDenied

event OffChainPaymentDeniedevent OffChainPaymentDenied(uint256 tokenId, uint256 periodIndex, address denier, bytes signature)