testnet
GitHub

EAS Precompile

component identity

EVM-callable bridge to Ethereum Attestation Service for on-chain KYC / KYB attestation queries.

The EAS precompile is one of Maroo's four core static precompiles (alongside OKRW, PCL, and Agent). It bridges Solidity callers to the Ethereum Attestation Service (EAS) ecosystem, exposing read views over attestations issued under specific schemas. Used by PCL's EAS_POLICY template to enforce compliance gates that depend on KYC / KYB credentials, and used by dapps directly to gate features behind credential ownership.

Why a precompile (not just call EAS contracts directly)?

EAS itself is a set of standard ERC contracts that can be called directly from Solidity. The precompile + x/eas Cosmos module are a performance layer: they maintain an indexed cache of received attestations per (recipient, schema) so PCL can look up "does sender have schema X attestation?" cheaply during AnteHandler execution. Without the precompile, the same lookup would require iterating EAS contract storage, which would dominate gas costs.

Writes (issuing, revoking attestations) still go through the standard EAS contracts — the canonical state lives there, and the Maroo precompile is purely a query helper.

Read methods (abstract)

Conceptually exposed methods (exact ABI in source):

  • getAttestation(uid) — fetch a single attestation by its UID. Returns {recipient, schema, time, expirationTime, revocationTime, data}.
  • getReceivedUIDs(recipient, schema, offset, limit) — paginate UIDs of attestations a recipient has received under the given schema.
  • getReceivedUIDCount(recipient, schema) — count attestations of that recipient/schema combination.


Validity checks (isValid) are typically composed by the caller — verify revocationTime == 0 and expirationTime == 0 || expirationTime > block.timestamp.

Use case 1 — PCL EAS_POLICY enforcement

When EAS_POLICY is part of a GlobalPolicyConfig or ContractPolicyConfig, the PCL ante decorator calls this precompile during transaction validation:

1. Read the policy's required schema UID from UnitPolicy.parameters.
2. Call getReceivedUIDCount(sender, schemaUid). Zero → reject with ReasonCode: EasAttestationRequired.
3. Call getAttestation(uid) to verify expiration / revocation.

This is how Maroo enforces "only KYC-verified accounts can use the regulated path" without requiring dapps to implement the check themselves.

Use case 2 — Dapp credential gating

Solidity contracts can call the precompile directly to gate features:

``solidity
interface IEAS {
function getReceivedUIDCount(address recipient, bytes32 schema) external view returns (uint256);
}

contract Vault {
IEAS constant EAS = IEAS(0x100000000000000000000000000000000000000A); // example address
bytes32 constant KYC_SCHEMA = 0x...;

modifier onlyVerified() {
require(EAS.getReceivedUIDCount(msg.sender, KYC_SCHEMA) > 0, "KYC required");
_;
}
}
``

This avoids reimplementing attestation lookup — the precompile does it cheaply.
Source: maroo
ESC
Type to search