# NFT code-gen and deployment on Starknet.

By [Dev_Leo](https://paragraph.com/@iwantairdrop) · 2022-11-17

---

Previously, we’ve learned deploying ERC-20 contracts to Starknet Testnet. In this tutor, we'll introduce Cairo contract code generation by Openzeppelin Wizard.

### Use Wizard to generate code

The [Cairo Wizard](https://wizard.openzeppelin.com/cairo) is a tools that contracts can be generated with custom features easily.We are deploying an nonfungible token with symbol “Some” which is short for “SomeToken”.And we make this contract mintable, burnable and pausable.

![Cairo Code Wizard](https://storage.googleapis.com/papyrus_images/6077201caaf8fed3ce260c6888765395c3a12fba69c00a895400827b46171d57.png)

Cairo Code Wizard

Copy or download codes to local and save as nft721.cairo, then prepare for the next step.

### Set up the environment

We create a python virtual environment.And then install packages and dependencies inside the environment.

    python -m venv ~/cairo_venv
    source ~/cairo_venv/bin/activate
    

### Install gmp

On Ubuntu

    sudo apt install -y libgmp3-dev
    

On mac, you can use brew:

Install the cairo-lang python packages using:

    pip install cairo-lang
    pip install cairo-nile openzeppelin-cairo-contracts
    

Finally, run nil init to initial cairo environment which includes a local network, a testing framework, and some sample codes.

    mkdir my-proj
    cd my-proj
    nile init
    

### Compile the code

Compile the code with nile compile and then we can deploy to the testnet

    nile deploy nft721 <your_startknet_address> --network  goerli --alias some_token
    

    
    🚀 Deploying nft721
    ⏳ ️Deployment of 721 successfully sent at 0x064a7c6c87b170c549d10a98fe255xxx
    🧾 Transaction hash: 0x1c6871776832006fdab19f58f4xxx
    📦 Registering deployment as some_token in goerli.deployments.txt
    

As above, we deployed contract to testnet successfully.

### Interact with the contract

At beginning, contracts are generated with some features like mintable, burnable and so on. We'll check it on [Voyager Explorer](https://voyager.online/). Firstly we mint a nft token to our own wallet.

![Voyager Explorer](https://storage.googleapis.com/papyrus_images/388fa8391ff3f5e3a28108d35ab751fe58cf2541406d32d153089fcaa1ef8357.png)

Voyager Explorer

After transaction has confirmed on chain, we can check that the owner of token id that match our wallet address.

![Voyager Explorer](https://storage.googleapis.com/papyrus_images/31ec8d179b078d9a40d2c84b9fd47a363135a2ae5bfef27ec8a28ee4889ab28e.png)

Voyager Explorer

### Conclusion

With the help of Wizard, we can set up a simple erc721 with features easily.And we have learned how to deploy contracts to [testnet.In](http://testnet.In) the following tutorials, we’ll dive in learning Openzeppelin ’s Library.

---

*Originally published on [Dev_Leo](https://paragraph.com/@iwantairdrop/nft-code-gen-and-deployment-on-starknet)*
