1/5
## Project Setup We are once again in our `mox-cu` folder and we're going to create a new project called `mox-nft-cu`. ```bash mkdir mox-nft-cu cd mox-nft-cu ``` We'll do a `mox init --vscode --pyproject` to initialize the project with Visual Studio Code. ```bash mox init --vscode --pyproject ``` After the command runs, we'll open the folder in Visual Studio Code by running: ```bash code . ``` You can also do this by going to `File > Open` and selecting the folder in your file explorer. We'll then open Visual Studio Code in a new window. Next, we'll delete the default files generated by `mox init` so we can start with a clean slate. We'll also open the `README.md` file to add a description of what we will be building. We will be creating two NFTs. The first is a basic NFT, to get familiar with the basics of creating NFTs. The second is a more advanced NFT that will have a dynamic image. We will call this the `mood` NFT. The image will change depending on a `mood` parameter. If the parameter is set to `happy`, then we'll display a smiley face image. If the parameter is `sad`, then we'll display a frowning face. ```bash cd images/dynamic/ ``` We'll then open the `happy.svg` and `sad.svg` files in our browser to view them. ```bash cd .. ``` We can then create the two NFT contracts to fulfill our needs. ```bash mox create mood-nft mox create basic-nft ``` Let's create a script to deploy both of these NFTs. ```bash mox create deploy-script ``` Now let's open the `deploy-script.py` file: ```bash cd script code deploy.py ``` We'll edit `deploy-script.py` and include the following code: ```python from src.mocassin.tools import Counter from boa.contracts.vyper_contract import VyperContract def deploy() -> VyperContract: counter: Counter = Counter.deploy() print("Starting count:", counter.number()) counter.increment() print("Ending count:", counter.number()) return counter def moccasin_main() -> VyperContract: return deploy() ```
A comprehensive guide to setting up a new project with Mox - a Python framework for interacting with blockchain. The lesson walks through creating a project directory, initializing it with Mox, and configuring it for use with Visual Studio Code.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on February 4, 2025
Duration: 2h 21min
Duration: 1h 58min
Duration: 2h 55min
Duration: 1h 55min
Duration: 46min
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on February 4, 2025