The Law Offices of NEAR
We find The number of new smart contracts deployed over time (2022) and the top 5 new smart contracts interacted in that period
Introduction
A "smart contract" is a programming code that runs on blockchains. This program is a set of codes and data located at a specific address in the block chain. For example, in Nir Blockchain, you can consider the smart contract as an application in the operating system (Blockchain) that is used as a tool. Users can interact with a smart contract by sending transactions that execute the functions defined in the smart contract. Once deployed on the blockchain, the smart contract cannot be changed, which is why you should carefully review your code and test it before deploying it on the blockchain.
Methodology
In this dashboard, we aim to find new smart contracts deployed in 2022 on the NEAR blockchain. The data in NEAR tables are slightly different from other blockchains, so that it is not easy to find the contract address column that is available in other tables (other blockchains), for this reason, to find contracts, we have to search several tables at the same time. Our method is that we first obtain the transaction address(tx_hash) related to the creation of a smart contract from Table near.core.fact_actions_events
by applying the following condition:
ACTION_NAME = 'DeployContract'
and BLOCK_TIMESTAMP::date >= '2022-01-01'
Then, by using Table near.core.fact_transactions
and applying the following condition:
TX:actions[4]:FunctionCall:method_name = 'new'
that indicates the initial construction of the smart contract and not its update, we obtain the smart contracts that were built on the NEAr blockchain in 2022.
We can also apply another condition, for example the following condition:
TX_RECEIVER like '%.near'
which makes the contracts more limited and considers only those whose ID is a string with ‘.near‘ at the end.
In general, we present two methods in the results analysis section: the first method in which last condition is not applied and the second method in which the mentioned condition is applied.
By applying the filters mentioned above for method 1, the total number of new smart contracts created on the NEAR blockchain in 2022 was equal to 1398 contracts, and for method 2, it was equal to 906.
Method 1: In the graph on the right, the purple bars show the daily number of smart contracts and the green line shows the cumulative graph of contracts in 2022. At the beginning of 2022, until February 3, the slope of the cumulative graph is increasing, and the number of contracts created on February 3 has reached its maximum value of 24, but after this date and until the beginning of April, we see a decreasing trend. In April, we see an increase again, so that a new contract was registered on April 27. But after that and until today, the number of registration of new contracts has decreased in general.
Method 2: In the graph on the right, the red bars show the daily number of smart contracts and the blue line shows the cumulative graph of contracts in 2022. At the beginning of 2022, until january 20, the slope of the cumulative graph is increasing, and the number of contracts created on january 20 has reached its maximum value of 23, but after this date and until the beginning of April, we see a decreasing trend. In April, we see an increase again, therefor number of new contract was registered on April 27 is 13. But after that and until today, the number of registration of new contracts has decreased in general.
In the graphs on the left and right, the 5 new smart contracts that had the most interactions in 2022 related to method 1 and 2 are shown.
In both method, the first rank belongs to tayc-nft.near.
Conclusion
In my opinion, both methods can be justified, in such a way that less known users don’t convert their contract address from encryption mode to string mode, so they should also be considered for counting new contracts, and the number 1398 is correct. On the contrary, this issue is not true, so that all of them are changed to a contract with ‘.near’ at the end and the number 906 is correct. But in any case, it does not make a difference in the first place, and contract tayc-nft.near takes the first place both in terms of the number of interactions and the amount of gas consumed.
And at the end, you can see the contracts on which the most gas consumption has been used. Contract tayc-nft.near with about 21 million gas has the largest amount of gas consumed among the new contracts in 2022.
Contracts callmagic.near and jiljungjukmain.near are ranked second and third by a very small margin, respectively.
Analysis
In this section, the following results and charts are discussed:
- Total Number of New Smart Contracts Deployed on NEAR in 2022 for both method 1 and 2.
- Daily Number of New Smart Contracts in 2022 for both method 1 and 2.
- Top 5 New Smart Contracts based on Number of Interaction in 2022 for both method 1 and 2.
- Top 5 New Smart Contracts basedon Gas Consumption in 2022