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

# IPolicyRegistry.createPolicy

> Generated B20 reference for createPolicy(address,PolicyType).

[Related concept](/base-chain/specs/upgrades/beryl/b20/specification/concepts/policies-and-scopes)

## Signature

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

| Field               | Value                              |
| ------------------- | ---------------------------------- |
| Selector            | `0xe494a1f6`                       |
| Canonical signature | `createPolicy(address,PolicyType)` |

## Description

Creates a new simple policy with no initial members. Permissionless.
Dev: Reverts with `ZeroAddress` when `admin` is `address(0)`.
Dev: Reverts with `IncompatiblePolicyType` when `policyType` is a composite gate.
Param: admin      Initial admin authorized to modify membership and transfer or renounce administration.
Param: policyType BLOCKLIST or ALLOWLIST.
Return: newPolicyId 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.

## Example

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

## Related

* [IPolicyRegistry reference](/base-chain/specs/upgrades/beryl/b20/specification/reference/interfaces/IPolicyRegistry)
* [Constants & addresses](/base-chain/specs/upgrades/beryl/b20/specification/reference/constants-and-addresses)
