# How to deploy a NFT collection on Starknet with Starksheet

By [Clemlaflemme](https://paragraph.com/@clemlaflemme) · 2023-05-15

---

![A Dusty Pilot entering the Only Dust space port](https://storage.googleapis.com/papyrus_images/b4657b14e6ba9d1fae551523c853bc0040ac053b56e58174fa4ab4f1e9e761e0.png)

A Dusty Pilot entering the Only Dust space port

Last Thursday, [eniwhere\_](https://twitter.com/eniwhere_/status/1656649638248587269) challenged me on twitter with a "wen mint" after I posted a [midjourney generated image](https://twitter.com/ClementWalter/status/1656647798899482625?s=20) in response to a public call-out by [Only Dust](https://twitter.com/OnlyDust_xyz/status/1656643120207937541?s=20). Using [Starksheet](https://gist.github.com/ClementWalter/starksheet.xyz), I have been able to no-code deploy the collection now called the [Dusty Pilots](https://mintsquare.io/collection/starknet/0x00d1540fbe29acb2522694e9e3d1d776f1ab70773d33149997a65d06cc8a816f) with current floor price at 0.035 ETH and volume 0.2579 ETH in less that half-a-day, spending most of my time in the image generation and curation process.

This blog post aims at breaking down the step-by-step guide to deploy your own NFT collection with Starksheet!

![The Dusty Pilots collection page on Mint Square](https://storage.googleapis.com/papyrus_images/618c80ddf3c6f945c90b2162de9b6dd12f993d4699b7cc2ffb7c4cd1191876e5.png)

The Dusty Pilots collection page on Mint Square

Sheets are NFTs collections
---------------------------

### Deploying a collection

The [Starksheet app](https://app.starksheet.xyz/) is a spreadsheet-like application deployed in Starknet. Unlike a regular spreadsheet, Starksheet aims at offering a mid-level entrypoint to everything on-chain: reading values, making single or mutlicall transactions, storing data.

More precisely, each sheet is made of 225 cells and is, from a Blockchain standard point of view, a classic NFT collection of up to 225 NFTs: minting a cell is really minting an NFT as in any other deployed collections.

Of course, a cell can do more but for this simple need, it is just enough to understand a cell as an NFT and forget about the rest. Much like in a spreadsheet where one can do massive mingled computation or just type some constant values in neighbors cells that look like a table.

![The Dusty Pilots sheet](https://storage.googleapis.com/papyrus_images/2403bf931d73ede842c57685b694e5b2e1657fa84527fdb357a69affd43a1a99.png)

The Dusty Pilots sheet

If one just want to create a NFT drop and let the users mint as fast as possible:

1.  go to [app.starksheet.xyz](https://app.starksheet.xyz)
    
2.  click "+" to add a sheet (cost 0.01 ETH/sheet)
    
3.  click "Save" and wait for the tx to be "Accepted on L2"
    
4.  retrieve the address in the transaction page, under "Deployed Contracts" (see this [example tx](https://starkscan.co/tx/0x3500ee96b3f287c94aaf73a350650492b70c513c215a7c68574ccfbe13d95e9))
    
5.  your sheet is available at app.starksheet.xyz/{address}, ([app.starksheet.xyz/0x00d1540fbe29acb2522694e9e3d1d776f1ab70773d33149997a65d06cc8a816f](https://app.starksheet.xyz/0x00d1540fbe29acb2522694e9e3d1d776f1ab70773d33149997a65d06cc8a816f) in the tx above)
    

Et voilà! You can now share this unique address with whoever you want to be able to mint your NFT: tell them to type any random value in the cells and click "Save" to mint.

### Parameters

Deploying a Sheet with the Starksheet interface puts some default values to parameters that you can change later on using, for example, [starkscan.co](https://starkscan.co/contract/0x00d1540fbe29acb2522694e9e3d1d776f1ab70773d33149997a65d06cc8a816f).

Some are basic parameters while some others may require a more advanced skill set. For blockchain beginner, you need to be aware of the fact that a block explorer splits the possible calls into two categories:

1.  **READ**: these calls are not making any transaction, these are just view functions to read some on-chain data provided by the contract. For example, your Sheet has a `owner` view function, that returns the sheet's owner address, ie the address you used to deploy the collection
    
2.  **WRITE**: these calls _are making a transaction and costs gas_ because they modify the state of the blockchain. So be sure to double-check whatever you put in because you may lose money or break the Sheet. Fortunately, not all the calls are difficult to make!
    

![The starkscan page of the Dusty Pilots sheet, in the view tab after clicking on "Query" for the owner function.](https://storage.googleapis.com/papyrus_images/65f20df9d7bae0141bbea5ffa333edf55b3a7073d85f62e1aee64e7dd81d70cd.png)

The starkscan page of the Dusty Pilots sheet, in the view tab after clicking on "Query" for the owner function.

Let's dig into some of the parameters a Sheet offers:

*   **READ**:
    
    *   _owner_: the address of the collection owner (this address will be able to update anything on the collection, especially on Mint Square)
        
    *   _contractURI_: returns metadata about the collection, see also [Mint Square doc](https://mintsquare.notion.site/mintsquare/Mint-Square-Collection-info-and-royalty-256feda391624f41861853bc2b548bf5)
        
    *   _tokenURI_: this is the function called by any marketplace or wallet to get the information related to a given token. Notice that it takes a `tokenId` as parameters
        
    *   _totalSupply_: the total number of minted NFTs.
        
*   **WRITE**:
    
    *   _closeMint_: by default, a Sheet is mintable when it is created. You may want to close it and open it later on with the _openMint_ function.
        
    *   _setName_: use this to update the name of the collection (default is "Sheet0"). Note that the name needs to be the hex string representation of the name. If you are not sure, you can use [an online converter](https://codebeautify.org/string-hex-converter) and paste the result (something like 0x1234)
        
    *   _setSymbol_: use this to update the symbol of the collection (default is "SHT0"); see above for standard string to hex string.
        
    *   _setContractUri_: use this add a url to fetch the contract data uri from. This is more advanced and requires you to:
        
        1.  get a permalink to a json file containing your contract uri (use for example [IPFS](https://gist.github.com/ClementWalter/ipfs.io))
            
        2.  split the url in chunks of no more than 31 characters long strings. For example, the url "ipfs://QmZQKPF3PHsKo8bUz8sEiVoqFh7qfGkFb6vY7N1VEVSdQj" is 53 character longs, so you would need to split it. This is an example url, not the one you have to put! For the sake of completeness, this url could be split in 4 like 'ipfs://QmZQKPF3P', 'HsKo8bUz8sEiVoqF', 'h7qfGkFb6vY7N1VE', 'VSdQj'. Then convert each of these chunk with the above mentioned tool, which should give '0x697066733a2f2f516d5a514b50463350', '0x48734b6f3862557a38734569566f7146', '0x68377166476b4662367659374e315645', '0x565364516a'
            
    *   _setCellRenderer_: update the contract called to produce your token image. By default, a cell image is its value in a blue rectangle. You probably want to update this to you own NFT! For this, you need to deploy a contract and then call this function with its address. The following section gives all the details regarding this operation.
        

The minimal changes that you **need** to do for you collection to look like the Dusty Pilots is:

*   `setContractUri` to give more data for Mint Square to add a banner and profile picture
    
*   `setCellRenderer` to use a custom cell renderer, ie to change the cell image from the basic default blue rectangle to your own NFT
    

![A Cell image with the default cell renderer](https://storage.googleapis.com/papyrus_images/9cbd191a714ff512c211df1b592d91a73b73e1ccc63cde51536c0b9d76d357ba.png)

A Cell image with the default cell renderer

Updating the NFT images
-----------------------

### The CellRenderer contract

Usually, a NFT collection is made up of several images, each with their own characteristics, known as metadata. This data is retrieved by the marketplace calling the `tokenURI` function of your contract.

In the Starksheet protocol, this call is indeed delegated to the `CellRenderer` contract.

While you can develop your own `CellRenderer`, you can also use the `UriRenderer` the Starksheet team has made available for free. This renderer needs to be deployed with a `base_uri` string and will produce for each token a `tokenURI` like: `base_uri/{token_id}.json`.

For example, the token uris of the Dusty Pilots are built with the following `base_uri`

`https://raw.githubusercontent.com/the-candy-shop/starksheet-monorepo/main/packages/starksheet-cairo/dust_pilots/token_uris`

And token `2` for example is retrieved at (see the added `/`):

`https://raw.githubusercontent.com/the-candy-shop/starksheet-monorepo/main/packages/starksheet-cairo/dust_pilots/token_uris/2.json`

### Using the UriRenderer

This contract needs to be set up with 2 parameters:

*   _owner_: the address owning the contract, and thus able to update it later on if required
    
*   _base\_uri_: the uri to be concatenated with the token number as explained above.
    

To use your own renderer contract, you need to go to [The Universal Deployer contract page](https://starkscan.co/contract/0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf#read-write-contract-sub-write) and fill it as follows:

*   _classHash_: 0x1675f7720f525b280d71bbf04f646a16d3804d1de2f8e571636cacaa42b2fc3
    
*   _salt_: 0x1
    
*   _unique_: 0x1
    
*   _calldata\_len_: 2 + number of chunks of the base uri
    
*   _calldata_: owner address, number of chunks of the base uri, chunks of the base uri
    

If you do it right, you have `calldata_len` values separated by a `,` in `calldata`.

![A example of how to fill in the form to create your own renderer](https://storage.googleapis.com/papyrus_images/799f2e856057fa4e346f561b7636eb2707adf50f7fa40df13480fa23e929d7f5.png)

A example of how to fill in the form to create your own renderer

Click "Write" and sign the transaction. Open the tx page and look for the "Deployed contracts" again. Opening the contract page, you can check that everything is set up properly by querying the `getBaseUri` method.

If you want to first do the mint, and then later on unveil the tokens, you can call `setUseTokenId` (Write tab) with `0` and it will only return the `baseUri` Y ou can also update the `base_uri` to something else, again splitting in chunks and converting to hex strings.

Finally, copy the address of the deployed contract and go back to your sheet page. Use this address as input for the `setCellRenderer`, "Write", sign, and boom! you have customized your NFTs! As an owner of the collection, you can call "Refresh all" on the Mint Square page to propagate the changes.

![The setCellRenderer function to call with the deployed renderer contract address](https://storage.googleapis.com/papyrus_images/c4dd4256d3a14cbc3b38df86e9ab0f9d610aecda35bbbbd353c972aacf392d64.png)

The setCellRenderer function to call with the deployed renderer contract address

### Storing the images

Now that the tech part is fully covered, well, you need to generate your NFT data!

Each NFT uri (like `base_uri/token_id.json`) should return a json file with at least the following data:

    {
      "description": "Description of the item",
      "image": "Image url",
      "name": "Name of the item",
      "attributes": [
        // a optional list of attributes displayed by marketplaces
        {
          "trait_type": "a first category",
          "value": "value for this trait"
        },
        {
          "trait_type": "a second category",
          "value": "value for this trait"
        }
      ]
    }
    

For the [Dusty Pilots collection](https://mintsquare.io/collection/starknet/0x00d1540fbe29acb2522694e9e3d1d776f1ab70773d33149997a65d06cc8a816f) I have simply used [Github](https://github.com/) as a main repository. Depending on your skill set, you may opt in for different options; chat GPT may help as well. Just be careful: the final url for reach file **needs** to be `{base_url}/{token_id}.json`.

Conclusion
----------

In this article, I wanted to share how to use [Starksheet](https://app.starksheet.xyz) as a backend to easily deploy a NFT collection on Starknet. Using Starksheet lets focus on the creative work and the narrative of a collection, the tech part of it being mostly automated!

This is only one example of what you can do with a sheet! Go crazy and share your work on [twitter](https://twitter/com/starksheet)!

---

*Originally published on [Clemlaflemme](https://paragraph.com/@clemlaflemme/how-to-deploy-a-nft-collection-on-starknet-with-starksheet)*
