Skip to main content

What Are All These Files

In this chapter, let's talk about the file structure of a CosmWasm contract project.

aura-nft/ # Root
├── .cargo/
│ └── config # Configuration for cargo commands such as cargo wasm, cargo schema, etc.
├── examples/
│ └── schema.rs # Rust file to generate JSON schema via cargo schema. Outputs to schema/
├── schema # Output folder for JSON schema
├── src/ # Where our smart contract rust files are located
│ ├── contract.rs # Main contract logic, instantiate, execute, query
│ ├── error.rs # Where we define our contract errors
│ ├── lib.rs # The default library, where we define the modules
│ ├── msg.rs # Where we define our message types
│ └── state.rs # Where we define any state variables
├── Cargo.toml # The manifest, it contains all of the metadata that Cargo needs to compile source code

This covers most of the important directories that you will encounter. Others such as Cargo.toml are for your dependencies and others are simple .md files for reading.