> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-sync-code-change-6bb10a4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IPolicyRegistry.createPolicyWithAccounts

> Generated B20 reference for createPolicyWithAccounts(address,uint8,address[]).

## Signature

```solidity theme={null}
function createPolicyWithAccounts(address admin, PolicyType policyType, address[] calldata accounts) external returns (uint64 newPolicyId);
```

| Field               | Value                                               |
| ------------------- | --------------------------------------------------- |
| Selector            | `0xa2d3044f`                                        |
| Canonical signature | `createPolicyWithAccounts(address,uint8,address[])` |

## Description

Creates a new simple policy seeded with `accounts` as initial members. Permissionless.

**Revert conditions:**

* `ZeroAddress` — `admin` is `address(0)`. Takes precedence over `BatchSizeTooLarge`.
* `IncompatiblePolicyType` — `policyType` is `UNION` or `INTERSECT`. Use `createCompositePolicy` for composite policies.
* `BatchSizeTooLarge` — `accounts.length` exceeds the registry limit.
* `Panic(0x11)` — arithmetic overflow when the policy counter has reached its maximum value.

## Parameters

| Parameter    | Type         | Description                                                                            |
| ------------ | ------------ | -------------------------------------------------------------------------------------- |
| `admin`      | `address`    | Initial admin authorized to modify membership and transfer or renounce administration. |
| `policyType` | `PolicyType` | `BLOCKLIST` or `ALLOWLIST` only. `UNION` and `INTERSECT` are rejected.                 |
| `accounts`   | `address[]`  | Initial member set.                                                                    |

## Returns

| Name          | Type     | Description                   |
| ------------- | -------- | ----------------------------- |
| `newPolicyId` | `uint64` | The newly assigned policy ID. |

## Access control

Permissionless creation, but state-changing registry calls require the feature to be active.

## Policy interaction

This is part of the singleton PolicyRegistry surface used by B20 policy scopes.

<Warning>
  Passing `policyType` byte `2` (`UNION`) or `3` (`INTERSECT`) now reverts with `IncompatiblePolicyType`. Use `createCompositePolicy` to create composite policies.
</Warning>

## Example

```solidity theme={null}
uint64 policyId = StdPrecompiles.POLICY_REGISTRY.createPolicyWithAccounts(admin, IPolicyRegistry.PolicyType.ALLOWLIST, accounts);
```
