IEas.getParams
getParams() external view returns (EasParams memory params) Returns the canonical Ethereum Attestation Service addresses for this chain: the schemaRegistry, eas, and indexer preinstall addresses. Call this at startup so your dApp resolves the addresses at runtime instead of hard-coding per-network values. The precompile inherits the shared IPrecompile error surface — argument-shape failures revert with typed errors, while a not-yet-initialized keeper still surfaces as a plain string revert "eas keeper is not initialized".
Parameters
This method has no parameters.
Returns
tuple An EasParams struct with three fields: schemaRegistry, eas, and indexer — the addresses of the canonical EAS deployment on this chain.
Errors
| Code | Name | Description |
|---|---|---|
InvalidNumberOfArgs | InvalidNumberOfArgs | Reverts when the ABI-decoded argument count is non-zero. Encoded as InvalidNumberOfArgs(uint256 expected, uint256 got). |
UnknownMethod | UnknownMethod | Reverts when calldata does not match a known method selector on this precompile. Encoded as UnknownMethod(string methodName). |
QueryFailed | QueryFailed | Reverts when the underlying x/eas params lookup fails. Encoded as QueryFailed(string queryMethod, string reason), normalized through the shared SDK error registry when applicable. |
eas keeper is not initialized | eas keeper is not initialized | Plain-string revert (not a typed custom error) surfaced when the precompile's easKeeper reference has not yet been wired. Decode this from revert data as a UTF-8 string rather than with decodeErrorResult. |
Examples
Resolve EAS addresses at startup
Cache the three returned addresses for the process lifetime — they are stable per chain.
import { createPublicClient, http } from "viem";
const EAS_PRECOMPILE = "0x1000000000000000000000000000000000000009" as const;
const easPrecompileAbi = [{
type: "function", name: "getParams", stateMutability: "view",
inputs: [],
outputs: [{
type: "tuple", components: [
{ name: "schemaRegistry", type: "address" },
{ name: "eas", type: "address" },
{ name: "indexer", type: "address" },
],
}],
}] as const;
const publicClient = createPublicClient({ transport: http("https://rpc-testnet.maroo.io") });
const { schemaRegistry, eas, indexer } = await publicClient.readContract({
address: EAS_PRECOMPILE,
abi: easPrecompileAbi,
functionName: "getParams",
}); Decoding shared IPrecompile errors and the plain-string revert
Typed IPrecompile errors decode with decodeErrorResult; the keeper-not-initialized case still arrives as a UTF-8 string, so fall back to string decoding when typed decoding fails.
import { decodeErrorResult, hexToString } from "viem";
const iPrecompileErrorsAbi = [
{ type: "error", name: "InvalidNumberOfArgs",
inputs: [{ name: "expected", type: "uint256" }, { name: "got", type: "uint256" }] },
{ type: "error", name: "UnknownMethod", inputs: [{ name: "methodName", type: "string" }] },
{ type: "error", name: "QueryFailed",
inputs: [{ name: "queryMethod", type: "string" }, { name: "reason", type: "string" }] },
] as const;
try {
await publicClient.readContract({
address: EAS_PRECOMPILE,
abi: easPrecompileAbi,
functionName: "getParams",
});
} catch (err: any) {
if (err?.data) {
try {
const decoded = decodeErrorResult({ abi: iPrecompileErrorsAbi, data: err.data });
console.error("getParams reverted:", decoded.errorName, decoded.args);
} catch {
// Plain-string revert (e.g. "eas keeper is not initialized").
console.error("getParams reverted with string:", hexToString(err.data));
}
} else {
throw err;
}
}