Skip to main content

Solidity API

Grade

struct Grade {
  string name;
  uint256 fee;
  uint256 requiredTokens;
  uint256 requiredWLVerifiers;
  uint256 requiredCommunityUsers;
}

AttestationRequestData

A struct representing the arguments of the attestation request.
struct AttestationRequestData {
  address recipient;
  uint64 expirationTime;
  bool revocable;
  bytes32 refUID;
  bytes data;
}

AttestationRequest

A struct representing the full arguments of the attestation request.
struct AttestationRequest {
  bytes32 schema;
  struct AttestationRequestData data;
}

AttestationsResult

A struct representing an internal attestation result.
struct AttestationsResult {
  uint256 usedValue;
  bytes32[] uids;
}

ChallengeRequestData

A struct representing the arguments of the attestation request.
struct ChallengeRequestData {
  address recipient;
  uint64 expirationTime;
  bool revocable;
  bytes32 refUID;
  bytes data;
  uint256 value;
}

ChallengeRequest

A struct representing the full arguments of the attestation request.
struct ChallengeRequest {
  bytes32 attestation;
  struct ChallengeRequestData data;
}

CulturaRightsBoundAccountInfo

struct CulturaRightsBoundAccountInfo {
  address rightsBoundAccount;
  address attester;
  address digitalAssetAddress;
  uint256 digitalAssetId;
}

TransferFailed

error TransferFailed()
Custom errors for better reverts

VerifierNotWhitelisted

error VerifierNotWhitelisted()

AttestationDoesNotExist

error AttestationDoesNotExist()

AlreadyRevoked

error AlreadyRevoked()

AlreadyRevokedOffchain

error AlreadyRevokedOffchain()

AlreadyTimestamped

error AlreadyTimestamped()

InsufficientValue

error InsufficientValue()

InvalidAttestation

error InvalidAttestation()

InvalidAttestations

error InvalidAttestations()

InvalidExpirationTime

error InvalidExpirationTime()

InvalidOffset

error InvalidOffset()

InvalidRegistry

error InvalidRegistry()

InvalidRevocation

error InvalidRevocation()

InvalidRevocations

error InvalidRevocations()

InvalidSchema

error InvalidSchema()

InvalidVerifier

error InvalidVerifier()

Irrevocable

error Irrevocable()

NotPayable

error NotPayable()

WrongSchema

error WrongSchema()

LevelAlreadyExists

error LevelAlreadyExists()

DigitalAssetCollectionCantBe0Address

error DigitalAssetCollectionCantBe0Address()

ValueSentLessThanGradeFee

error ValueSentLessThanGradeFee()

AssetHasToBeVerifiedRights

error AssetHasToBeVerifiedRights()

Contract: ICAS

CAS - Cultura Attestation Service interface.

External Functions

getSchemaRegistry

function getSchemaRegistryfunction getSchemaRegistry() external view returns (contract ISchemaRegistry)
Returns the address of the global schema registry.

Return Values

Description
The address of the global schema registry.

attest

function attestfunction attest(struct AttestationRequest request, address digitalAssetAddress, uint256 digitalAssetId, uint256 grade, uint256 amount) external returns (bytes32)
Creates an attestation for a digital asset with specified grade and bonded amount

Parameters

NameDescription
requestThe attestation request containing schema and data
digitalAssetAddressThe address of the digital asset contract
digitalAssetIdThe token ID of the digital asset
gradeThe grade level to assign (0=S, 1=A, 2=B, 3=C)
amountThe amount of bond tokens to lock

Return Values

Description
UID The UID of the new attestation

delegatedAttest

function delegatedAttestfunction delegatedAttest(struct SignatureUtils.SignatureParams delegatedSignature, struct AttestationRequest request, address digitalAssetAddress, uint256 digitalAssetId, uint256 grade, uint256 amount, address attester) external returns (bytes32)
Allows users to attest to a specific schema on behalf of another user

Parameters

NameDescription
delegatedSignatureThe signature of the delegating user
requestThe attestation request data
digitalAssetAddressThe address of the digital asset collection
digitalAssetIdThe ID of the digital asset
gradeThe grade of the digital asset
amountThe amount of bond tokens to send
attesterThe address of the attester

Return Values

Description
The UID of the new attestation

verifyAttestation

function verifyAttestationfunction verifyAttestation(bytes32 attestationUID, uint256 bondedAmount) external
Verifies an attestation

challengeAttestation

function challengeAttestationfunction challengeAttestation(struct ChallengeRequest request, uint256 challengeAmount) external
Challenges an existing attestation by withdrawing bonded tokens

Parameters

NameDescription
requestThe challenge request containing attestation UID and data
challengeAmountThe amount of bonded tokens to withdraw in the challenge

isAttestationValid

function isAttestationValidfunction isAttestationValid(bytes32 uid) external view returns (bool)
Checks whether an attestation exists.

Parameters

NameDescription
uidThe UID of the attestation to retrieve.

Return Values

Description
Whether an attestation exists.

addWLVerifier

function addWLVerifierfunction addWLVerifier(address verifier) external
Adds a whitelisted verifier to the contract

Parameters

NameDescription
verifierThe address of the verifier to add

removeWLVerifier

function removeWLVerifierfunction removeWLVerifier(address verifier) external
Removes a whitelisted verifier from the contract

Parameters

NameDescription
verifierThe address of the verifier to remove

getNonce

function getNoncefunction getNonce(address user) external view returns (uint256)
Returns the nonce for a given user.

Parameters

NameDescription
userThe address of the user.

Return Values

Description
The nonce for the user.

Events

Attested

event Attestedevent Attested(address recipient, address attester, bytes32 uid, bytes32 schemaUID, uint256 grade)
Emitted when an attestation has been made.

Verified

event Verifiedevent Verified(address attester, bytes32 attestationUID)

Challenged

event Challengedevent Challenged(address challenger, bytes32 uid, uint256 bondedAmount)
Emitted when an attestation has been challenged.

Revoked

event Revokedevent Revoked(address recipient, address attester, bytes32 uid, bytes32 schemaUID)
Emitted when an attestation has been revoked.

Timestamped

event Timestampedevent Timestamped(bytes32 data, uint64 timestamp)
Emitted when a data has been timestamped.

RevokedOffchain

event RevokedOffchainevent RevokedOffchain(address revoker, bytes32 data, uint64 timestamp)
Emitted when a data has been revoked.

CulturaRightsBoundAccountDeployed

event CulturaRightsBoundAccountDeployedevent CulturaRightsBoundAccountDeployed(struct CulturaRightsBoundAccountInfo rightsBoundAccount)
Emitted when a CulturaRightsBoundAccount has been deployed.

VerifierWLStateChanged

event VerifierWLStateChangedevent VerifierWLStateChanged(address verifier, bool isWhitelisted)
Emitted when a user is promoted or demoted from Verifier Whitelist.