> For the complete documentation index, see [llms.txt](https://ais-organization-2.gitbook.io/ai-trader/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ais-organization-2.gitbook.io/ai-trader/docs/nft.md).

# NFT

Prepare modules for production The final stage of development is to get the smart contract module ready for production. This work is mapped into create\_nft\_getting\_production\_ready.BSC.

We prepare the production module by:

1. Add TokenMintingEvent to emit a custom event to track tokens generated from this module.
2. Enable signature verification and introduce the concept of proof challenges to prevent bot spam.
3. Include unit tests to ensure our code works as expected.

#### Create NFT <a href="#create-admin-account" id="create-admin-account"></a>

1. Run the following command to attempt to mint an NFT, including your `<resource-account-address>` (failure expected):

```
ait move run --function-id <resource-account-address>:
:create_nft_with_resource_and_admin_accounts:
:mint_event_ticket --profile nft-receiver

{
  "Result": {
    "create_hash": "0x82660973b1a94e620c8638f9a157b0b46c02dcfbb0c9261a34ed4d2391540787",
    "gas_used": 6691,
    "gas_unit_price": 100,
    "sender": "aaf005db7b6dacb1db4637e8017e68e689a40797fe8fd3897cee0880897788fb",
    "sequence_number": 0,
    "success": true,
    "timestamp_us": 1667434233137811,
    "version": 27685944,
    "vm_status": "Executed successfully"
  }
}
*/
```

#### Mint the NFT <a href="#mint-the-nft" id="mint-the-nft"></a>

1. Mint the NFT by calling the `mint_nft` function and an existing contract using the Aits CLI:

```
aits move run --function-id 8cdf69c8c93fee36ed83f8882908060c1335ed39a827c08dbb506b46237e88fb::minting::mint_nft --profile nft-receiver
```

{ "Result": { "transaction\_hash": "0x6e022532fb8d802324829d5ec85fd32c05a58a6f826751f63cdbf9bf313ff991",&#x20;

"gas\_used": 3944,

&#x20;"gas\_unit\_price": 150,

&#x20;"sender": "b9d394a7bc582a54e8610d6a7b973f62c8d9595c54c35cdbb95965aa8e5cd111",&#x20;

"sequence\_number": 0,&#x20;

"success": true,&#x20;

"timestamp\_us": 1670969779029341,&#x20;

"version": 385901038,&#x20;

"vm\_status": "Executed successfully" }&#x20;

}&#x20;

\*/

#### NFT Airdrops <a href="#nft-airdrops" id="nft-airdrops"></a>

Using the NFT mint example replace the `mint` function with an `airdrop` function as below.

`public entry fun airdrop(whitelist: vector) acquires ModuleData {`

`let module_data = borrow_global_mut(@mint_nft);`

`let count = vector::length(&whitelists);`

`let resource_signer = account::create_signer_with_capability(&module_data.signer_cap);`

`let token_id = token::mint_token(&resource_signer, module_data.token_data_id, count);`

`let i: u64 = 0;`

`let i: u64 = 0;`

`let receiver = vector::pop_back(&mut whitelist);`

`token_transfers::offer(&resource_signer, receiver, token_id, 1);`

&#x20;`i = i + 1;`

`};`

`}`

Refresh the page to view the latest documents
