> For the complete documentation index, see [llms.txt](https://docs.kardiachain.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kardiachain.io/docs/archived-docs/tutorials/krc721-tokens/deploy-krc721-tokens.md).

# Deploy KRC721 tokens

*Prerequisite*

* Connect your MetaMask wallet to KardiaChain mainnet or testnet. Detail instruction can be found [here](/docs/archived-docs/wallet/metamask-compatible.md).
* Have some KAI in your wallet to use as transaction fee

Deploying a new KRC721 token can be done by using [Remix](https://remix.ethereum.org/) and ERC721 contract from Open Zeppelin open source.

1. Open <https://remix.ethereum.org/>
2. Create new contract `KRC721.sol` and copy code from the following sample

```solidity
// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract GameItem is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;

    constructor() ERC721("GameItem", "ITM") {}

    function awardItem(address player, string memory tokenURI)
        public
        returns (uint256)
    {
        uint256 newItemId = _tokenIds.current();
        _mint(player, newItemId);
        _setTokenURI(newItemId, tokenURI);

        _tokenIds.increment();
        return newItemId;
    }
}
```

3\. Deploy contract

![Deploy KRC721 contract](/files/wTfpvPtF59HsyuQ3v8cG)

![Deploy successfully](/files/RNNo2WwmHaufhBUuQqlu)

After deployed, new items can be created:

```bash
> gameItem.awardItem(playerAddress, "https://game.example/item-id-8u5h2m.json")
Transaction successful. Transaction hash: 0x...
Events emitted:
 - Transfer(0x0000000000000000000000000000000000000000, playerAddress, 7)
```

And the owner and metadata of each item queried:

```bash
> gameItem.ownerOf(7)
playerAddress
> gameItem.tokenURI(7)
"https://game.example/item-id-8u5h2m.json"
```

This `tokenURI` should resolve to a JSON document that might look something like:

```json
{
    "name": "Thor's hammer",
    "description": "Mjölnir, the legendary hammer of the Norse god of thunder.",
    "image": "https://game.example/item-id-8u5h2m.png",
    "strength": 20
}
```
