Skip to main content

Solidity API

Contract: VerifierModule

registerVerifierBond

function registerVerifierBondfunction registerVerifierBond(address digitalAssetAddress, uint256 digitalAssetId, address verifier, uint256 bondedAmount) external

Parameters

NameDescription
digitalAssetAddressThe address of the digital asset contract
digitalAssetIdThe token ID of the digital asset
verifierThe address of the verifier
bondedAmountThe amount of tokens bonded by the verifier
Dev: Register a verifier’s bond for a specific verified rights

receiveFees

function receiveFeesfunction receiveFees(address digitalAssetAddress, uint256 digitalAssetId, uint256 amount, address sender) external

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe token ID of the DigitalAsset
amountThe amount of tokens that should have been sent to this contract
senderThe address that sent the tokens
Dev: Receive rewards for a specific VR (called by CulturaRightsBoundAccount)

claimRewards

function claimRewardsfunction claimRewards(address digitalAssetAddress, uint256 digitalAssetId) external

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe token ID of the DigitalAsset
Dev: Allow an verifier to claim their rewards for a specific VR

distributeRewards

function distributeRewardsfunction distributeRewards(address digitalAssetAddress, uint256 digitalAssetId, address boundAccount, uint256 period) external

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe token ID of the DigitalAsset
boundAccountThe address of the CulturaRightsBoundAccount
periodThe payment period to claim from
Dev: Allows any verifier to trigger the distribution of rewards from the bound account

getVerifierBond

function getVerifierBondfunction getVerifierBond(address digitalAssetAddress, uint256 digitalAssetId, address verifier) external view returns (uint256)

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe token ID of the DigitalAsset
verifierThe 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

function getTotalBondedAmountfunction getTotalBondedAmount(address digitalAssetAddress, uint256 digitalAssetId) external view returns (uint256)

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe 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

function constructorconstructor(address _paymentToken, address _casAddress) public

Parameters

NameDescription
_paymentTokenThe address of the ERC20 token used for payments
_casAddressThe address of the Cultura Attestation Service
Dev: Initialize the contract with payment token address and CAS address

calculateClaimableRewards

function calculateClaimableRewardsfunction calculateClaimableRewards(address digitalAssetAddress, uint256 digitalAssetId, address verifier) public view returns (uint256 claimableAmount)

Parameters

NameDescription
digitalAssetAddressThe address of the DigitalAsset contract
digitalAssetIdThe token ID of the DigitalAsset
verifierThe 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

event VerifierRegisteredevent VerifierRegistered(bytes32 vrId, address verifier, uint256 bondedAmount)

RewardsReceived

event RewardsReceivedevent RewardsReceived(bytes32 vrId, uint256 amount)

RewardsClaimed

event RewardsClaimedevent RewardsClaimed(bytes32 vrId, address verifier, uint256 amount)

RewardsDistributed

event RewardsDistributedevent RewardsDistributed(bytes32 vrId, address boundAccount, uint256 period, uint256 amount)

Custom Errors

ZeroAddress

error ZeroAddresserror ZeroAddress(string paramName)

OnlyCASCanRegisterVerifiers

error OnlyCASCanRegisterVerifierserror OnlyCASCanRegisterVerifiers()

NoVerifiersRegisteredForVR

error NoVerifiersRegisteredForVRerror NoVerifiersRegisteredForVR()

TokenTransferFailed

error TokenTransferFailederror TokenTransferFailed()

NoRewardsToClaim

error NoRewardsToClaimerror NoRewardsToClaim()

NotAnVerifierForVR

error NotAnVerifierForVRerror NotAnVerifierForVR()

NoRewardsToDistribute

error NoRewardsToDistributeerror NoRewardsToDistribute()