IPcl.getParams

getParams() external view returns (PclParams memory)

Returns the current PCL module parameters as a PclParams struct: the address of the chain-wide policy admin, and the list of ERC-4337 EntryPoint contracts that PCL trusts for AA principal decoding. Use this from a Solidity contract or off-chain client to discover the authoritative policy admin without hard-coding it, and to enumerate the EntryPoint addresses that PCL recognizes for account-abstraction transactions.

Parameters

This method has no parameters.

Returns

Type: PclParams

A PclParams struct with two fields: policyAdmin (address) — the chain-wide policy admin authorized to register/remove policy templates and manage the global policy config; and entrypoints (address[]) — the list of ERC-4337 EntryPoint contract addresses trusted for AA principal decoding. Only calls targeting these EntryPoint addresses are eligible for AA principal decoding.

Examples

Read PCL params with viem

Reads the PCL module parameters directly from the precompile. Both fields are useful for dApps: policyAdmin for surfacing who can change chain-wide policies, entrypoints for verifying that a UserOperation flow targets a recognized EntryPoint.

import { createPublicClient, http } from "viem";

const PCL_PRECOMPILE = "0x1000000000000000000000000000000000000005";
const pclParamsAbi = [{
  name: "getParams", type: "function", stateMutability: "view",
  inputs: [],
  outputs: [{
    type: "tuple", components: [
      { name: "policyAdmin", type: "address" },
      { name: "entrypoints", type: "address[]" },
    ],
  }],
}] as const;

const client = createPublicClient({ transport: http("https://rpc-testnet.maroo.io") });
const params = await client.readContract({
  address: PCL_PRECOMPILE,
  abi: pclParamsAbi,
  functionName: "getParams",
});

console.log("policyAdmin:", params.policyAdmin);
console.log("entrypoints:", params.entrypoints);

Read PCL params from Solidity

A read-only Solidity helper that resolves the current policy admin and checks membership in the trusted EntryPoint list. Because these values can change via governance, resolve them at call time rather than caching in storage.

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.22;

import { IPcl, PclParams, PCL_CONTRACT } from "@maroo-chain/contracts/precompiles/pcl/IPcl.sol";

contract PolicyAdminReader {
    function currentPolicyAdmin() external view returns (address) {
        PclParams memory p = PCL_CONTRACT.getParams();
        return p.policyAdmin;
    }

    function isTrustedEntryPoint(address candidate) external view returns (bool) {
        PclParams memory p = PCL_CONTRACT.getParams();
        for (uint256 i = 0; i < p.entrypoints.length; i++) {
            if (p.entrypoints[i] == candidate) return true;
        }
        return false;
    }
}
ESC
Type to search