RubyScoreVeraxPortal

RubyScoreVeraxPortal is a smart contract that handles the attestation process for RubyScore certificates. It manages fees, signatures based on specific schemas.

bulkStatus

bool bulkStatus

feeStatus

bool feeStatus

certificates

mapping(bytes32 => bool) certificates

attestationFees

mapping(bytes32 => uint256) attestationFees

InvalidCertificateId

error InvalidCertificateId()

ArrayLengthMismatch

error ArrayLengthMismatch()

InvalidAttestationFee

error InvalidAttestationFee()

ZeroAddressCheck

error ZeroAddressCheck()

WithdrawFail

error WithdrawFail()

FeesSet

event FeesSet(bytes32[] schemaIds, uint256[] attestationFees)

constructor

constructor(address[] modules, address router) public

Contract constructor.

Parameters

NameTypeDescription

modules

address[]

List of modules to use for the portal.

router

address

The Router's address.

pause

function pause() public

unpause

function unpause() public

checkFee

function checkFee(bytes32 schemaId, uint256 _value) public view

Check if the provided value meets the attestation fee requirement.

Parameters

NameTypeDescription

schemaId

bytes32

The schemaId for which to check the fee.

_value

uint256

The value sent for the attestation.

setCheckStatuses

function setCheckStatuses(bool fee, bool bulk) external

Set the fee, signature, and issuance statuses.

Parameters

NameTypeDescription

fee

bool

Fee status.

bulk

bool

addModule

function addModule(address module) external

Add a new module to the list of modules.

Parameters

NameTypeDescription

module

address

The address of the new module.

removeModules

function removeModules() external

Remove all modules from the list of modules.

setFees

function setFees(bytes32[] schemaIds, uint256[] _attestationFees) public

Set the fees for specific schemaIds.

Parameters

NameTypeDescription

schemaIds

bytes32[]

The schemaIds to set the fee for.

_attestationFees

uint256[]

The fees required to attest.

setUpCertificates

function setUpCertificates(bytes32[] schemaIds, bool[] certificateStatuses) public

Set up certificate mappings for schemaIds.

Parameters

NameTypeDescription

schemaIds

bytes32[]

The schemaIds for which to set up certificates.

certificateStatuses

bool[]

The corresponding certificate statuses.

attestRubyscore

function attestRubyscore(struct AttestationPayload attestationPayload, bytes[] validationPayload) external payable

Attest a score with a given attestation payload and validation payloads.

Parameters

NameTypeDescription

attestationPayload

struct AttestationPayload

The payload of the attestation.

validationPayload

bytes[]

The validation payload required for the module.

withdraw

function withdraw(address payable to, uint256 amount) external

Withdraw ETH from the contract.

Parameters

NameTypeDescription

to

address payable

The address to which the ETH will be withdrawn.

amount

uint256

The amount of ETH to withdraw.

_onAttest

function _onAttest(struct AttestationPayload attestationPayload, address attester, uint256 value) internal

Optional method run before a payload is attested

Parameters

NameTypeDescription

attestationPayload

struct AttestationPayload

the attestation payload supposed to be attested

attester

address

the address of the attester

value

uint256

the value sent with the attestation

_onBulkAttest

function _onBulkAttest(struct AttestationPayload[] attestationsPayloads, bytes[][] validationPayloads) internal

Optional method run when attesting a batch of payloads

_onReplace

function _onReplace(bytes32 attestationId, struct AttestationPayload attestationPayload, address attester, uint256 value) internal

Optional method run when an attestation is replaced

Parameters

NameTypeDescription

attestationId

bytes32

the ID of the attestation being replaced

attestationPayload

struct AttestationPayload

the attestation payload to create attestation and register it

attester

address

the address of the attester

value

uint256

the value sent with the attestation

_onBulkReplace

function _onBulkReplace(bytes32[] attestationIds, struct AttestationPayload[] attestationsPayloads, bytes[][] validationPayloads) internal

Last updated