What is the Inventory?

The Inventory is a smart contract which allows players of web3 games to equip items into their character NFTs.

The Inventory tracks equipment purely on-chain, without requiring any off-chain metadata. This makes game NFTs maximally composable - their state can be consumed not only by off-chain programs but also by smart contracts.

There are two types of users for the Inventory - administrators and players.

Administrators can:

  1. Define inventory slots for an ERC721 contract (NFT collection)
  2. Specify whether each slot is persistent or not (i.e. whether items can be unequipped from that slot)
  3. Define which tokens can be equipped in each slot

Players can:

  1. Equip items into inventory slots of NFTs that they own
  2. Unequip items from inventory slots of NFTs they own (but only if the inventory slot is not persistent)

Untitled

When an item is equipped onto an NFT, ownership of the item is transferred to the inventory contract. This prevents the double use of item tokens.

It also means that, if a player transfers an NFT to another player, the items that were equipped on that NFT are also implicitly transferred to the other player.

The Inventory contract is intended to be used by web3 games.

If a game interprets inventory slots generally as holding character attributes, then it can use the Inventory to track things like hit points, experience points, reputation, abilities, and skills in addition to items/equipment.