# OwnedCustomVerifier

### Overview

`OwnedCustomVerifier` is an **abstract base contract** for implementing `ICustomVerifier`-compatible verifiers with configurable role-based access control. It integrates with `MellowACL` and provides a flexible initialization mechanism for dynamic permission setup.

This verifier is designed to be used in **`Verifier.sol`** as a custom verifier, \*\*\*\*where specific calls must pass access control checks based on predefined roles.

### Key Components

### Inherits:

* `ICustomVerifier`: Interface used by the `Verifier` contract for permission checks
* `MellowACL`: Upgradeable, role-based access control module compatible with OpenZeppelin’s `AccessControl`

### Constructor

```solidity
constructor(string memory name_, uint256 version_) MellowACL(name_, version_)
```

* Initializes the underlying `MellowACL` module with `name_` and `version_`
* Disables further initialization to prevent misuse in logic contracts (`_disableInitializers()`)

### Initialization

```solidity
function initialize(bytes calldata data) external initializer
```

* Initializes access control roles
* Decodes input as:

  ```solidity
  (address admin, address[] memory holders, bytes32[] memory roles)
  ```
* Logic:
  * Sets `admin` as the contract’s `DEFAULT_ADMIN_ROLE`
  * Grants each `roles[i]` to `holders[i]`
* Reverts with `ZeroValue` if:
  * `admin == address(0)`
  * Any holder is zero address
  * Any role is `DEFAULT_ADMIN_ROLE`

### Usage Pattern

This base contract does **not** implement the `verifyCall()` method itself. Instead, it is expected to be **inherited and extended** by a concrete verifier contract that implements the permission logic based on role membership (e.g., checking `hasRole(role, who)`).

This allows teams to quickly implement custom verifiers that enforce arbitrary permissions (e.g., allow certain addresses to `approve`, `transfer`, or `delegate`) based on **assigned roles** instead of hardcoded logic.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://metavaults.mellow.finance/architecture/permissions/protocols/ownedcustomverifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
