# MockVerifierProxy v0.3.1 API Reference
Source: https://docs.chain.link/chainlink-local/api-reference/v0.3.1/mock-verifier-proxy

> For the complete documentation index, see [llms.txt](/llms.txt).

> **NOTE: Integrate Chainlink Local into your project**
>
> ### npm
>
> If you use [NPM](https://www.npmjs.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> npm install @chainlink/local@0.3.1
> ```
>
> ### yarn
>
> If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> yarn add @chainlink/local@0.3.1
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@v0.3.1
> ```
>
> and then set remappings to: `@chainlink/local/=lib/chainlink-local/` in either `remappings.txt` or `foundry.toml` file
>
> ### RemixIDE
>
> Import the `CCIPLocalSimulator` contract from the `@chainlink/local` package:
>
> ```solidity
> import {CCIPLocalSimulator} from "@chainlink/local@0.3.1/src/ccip/CCIPLocalSimulator.sol";
> ```

## MockVerifierProxy

A mock implementation of the Data Streams verifier proxy for local testing.

[`MockVerifierProxy`](https://github.com/smartcontractkit/chainlink-local/blob/v0.3.1/src/data-streams/MockVerifierProxy.sol)

> **NOTE**
>
> This contract forwards reports to the [`MockVerifier`](/chainlink-local/api-reference/v0.3.1/mock-verifier) and
> optionally bills the caller through a fee manager. It validates that the billing mechanism (on-chain or off-chain)
> matches what the consumer contract is using, with error messages that point to the fix.

## Errors

### ZeroAddress

```solidity
error ZeroAddress()
```

### VerifierInvalid

```solidity
error VerifierInvalid()
```

> **NOTE**
>
> Reverts when the verifier does not support the `IVerifier.verify` interface.

### VerifierNotFound

```solidity
error VerifierNotFound()
```

### FeeManagerRequired

```solidity
error FeeManagerRequired(string message)
```

> **NOTE**
>
> On-chain billing is active but the consumer is using the off-chain mechanism: either call
> `simulator.enableOffChainBilling()` or provide the fee token address in `parameterPayload`.

### FeeManagerNotExpected

```solidity
error FeeManagerNotExpected(string message)
```

> **NOTE**
>
> Off-chain billing is active but the consumer is providing `parameterPayload` for on-chain billing: either call
> `simulator.enableOnChainBilling()` or pass empty bytes as `parameterPayload`.

## Events

### VerifierInitialized

```solidity
event VerifierInitialized(address indexed verifierAddress)
```

## Functions

### verify

Verifies a report payload, billing the caller first when a fee manager is set.

```solidity
function verify(bytes calldata payload, bytes calldata parameterPayload) external payable returns (bytes memory)
```

> **NOTE**
>
> When a fee manager is set (on-chain billing), `parameterPayload` must carry the fee token address and `msg.value` the
> fee. With off-chain billing, pass empty bytes and no value.

#### Parameters

| Parameter        | Type    | Description                                                                              |
| ---------------- | ------- | ---------------------------------------------------------------------------------------- |
| payload          | `bytes` | The signed report payload                                                                |
| parameterPayload | `bytes` | The fee payment parameters (fee token address for on-chain billing, empty for off-chain) |

### verifyBulk

Verifies multiple report payloads in one call.

```solidity
function verifyBulk(bytes[] calldata payloads, bytes calldata parameterPayload) external payable returns (bytes[] memory verifiedReports)
```

### initializeVerifier

Initializes the verifier address.

```solidity
function initializeVerifier(address verifierAddress) external onlyOwner
```

> **NOTE**
>
> The verifier must support the `IVerifier.verify` interface.

#### Parameters

| Parameter       | Type      | Description                          |
| --------------- | --------- | ------------------------------------ |
| verifierAddress | `address` | The address of the verifier contract |

### getVerifier

Returns the verifier address.

```solidity
function getVerifier(bytes32) external view returns (address)
```

### setFeeManager

Sets the fee manager.

```solidity
function setFeeManager(IVerifierFeeManager feeManager) external
```

> **NOTE**
>
> Pass `MockFeeManager(address(0))` to switch to off-chain billing.

#### Parameters

| Parameter  | Type                  | Description                     |
| ---------- | --------------------- | ------------------------------- |
| feeManager | `IVerifierFeeManager` | The fee manager contract to set |