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

# IPolicyRegistry.createPolicy

> Creates a new simple (ALLOWLIST or BLOCKLIST) policy with no initial members.

## Signature

```solidity IPolicyRegistry.sol theme={null}
function createPolicy(address admin, PolicyType policyType) external returns (uint64 newPolicyId);
```

| Field               | Value                         |
| ------------------- | ----------------------------- |
| Selector            | `0xca5d55f6`                  |
| Canonical signature | `createPolicy(address,uint8)` |

## Description

Creates a new simple policy with no initial members. Any caller may invoke this function. The newly created policy has an empty member set and the specified `admin`.

To seed an initial member set in the same call, use `createPolicyWithAccounts` instead.

## Parameters

| Name         | Type         | Description                                                                                                      |
| ------------ | ------------ | ---------------------------------------------------------------------------------------------------------------- |
| `admin`      | `address`    | Initial admin authorized to modify membership and transfer or renounce administration. Must not be `address(0)`. |
| `policyType` | `PolicyType` | `ALLOWLIST` or `BLOCKLIST`. Composite gate types (`UNION`, `INTERSECT`) are not accepted here.                   |

## Returns

| Name          | Type     | Description                                                                                                |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| `newPolicyId` | `uint64` | The newly assigned policy ID. The top byte encodes the `PolicyType`; the low 56 bits are a global counter. |

## Access Control

Permissionless creation. This is a state-changing call, so it reverts with `FeatureNotActivated` while the PolicyRegistry feature is inactive.

## Revert Conditions

| Error                    | Condition                                                  |
| ------------------------ | ---------------------------------------------------------- |
| `ZeroAddress`            | `admin` is `address(0)`.                                   |
| `IncompatiblePolicyType` | `policyType` is a composite gate (`UNION` or `INTERSECT`). |
| `FeatureNotActivated`    | The PolicyRegistry feature has not been activated.         |

## Example

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