Reading Attestations On-chain
/**
* One way is to define 2 attestation types,
* one for EAS and one Verax attestations
*/
enum AttestationType {
EAS,
VERAX
}bytes32 _easSchema = 0x000..;
bytes32 _veraxSchema = 0x00..;/**
* @dev Function to get the EAS attestation value.
* @return The EAS attestation vamue.
*/
function _easAttestation() internal view returns (bytes memory) {
bytes32 attestationId = _connector.getReceivedAttestationUIDs(
tx.origin,
_easSchema,
0,
1,
false
)[0];
return
_connector.getAttestationValueById(
_connector.EAS(),
attestationId
);
}
/**
* @dev Function to get the Verax attestation value.
* @return The Verax attestation value.
*/
function _veraxAttestation() internal view returns (bytes memory) {
bytes32 attestationId = _connector.getReceivedAttestationUIDs(
tx.origin,
_veraxSchema,
0,
1,
false
)[0];
return
_connector.getAttestationValueById(
_connector.VERAX(),
attestationId
);
}Last updated