Comment on page

On-chain SDK


The onchain SDK is a smart contract that enables users and projects to query for all attestations made by Clique to EAS and Verax and read the values directly onchain.

Getting Started

Import the IConnector solidity interface into your smart contract.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import {IConnector} from "CliqueOfficial/attestor-contracts";
Now set the corresponding address for the chain you are deploying to. Found here
constructor(address _connector) {
IConnector connector = IConnector(_connector);
Get attestationIds for Verax and EAS by subject. Where the parameters can be parameters to your solidity function, or hardcoded.
(bytes32[] memory easIds, bytes32[] veraxIds memory) = connector.getAttestations(
address subject,
bytes32 easSchema,
address easAttester,
address veraxPortal
Get the values of attestations from their IDs
// protocolId tells the contract to search for eas or verax attestations
bytes32 easProtocolId = connector.EAS();
bytes32 veraxProtocolId = connector.VERAX();
bytes memory value = getAttestationValue(protocolId, attestationId);