DENY_LIST_POLICY

component compliance

Global or contract scope policy that rejects a call when any selected endpoint (From, To, or Both) is a member of a shared address list.

DENY_LIST_POLICY is a PCL policy template that references a shared address list by listId and rejects a call when any selected endpoint (From, To, or both) is a member of that list. It replaces the retired v0.10 inline DENYLIST_POLICY, which carried its own address[] — that template id is now reserved and the testnet rejects it with UnknownPolicyType. Unlike the old template, DENY_LIST_POLICY can be shared across many policies: the same sanctions list can back a global chain-wide rule and several contract-scoped rules at once, and the list admin updates membership without rewriting any PolicySet. It is usable at both global and contract scope.

Parameter struct

From IPcl.sol:
enum AddressListTarget { Unspecified, From, To, Both }

struct DenyListPolicy {
    uint64 listId;              // id of a shared address list (see IPcl.createAddressList)
    AddressListTarget target;   // which endpoint(s) of the call to inspect
}

// Template id: "DENY_LIST_POLICY"
// ABI tuple: (uint64, uint8)
listId must reference an existing list — binding the policy to a missing id reverts with AddressListNotFound(listId). A Disabled list can be bound, but while it is Disabled every evaluation of the policy reverts with AddressListDisabled(listId). target must be one of From, To, or Both. The policy's own shape is checked first, before any list is looked up: a listId of 0, or a target that is Unspecified or out of range, reverts the binding call with InvalidParameter(bytes) — not InvalidAddressListConfig. The v0.10 DenylistPolicy was removed in v0.11 — its inline address[] addresses shape does not compile against the current IPcl.sol and is rejected on-chain; migrate by creating an address list with those members and binding a DENY_LIST_POLICY that references it.

Scope and evaluation

DENY_LIST_POLICY is accepted at both scopes:

  • Global — bound through IPcl.setGlobalPolicies. The policy evaluates against every transaction on the chain. For the transaction's own call PCL inspects msg.sender as the From endpoint and the direct recipient as the To.
  • Contract — bound through IPcl.changeContractPolicies(ContractPolicyConfig). The policy fires only when the call goes through a PCL-wrapped proxy that has this policy bound to it; the proxy passes its immediate caller (msg.sender) as the principal. Called by an EOA, or by an AA smart account executing a UserOperation, that is the end user; behind Multicall3 or a router it is the router contract, so a contract-scoped list then checks the router, not the user.


In both scopes the rule is the same: if ANY inspected endpoint is a member of the list the policy rejects with InAddressList(listId, account) naming the offending account. Both short-circuits on the first match.
import { encodeAbiParameters, toHex } from "viem";

// Chain-wide sanctions check: reject if either sender or recipient is listed.
const denyBytes = encodeAbiParameters(
  [
    { type: "uint64", name: "listId" },
    { type: "uint8",  name: "target" },  // 3 = Both
  ],
  [sanctionsListId, 3],
);

const globalPolicy = {
  templateId: "DENY_LIST_POLICY",
  policy:     denyBytes,
  selector:   toHex("", { size: 0 }),  // apply to every call globally
};

Sharing a list and changing it without touching policies

The single biggest practical difference from the v0.10 inline template: one shared list can back a chain-wide global DENY_LIST_POLICY and any number of contract-scoped ones at the same time. When the list admin calls IPcl.updateAddressList(listId, add, remove) the change takes effect on the next evaluation across every referencing policy — no governance proposal to re-encode the list into each PolicySet, no stale copy. Disabling the list with IPcl.setAddressListStatus(listId, AddressListStatus.Disabled) is not a way to stop enforcing it: every referencing policy then reverts with AddressListDisabled(listId) until the list is re-activated, so a global DENY_LIST_POLICY over a disabled list rejects every transaction on the chain. This holds wherever the list sits in the policy tree: before evaluating, the chain re-checks every list the policy references, so a Disabled list inside an OR rejects the call even when an earlier child would pass. To stop enforcing a list, unbind or replace the policies that reference it. Admin rotation uses IPcl.changeAddressListAdmin and is atomic — the previous admin loses mutation rights the instant the call succeeds.
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { iPclAbi, iPclAddress } from "@maroo-chain/contracts/abi/precompiles/pcl/IPcl";

const listAdmin = privateKeyToAccount(process.env.LIST_ADMIN_KEY as `0x${string}`);
const wallet = createWalletClient({
  account: listAdmin,
  transport: http(process.env.MAROO_RPC_URL),
});

// Add two newly-sanctioned addresses and remove one that was cleared.
// TODO: replace with the real addresses before production.
const add = [
  "0x2c7f09b81a6d3ff1e5a0d4c6bc2a8f7e19dc3a4b",
  "0x3a9c71e4b8d2f6a05c7e19b4d3f82a6c5e0b9d47",
] as const;
const remove = ["0x5ab7c1e40b8da46f9c7e29d3fa614e97b8f0ac21"] as const;

await wallet.writeContract({
  address: iPclAddress,
  abi: iPclAbi,
  functionName: "updateAddressList",
  args: [sanctionsListId, add, remove],
});

ReasonCodes and migration note

Evaluation can revert with any of these typed errors declared on IPcl — decode them with decodeErrorResult using iPclAbi:

ReasonCodeWhen it fires
InAddressList(uint64 listId, address account)an inspected endpoint IS a member of the list
AddressListNotFound(uint64 listId)the referenced list does not exist
AddressListDisabled(uint64 listId)the referenced list's status is Disabled
InvalidAddressListConfig(uint64 listId)the referenced list's stored record fails an integrity check (a corrupt registry). A zero listId or a bad target never gets here — binding rejects it with InvalidParameter
AddressListStorageError(uint64 listId)an unexpected storage read failure (should not occur on healthy nodes)

The retired DENYLIST_POLICY is gone. On upgrade to v0.11, every stored inline denylist is migrated: a new address list is created with its members, and the policy entry is replaced with a DENY_LIST_POLICY that references the new listId. For contract-scoped policies the new list inherits the config's admin, so the same account keeps managing membership. For global policies the chain's policy admin inherits ownership of the migrated list.
ESC
Type to search