Available tutorials
Hello NEAR
A simple contract that stores and retrieves a greeting message. Perfect for beginners.
Guest Book
Learn to store and retrieve data with a guest book contract that records messages.
Counter
Build a counter contract to understand state management and function calls.
Status Message
Create a social status message contract with collections and data structures.
What you’ll learn
Contract structure and initialization
Contract structure and initialization
- How to structure a NEAR smart contract
- Initializing contract state
- Using the
#[near]macro (Rust) or decorators (JavaScript) - Defining contract methods
State management
State management
- Storing and retrieving data
- Working with contract storage
- Understanding storage costs
- Managing state efficiently
Function types
Function types
- View functions (read-only, no gas cost)
- Change functions (modify state, require gas)
- Payable functions (accept NEAR deposits)
- Private functions (internal use only)
Testing and deployment
Testing and deployment
- Writing unit tests
- Testing with NEAR Workspaces
- Deploying to testnet
- Interacting with deployed contracts
Getting started
Example: Hello NEAR contract
- Rust
- JavaScript
Next steps
Cross-contract calls
Learn how contracts can interact with each other
Testing guide
Deep dive into testing smart contracts
Security best practices
Secure your smart contracts
NFT tutorial
Build a complete NFT contract