> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/contract-documentation/symmio-options-v0.2.1/helper-contracts/trade-nft.md).

# Trade NFT

An ERC-721 contract that represents trade ownership as a transferable NFT. Token IDs map 1:1 to trade IDs in the Symmio protocol. Transferring the NFT automatically updates trade ownership in the protocol, and vice versa.

### How It Works

**Token ID = Trade ID.** When an NFT is minted for trade 42, the token ID is 42. No auto-increment.

**NFTs are opt-in.** Not every trade gets an NFT. PartyA must explicitly mint one via the core protocol.

**Two transfer paths exist, kept in sync:**

1. **User moves the NFT** → `_beforeTokenTransfer` hook calls `symmio.transferTradeFromNFT()` to update the protocol.
2. **Protocol moves the NFT** → `transferTradeNFT()` sets a flag (`transferInitiatedInSymmio`) so the hook doesn't call back into the protocol, avoiding an infinite loop.

***

### Constructor

```solidity
constructor(address symmio_) ERC721("Trade Ownership NFT", "TRNFT")
```

Reverts with `InvalidSymmioAddress` if `symmio_` is `address(0)`.

***

### Functions

#### mintNFTForTrade()

```solidity
function mintNFTForTrade(address partyA, uint256 tradeId) external onlySymmio;
```

Mints token `tradeId` to `partyA`. Only the Symmio contract can call this.

The `_beforeTokenTransfer` hook fires but skips the sync logic because `from == address(0)` (mint).

**Event:** `TradeNFTMinted(partyA, tradeId)`

#### transferTradeNFT()

```solidity
function transferTradeNFT(address from, address to, uint256 tradeId) external onlySymmio;
```

Transfer trade ownership associated with NFT.

***

### Events

| Event                                                                                    | When                             |
| ---------------------------------------------------------------------------------------- | -------------------------------- |
| `TradeNFTMinted(address indexed owner, uint256 indexed tokenId)`                         | NFT minted                       |
| `TradeNFTTransferred(uint256 indexed tokenId, address indexed from, address indexed to)` | User-initiated NFT transfer only |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.symm.io/contract-documentation/symmio-options-v0.2.1/helper-contracts/trade-nft.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
