The Law Offices of NEAR
Q7. Provide your best assessment of the number of smart contracts deployed on NEAR and clearly outline your methodology (after all, contract lawyers love clearly specified terms). Visualize the number of new smart contracts deployed over time over a time period of your choosing. What are the top 5 new smart contracts interacted in that period of your choosing?
NEAR Protocol
Near Protocol is a layer 1 blockchain network. It provides a platform on which developers can build decentralized applications (dapps). The most successful layer 1 blockchain is Ethereum, so protocols like Near are seen as challengers.Near Protocol is faster and cheaper than Ethereum. The network can handle up to 100,000 transactions per second besides offering instant block creation in 1 second.
NEAR Protocol Smart Contracts
NEAR Protocol is well-known for its ecosystem, which provides the most suitable environment for building decentralized applications. Using this protocol, developers can host serverless apps and smart contracts for connecting to open-finance networks and benefit from an ecosystem of reusable smart contracts.Developers and users prefer NEAR Protocol because of its convenient user interface, security and scalability.
Smart Contracts are pieces of logic that are asved on the network of computers that generate and validate the blockchain, and are triggered whenever an RPC API call is performed to the network, either to read or write data. You deploy your application's back-end logic to the blockchain, where it is called a "smart contract" or just "contract" for short.
Whenever a smart contract function is called through the RPC API, this call is routed to a an available node (or machine/computer) that initiates a virtual environment in which the smart contract logic is executed.
The relevant logic from the contract is then executed, reading/writing data and returning a result. If changes were made to the contract these are saved and the changes are propagated to the network. Finally, the virtual environment is torn down and the result is returned to the caller of the RPC API call.
\n
As we see in this pie chart Aurora is the most popular smart contract that built on NEAR.
What language and tools are used to compile a smart contract on NEAR?
We can use any language that is supported by Web Assembly (Wasm) to compile a smart contract on the NEAR Protocol, but it currently supports the following:
Rust (near-sdk-rs)
Rust is a wrapper that helps improve the safety of the Rust programming language used to write high-value smart contracts.
AssemblyScript (near-sdk-as)
AssemblyScript is a group of helpers that helps the smart contracts look the same as TypeScript while compiling them in wasm to specifically execute them. It is currently not used in the development of financial decentralized applications because of the newness of the programming language and the compilation tools associated with it.
Now that we know about the languages and tools used for developing smart contracts on NEAR, Let us quickly look at the basics of calling and deploying a smart contract.
- Calling Smart Contracts on NEAR Protocol \n For wrapping up the JSON-RPC calls, use the near-api-js Quickstarts and Code Snippets.
- Deploying Smart Contracts \n There is a testnet where we are allowed to run our local network and a mainnet as in the NEAR Platform. The state of the smart contract is based on the type of network on which it is deployed and if we want to call it from the same network, we will need to check our configuration while deploying, testing and calling the smart contract.
Conclusion
In this dashboard we analyzed the daily deploying contracts on NEAR and saw some days that had a huge amount of deploys then we looked at the top 5 smart contracts on NEAR that users are interacting with.
We also do some research about how to write a smart contract on NEAR and it is possible to write it with Rust or AssemblyScript.