StarkNet ERC721 Workshop: Setup

Note: I wrote a better guide on how to setup a local development environment here. Use that guide instead of this one as I’ve updated all the articles on this series to use it.

In this tutorial we will be completing the ERC721 workshop created by the StarkWare team so developers can get familiarized with creating smart contracts with Cairo and deploying them to StarkNet’s test network, Goerli.

I’ll be breaking down the workshop into multiple articles to keep each post to a manageable size and to make it easy to find by search engines. Make sure to follow the link at the end of each article to go to the next section.

Setup

Instead of cloning the repository created by StarkWare to work on the workshop, I’ll create my own empty folder to work on so we can start from scratch and build our way up.

$ mkdir erc721-workshop && cd erc721-workshop

Before we start, make sure you set up your environment, activate it and install OpenZeppelin’s Cairo smart contracts from pip.

erc721-workshop $ source ~/cairo_venv/bin/activate
(cairo_venv) erc721-workshop $ pip install openzeppelin-cairo-contracts

If you are using Visual Studio Code as I am, make sure to open the editor from the command line while the python environment is activated, otherwise the IDE won’t be able to resolve imports.

(cairo_venv) erc721-workshop $ code .

Once VSCode opens, you also need to make sure that the IDE is using the python binary from the virtual environment instead of a globally installed one. To do that go to the menu View → Command Palette, once the dialog window opens search for Python: Select Interpreter and select the python binary that comes from the virtual environment (cairo-venv).

Note

From this point on I will show only…

$ <some-command>

Instead of the real prompt…

(cairo_venv) erc721-workshop $ <some-command>

To reduce clutter from my code examples and to drive focus to what’s really important.

To continue the tutorial go to Exercise 1: Deploying an ERC721.

So, what do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.