IPcl.policyTemplate

policyTemplate(string calldata templateId) external view returns (PolicyTemplate memory)

View call. Returns the registration record for one of the seven built-in PCL templates by templateId. Reverts if templateId is unknown. The parameter shape for each template is fixed in IPcl.sol (e.g. DenylistPolicy { address[] addresses; }) — policyTemplate returns the registry metadata only, not a JSON-schema; readers should consult the corresponding template's Solidity struct directly for the parameter layout.

Parameters

Name Type Required Description
templateId string Exact ID of one of the registered templates (e.g. DENYLIST_POLICY, VOLUME_POLICY).

Returns

Type: PolicyTemplate

Registry struct for the template: { templateId, isActive }. Use the templateId to look up the corresponding parameter struct in IPcl.sol.

Examples

Check whether a template is registered

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

import { IPcl, PolicyTemplate } from "@maroo-chain/contracts/IPcl.sol";

IPcl constant PCL = IPcl(0x1000000000000000000000000000000000000005);

function isVolumePolicyActive() external view returns (bool) {
    PolicyTemplate memory tpl = PCL.policyTemplate("VOLUME_POLICY");
    return tpl.isActive;
}
ESC
Type to search