> ## Documentation Index
> Fetch the complete documentation index at: https://docs.patchwork.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IPatchwork1155Patch

> IPatchwork721 extension for contracts supporting Patchwork patch standard

<Info>
  <div class="border-b border-zinc-500/20 dark:border-zinc-500/30 pb-4 flex" style={{gap: '4px', fontFamily: 'var(--font-jetbrains-mono)'}}>
    <span class="token keyword">import</span> <span class="token string">"@patchwork/contracts/Patchwork1155Patch/IPatchwork1155Patch.sol"</span><span class="token punctuation">;</span>
  </div>

  **Inherits:**
  [`IPatchworkScoped`](/contracts/core/IPatchworkScoped)
</Info>

<div
  className="border-primary dark:border-primary-light"
  style={{
borderTopWidth: '1.5px',
marginBottom: '-1rem',
marginTop: '4rem'
}}
/>

## Functions

***

### mintPatch

Creates a new token for the owner, representing a patch

```solidity theme={null}
function mintPatch(address to, PatchTarget memory target) external payable returns (uint256 tokenId);
```

**Parameters**

| Name     | Type          | Description                             |
| -------- | ------------- | --------------------------------------- |
| `to`     | `address`     | Address of the owner of the patch token |
| `target` | `PatchTarget` | Path to an 1155 to patch                |

**Returns**

| Name      | Type      | Description                  |
| --------- | --------- | ---------------------------- |
| `tokenId` | `uint256` | ID of the newly minted token |

<div
  className="border-primary dark:border-primary-light"
  style={{
borderTopWidth: '1.5px',
marginBottom: '-1rem',
marginTop: '4rem'
}}
/>

## Structs

***

### PatchTarget

A canonical path to a Patched ERC-1155.

```solidity theme={null}
struct PatchTarget {
    address addr;
    uint256 tokenId;
    address account;
}
```

<div
  className="border-primary dark:border-primary-light"
  style={{
borderTopWidth: '1.5px',
marginBottom: '-1rem',
marginTop: '4rem'
}}
/>

***

# IPatchworkReversible1155Patch

This is an IPatchwork1155Patch extension to enable reverse lookup.

<Info>
  <div class="border-b border-zinc-500/20 dark:border-zinc-500/30 pb-4 flex" style={{gap: '4px', fontFamily: 'var(--font-jetbrains-mono)'}}>
    <span class="token keyword">import</span> <span class="token string">"@patchwork/contracts/IPatchworkReversible1155Patch/IPatchworkReversible1155Patch.sol"</span><span class="token punctuation">;</span>
  </div>

  **Inherits:**
  [`IPatchwork1155Patch`](/contracts/patch/IPatchwork1155Patch)
</Info>

## Functions

***

### getTokenIdByTarget

Returns the token ID (if it exists) for an 1155 that may have been patched

<Info>Requires reverse storage enabled.</Info>

```solidity theme={null}
function getTokenIdByTarget(PatchTarget memory target) external returns (uint256 tokenId);
```

**Parameters**

| Name     | Type          | Description                      |
| -------- | ------------- | -------------------------------- |
| `target` | `PatchTarget` | The 1155 target that was patched |

**Returns**

| Name      | Type      | Description           |
| --------- | --------- | --------------------- |
| `tokenId` | `uint256` | token ID of the patch |
