> ## 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.

# IPatchworkPatch

> 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/PatchworkPatch/IPatchworkPatch.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 owner, PatchTarget memory target) external payable returns (uint256 tokenId);
```

**Parameters**

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

**Returns**

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

### updateOwnership

Updates the real underlying ownership of a token in storage (if different from current)

```solidity theme={null}
function updateOwnership(uint256 tokenId) external;
```

**Parameters**

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

### ownerOfPatch

Returns the underlying stored owner of a token ignoring real patched NFT ownership

```solidity theme={null}
function ownerOfPatch(uint256 tokenId) external view returns (address);
```

**Parameters**

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

**Returns**

| Name     | Type      | Description                  |
| -------- | --------- | ---------------------------- |
| `<none>` | `address` | address Address of the owner |

<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-721

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