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
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
Custom errors for better reverts
VerifierNotWhitelisted
error VerifierNotWhitelisted()
AttestationDoesNotExist
error AttestationDoesNotExist()
AlreadyRevoked
AlreadyRevokedOffchain
error AlreadyRevokedOffchain()
AlreadyTimestamped
error AlreadyTimestamped()
InsufficientValue
error InsufficientValue()
InvalidAttestation
error InvalidAttestation()
InvalidAttestations
error InvalidAttestations()
InvalidExpirationTime
error InvalidExpirationTime()
InvalidOffset
InvalidRegistry
InvalidRevocation
error InvalidRevocation()
InvalidRevocations
error InvalidRevocations()
InvalidSchema
InvalidVerifier
Irrevocable
NotPayable
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
| Name | Description |
|---|
request | The attestation request containing schema and data |
digitalAssetAddress | The address of the digital asset contract |
digitalAssetId | The token ID of the digital asset |
grade | The grade level to assign (0=S, 1=A, 2=B, 3=C) |
amount | The 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
| Name | Description |
|---|
delegatedSignature | The signature of the delegating user |
request | The attestation request data |
digitalAssetAddress | The address of the digital asset collection |
digitalAssetId | The ID of the digital asset |
grade | The grade of the digital asset |
amount | The amount of bond tokens to send |
attester | The 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
| Name | Description |
|---|
request | The challenge request containing attestation UID and data |
challengeAmount | The 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
| Name | Description |
|---|
uid | The 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
| Name | Description |
|---|
verifier | The address of the verifier to add |
removeWLVerifier
function removeWLVerifierfunction removeWLVerifier(address verifier) external
Removes a whitelisted verifier from the contract
Parameters
| Name | Description |
|---|
verifier | The address of the verifier to remove |
getNonce
function getNoncefunction getNonce(address user) external view returns (uint256)
Returns the nonce for a given user.
Parameters
| Name | Description |
|---|
user | The 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.