1/5
Now that we know what an SVG is and how we can code it, we can use this coding to build an NFT where all the metadata is stored directly on chain. Let's go ahead and build this NFT. We'll call our new contract "mood_nft.vy" and inside we will code: ```javascript pragma version 0.4.0 @license MIT @title Mood NFT ``` We'll use a few imports here: ```javascript from snekmate.tokens import erc721 from snekmate.auth import ownable as ow ``` We will then define a constructor for our contract: ```javascript initializes: ow erc721: ownable = ow def init(): ow._init() erc721.init_(NAME, SYMBOL, BASE_URI, NAME, EIP_712_VERSION) ``` Finally, we'll need to define some state variables: ```javascript # STATE VARIABLES NAME: constant(String[25]) = "Mood NFT" SYMBOL: constant(String[5]) = "MNFT" BASE_URI: public(constant(String[34])) = "https://gateway.pinata.cloud/ipfs/" EIP_712_VERSION: constant(String[1]) = "1" ``` We are now ready to start deploying our dynamic NFT, which we'll do in the next video!
A comprehensive guide to creating a dynamic NFT with a mood that can be changed. The lesson covers creating a smart contract, initializing state variables, incorporating ERC721, and storing image data on-chain.
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