Skeleton and Rust Architecture
In this article, you'll learn about the basic architecture behind the NFT contract that you'll develop while following this "Zero to Hero" series.
You'll discover the contract's layout and you'll see how the Rust files are structured in order to build a feature-complete smart contract.
You can find the skeleton contract in our GitHub repository
If you are new to Rust and want to dive into smart contract development, our Quick-start guide is a great place to start.
Introductionโ
This tutorial presents the code skeleton for the NFT smart contract and its file structure.
Once every file and functions have been covered, we will guide you through the process of building the mock-up contract to confirm that your Rust setup works.
File structureโ
Following a regular Rust project, the file structure for this smart contract has:
nft-contract
โโโ Cargo.lock
โโโ Cargo.toml
โโโ README.md
โโโ src
โโโ approval.rs
โโโ enumeration.rs
โโโ lib.rs
โโโ metadata.rs
โโโ mint.rs
โโโ nft_core.rs
โโโ events.rs
โโโ royalty.rs
- The file
Cargo.toml
defines the code dependencies - The
src
folder contains all the Rust source files