# On-chain Inventory

The On-chain Inventory is a smart contract that enables players of web3 games to equip items onto their character NFTs.

As the name suggests, the On-chain Inventory exclusively tracks equipment on the blockchain, eliminating the need for off-chain metadata. This enhances the composability of game NFTs, allowing their state to be utilized not only by off-chain programs but also by smart contracts.

The Inventory has two user categories: administrators and players.

Administrators have the following abilities:

1. Defining inventory slots for an ERC721 contract (NFT collection).
2. Specifying the persistence of each slot, determining whether items can be unequipped from them.
3. Establishing the tokens that can be equipped in each slot.

Players can perform the following actions:

1. Equipping items into the inventory slots of the NFTs they own.
2. Unequipping items from their owned NFTs' inventory slots (with the exception of persistent slots).

When an item is equipped onto an NFT, ownership of the item is transferred to the inventory contract. This prevents the simultaneous use of item tokens by multiple entities. Additionally, if a player transfers an NFT to another player, the equipped items on that NFT are implicitly transferred to the new owner.

The Inventory contract is specifically designed for utilization in web3 games. If a game interprets inventory slots as holding character attributes in general, the Inventory can also be utilized to track aspects such as hit points, experience points, reputation, abilities, and skills, in addition to items and equipment.

<figure><img src="/files/q7jTN5wvuEJOEOEKBB9B" alt="" width="563"><figcaption></figcaption></figure>


---

# 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://whitepaper.gravityhub.xyz/technology/on-chain-inventory.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.
