
New to Smart Contract Development?If you don’t know how smart-contract blockchains work, understand that NEAR smart contracts:
- Have limited computational resources
- Interact with other contracts in an asynchronous way
- Deal with real money, for which security must be a top concern
Where Do Contracts Live?
Smart contracts are deployed into NEAR accounts. Any NEAR account can hold a contract, needing to pay for the contract’s code and the data it stores. Once in an account, anyone can interact with the contract. Thanks to the underlying network structure, executing code from a contract is both fast (avg. 1.4s finality) and cheap. Moreover, read-only operations are free for everyone.Storing 100kb costs 1Ⓝ, so deploying a contract generally costs only a few $NEARs.
What Can They Do?
Smart contracts have complete control over the account, and thus can perform any action on its behalf. For example, contracts can:Transfer $NEAR Tokens
Send NEAR tokens to other accounts
Call Other Contracts
Execute methods on other deployed contracts
Create Accounts
Create new accounts and deploy contracts on them
Update Code
Update their own code programmatically
What Are They Used For?
Smart contracts are useful to create decentralized applications. Some traditional examples include:- Decentralized Autonomous Organizations (DAOs) - where users create and vote on proposals
- Marketplaces - where users create and commercialize digital art pieces
- Decentralized Exchanges (DEXs) - where users can trade different currencies
- DeFi Protocols - lending, borrowing, and yield farming platforms
- NFT Projects - collectibles, games, and digital art
Development Flow
Just like any piece of software, smart contracts have a development flow - starting with creation and ending with monitoring.Scaffold
The simplest way to create a project is by starting from a template. See Quickstart.
Build
Write a contract using Rust or JavaScript. Learn about Contract Anatomy.
Test
Our Sandbox enables simulating interactions with contracts in a realistic environment. See Testing.
Deploy
After ensuring the contract is secure, deploy it into your account. See Deployment.
Supported Languages
During the whole cycle, developers can choose between JavaScript and Rust, allowing them to use their favorite language at each step of their journey.Other LanguagesTheoretically, you can use any language that compiles to WebAssembly for developing NEAR smart contracts. However, to have a user-friendly experience, you need a library that wraps around low-level runtime APIs while offering high-level functionalities.We envision that in the future, more languages will be supported through community efforts.
Contract Primitives
Contract primitives such as FT (Fungible Tokens), NFT (Non-Fungible Tokens), and DAOs are fundamental building blocks that can be combined to create awesome user experiences such as reward tokens, decision-making tools, and marketplaces.Learn About Primitives
Explore NEAR’s contract primitives and standards
Next Steps
Quickstart
Build your first smart contract in minutes
Contract Anatomy
Understand how smart contracts work
Testing
Learn how to test your contracts
Security
Best practices for secure contracts