Smart Contracts in Blockchain Technology: A Critical Review

: By utilizing smart contracts, which are essentially scripts that are anchored in a decentralized manner on blockchains or other similar infrastructures, it is possible to make the execution of predetermined procedures visible to the outside world. The programmability of previously unreal-ized assets, such as money, and the automation of previously manual business logic are both made possible by smart contracts. This revelation inspired us to analyze smart contracts in blockchain technologies written in English between 2012 and 2022. The scope of research is limited to the journal. Reviews, conferences, book chapters, theses, monographs, and interview-based works, and also articles in the press, are eliminated. This review comprises 252 articles over the last ten years with “Blockchain”, “block-chain”, “smart contracts”, and “smart contracts” as keywords. This paper discusses smart contracts’ present status and signiﬁcance in blockchain technology. The gaps and challenges in the relevant literature have also been discussed, particularly emphasizing the limita-tions. Based on these ﬁndings, several research problems and prospective research routes for future study that will likely be valuable to academics and professionals are identiﬁed


Introduction
The blockchain has been around for over a decade as a proven technology for recording transactions in a decentralized, peer-to-peer network using a distributed database [1,2]. It is considered a distributed computing paradigm that solves the confidence in a single entity problem. Therefore, several nodes work together in a blockchain network to securely and reliably maintain a distributed ledger of all past transactions. Satoshi Nakamoto launched Bitcoin in 2008 [3], which was the first suggested cryptocurrency to present the blockchain as a distributed infrastructure platform. It made it possible for anyone to send and receive bitcoins, a kind of cryptocurrency, without needing to depend on any central authority. Other blockchain-based systems have also been suggested for usage with the coin, including Hyperledger Fabric [4] and Ethereum [5]. The usage of smart contracts is possible, unlike with Bitcoin. With smart contracts, blockchain technology may go beyond conventional contracts by automatically carrying out the terms of agreements between two or more people in a decentralized setting once the necessary circumstances have been satisfied [6].
As blockchain has developed, smart contracts have become more popular [7,8]. A smart contract is a piece of cutting-edge technology that may be used in a blockchain ecosystem to mechanically negotiate, carry out, and enforce the conditions of a legally binding agreement [9]. Reduced risk, lower service, and lower administration costs, and enhanced business process efficiency are some of the benefits of smart contracts over standard contracts [10]. More crucially, smart contracts may build confidence between parties in no-trust contracting contexts [11]. In this respect, it will revolutionize established ways of doing business [12].
Distributed ledger technology (blockchain) and smart contracts have many potential uses outside of the financial sector, including in insurance claims processing, supply chain management, and IP enforcement. The use of smart contracts and blockchain applications among businesses shows no signs of slowing down. Blockchain applications, however, must be carefully crafted and rigorously tested to meet stringent security, scalability, and performance standards. This is particularly the case when the non-standard software life cycles used in the development of smart contracts are considered, which makes it difficult to update or fix flaws in deployed apps by releasing an updated version of the program [13]. Smart contract creation is very different from more conventional forms of software engineering, and as such has its own unique set of difficulties [14,15]. For example, developers must guarantee code safety for smart contracts because of the immutability of blockchain and the sensitive nature of digital information often managed, and they must pay close attention to gas consumption because the implementation of smart contracts in blockchain platforms, the same as Ethereum, is applied through the gas mechanism [16]. The product lifecycle and software development process of smart contracts and blockchain-based apps should consider the unique limits and features demanded by blockchain technology. It is necessary to identify and investigate all of these shifts in software products and processes to build a complete body of knowledge based on blockchain software engineering.
Despite the growing interest in smart contracts and the research proposals made to address some of these problems, the solutions that have been put forth are not yet unified. For this reason, it is important to determine whether software engineering methods, methodologies, best practices, and testing strategies have been tailored to accommodate the unique aspects of blockchain-based decentralized application development [17]. Smart contracts have been the topic of several literature assessments, surveys, and reviews. Macrinici et al. [7] categorized 64 papers on smart contracts and concluded that the topics of discussion included smart contract scaling, and the security, privacy, and programmability of blockchains. Ante [18] summarized and analyzed the present state of the literature on smart contracts and identified intellectual structures and new trends. The study by Hewa et al. [19] looked at some of the important uses for smart contracts that have previously been successful. They emphasized the smart contracts built on blockchain's future potential from the standpoint of these applications. A technical and practical analysis of blockchain-enabled smart contracts was provided by Khan et al. [20]. They pointed out several difficulties and unresolved problems that need attention in the next research. This paper conducts a critical literature review of the blockchain and smart contracts' advancement, issues, and direction to fill this void and gain a clearer picture of the research efforts that have been made to enhance the execution, reliability, and security of this type of application. Furthermore, the aim is to pinpoint potential future research areas and unresolved concerns. The specific study questions are as follows: Here is how the current study is set up: Section 2 describes in full the research process used to find, filter, and select the literature. The third section reviews the literature on smart contracts in the blockchain, outlining the most cited works and analyzing their significance, as well as emphasizing some of the challenges that have been identified in this field. The section concludes with a consideration of upcoming trends. Finally, conclusions are discussed in the report's last section.

Background of the Study
Over the last decade, blockchain technology has emerged as a popular academic pursuit. A smart contract is a collection of tamper-resistant, self-executing, and selfverifying algorithms. Integrating blockchain technology into a smart contract makes it possible to complete a transaction in near real time at a lower cost and with a higher level of security. The background of the blockchain and smart contracts is covered in the following sections:

Blockchain
The blockchain is described as the underlying technology of Bitcoin and other cryptocurrencies-a shared digital ledger or a continuously updated record of all transactions [21]. Blockchain may be considered both an economic and technological breakthrough [22]. It provides a solution to any issue requiring a trustworthy ledger in a decentralized setting where not all participants, whether human or computer, can be trusted completely [23]. The blockchain is a collection of cryptographic techniques and protocols used by a network of nodes that cooperate to accomplish the safe recording of data inside a distributed database that consists of encrypted blocks encapsulating the data [24].
There have been three major milestones in the evolution of blockchain technology so far: the use of digital money in the 1.0 stage, the use of smart contracts in the 2.0 stage, and the creation of programmable blockchains in the 3.0 stage [25]. In its present phase of development, blockchain is mostly employed for small-scale local applications; there are very few industry-or ecosystem-level uses for it. Nevertheless, the distinctive characteristics of blockchain have begun to extend across several sectors [26].

Smart Contracts
Smart contracts are a significant development in blockchain [27]. Smart contracts were first proposed in the 1990s as a digital transaction protocol to carry out the terms of an agreement [28]. Smart contracts are simply containers of code that encapsulate and replicate the terms of real-world contracts in the digital domain. Contracts are fundamentally a legally binding agreement between two or more parties, with each party committed to fulfilling its commitments. Importantly, the agreement must be enforceable by law, often via a centralized legal body (organization). Nevertheless, smart contracts replace trusted third parties or mediators between contracting parties. They make use of this with the assistance of code execution that is automatically disseminated and checked by network nodes in a decentralized blockchain. In addition, they allow transactions between untrusted parties without the necessity for direct contact between the parties, reliance on third parties, and intermediary commission costs [29].
Compared to conventional contracts, smart contracts offer the benefits of reducing transaction risk, reducing administration and service costs, and enhancing the efficiency of corporate processes, since they are often placed on and secured by blockchain [12]. Smart contracts are projected to give a superior solution to the present transaction mechanism in a variety of businesses in this regard.

Planning the Review
The purpose of this research synthesis was to determine where smart contracts stand in the blockchain industry at the current time. This inquiry was carried out with the utmost seriousness by carefully reading all of the current applicable literature. The review process involves the use of structured research questions, databases, and procedures for identifying and assessing information. To provide a transparent evaluation of smart contracts in blockchain technology, certain features of the suggested reporting items for critical reviews were chosen. The overall strategy consists of the following major steps:

•
Examining the present condition of the field.

•
Recognizing the significance of the review.

•
Determining the challenges and future directions of the field. • An overview of the investigation's findings.

Research Strategy
A comprehensive evaluation of the literature requires an inclusive viewpoint. To maximize the chances of discovering highly relevant papers, an adequate selection of databases were selected before the search. During the review, the Scopus sources were checked.

Search Criteria
To guarantee that the material given here is exhaustive, relevant databases were thoroughly searched. However, not all classic literary works were incorporated into the search parameters for several reasons. Perhaps the search term was not included in the abstract, or the article had a very distinctive title. To accomplish the objective, a comprehensive literature search was conducted. Thus far, around 774 Scopus results have been evaluated (9 November 2022). Approximately 252 were considered to be relevant ( Figure 1). The study domain and research questions influenced the search string creation. By searching "Blockchain" or "Block chain" AND "Smart contracts" or "Smart contract", the relevant material was located and obtained.

Results and Discussion
Below are the findings from responding to the research queries specified in the a   • Inclusion Criteria (IC).

1.
Research may be released anytime between 2012 and 2022.

2.
The scope of research is limited to the journal. 3.

1.
Articles not written in English 2.
The exclusion of reviews, conferences, book chapters, theses, monographs, and interview-based works. 3.
Articles in the press are eliminated.

Results and Discussion
Below are the findings from responding to the research queries specified in the aforementioned critical review. This section presents blockchain technology and smart contracts and discusses the technology's foundations, variants, development teams, platforms, and consensus mechanisms. There is further discussion of the value of utilizing smart contracts in blockchain later in the review.

Selection Results
Out of the 774 items provided by this search, 522 were screened. There are 252 articles in this critical review. The articles in the press fulfilled the criterion for inclusion, but they were not considered for the 2012-2022 series. The list of selected papers with explanations of the overall categorization results is provided below.
RQ1: What is the present condition of the field of study? This methodical investigation looks at the gathered descriptive information on the various articles published each year, the publication source, and the yearly average amount of citations that research papers obtain. This critical review's analysis of smart contracts in blockchain research publications published between 2012 and 2022 comes to a close. There are most publications on this topic in the IEEE Access journal (27 articles). Figure 1 shows the number of articles generated per subject area from 2012 to 2022. Computer science (179 articles) and engineering are the primary topic areas (122 articles). Other subjects include Materials Science (29 articles), Social Sciences (28 articles), Business, Management, and Accounting (27 articles), Mathematics (20 articles), Decision Sciences (18 articles), Physics and Astronomy (15 articles), Environmental Science (13 articles), and Energy (12 articles), etc. Approximately 35% of research is in the field of computer science, specific to blockchain and smart contracts. This is the basis of blockchain and smart contracts. The next category is engineering (about 24%), which can, usefully, include all of these subjects. The number of publications published has dramatically increased during the last ten years. This department reflects an interdisciplinary approach to the subject of smart contracts. There is a notable lack of research output in economics, which suggests that the discipline draws most of its basic research from engineering and legal scholars.
The percentage of authors by nationality is presented in Figure 3. China has the most authors. India and the United States follow. This may suggest that the scientists of these crowded countries are working together, i.e., co-authoring numerous publications. article, while 2017 had no publications. Clearly, between 2018 and 2022, the number of articles increased. There were 12 articles published in 2018, 27 papers published in 2019, 52 papers in 2020, 86 papers in 2021, and 74 papers in 2022. The number of publications published has dramatically increased during the last ten years. This department reflects an interdisciplinary approach to the subject of smart contracts. There is a notable lack of research output in economics, which suggests that the discipline draws most of its basic research from engineering and legal scholars. The percentage of authors by nationality is presented in Figure 3. China has the most authors. India and the United States follow. This may suggest that the scientists of these crowded countries are working together, i.e., co-authoring numerous publications. RQ2: How significant are smart contracts in blockchain technology? The name "smart contract" is deceptive since it implies a legally enforceable agreement, while, in reality, it is only stupid computer code. To put it accurately, Ethereum's creator said, "I quite regret choosing the phrase 'smart contracts'. Maybe I should have gone with a more dry and technical name, like 'persistent scripts'" [5]. Different levels of RQ2: How significant are smart contracts in blockchain technology? The name "smart contract" is deceptive since it implies a legally enforceable agreement, while, in reality, it is only stupid computer code. To put it accurately, Ethereum's creator said, "I quite regret choosing the phrase 'smart contracts'. Maybe I should have gone with a more dry and technical name, like 'persistent scripts'" [5]. Different levels of smart contracts' efficacy as legally enforceable contracts are distinguishable: A "smart contract" is described as "computer code that does not represent any legal contract but merely executes a predefined logic" in one definition, and as "a program with a predefined logic based on legal structures that are expected to act in a particular way" in another.
For the first time, blockchain technology provided an appropriate distributed infrastructure for the use of smart contracts by facilitating the safe p2p transfer of value across the internet between non-confidential parties. When the conditions are satisfied, the blockchain will run the code without anybody or anything being able to stop it. Since the underlying code can be seen by everyone with access to the blockchain, there is no longer a requirement to trust your counterparty. Due to the usage of a unified contract, there is no need for a third party to read the terms and conditions, and transactions may be processed instantly. Moreover, digital signatures reveal without a doubt the origin of the transactions that activated the smart contract.
Despite the numerous advantages and possibilities that smart contracts provide, they are not without their share of difficulties and threats. There is no way for a smart contract to initiate itself. It sleeps until a transaction occurs in which one of its tasks is invoked. As a result, smart contracts are never independent; something else (a transaction, for example) must occur for them to take effect. There is a problem with smart contract use cases that involves events and processing data that do not occur immediately on the blockchain. A smart contract's response to a blockchain transaction is instantaneous since the whole process takes place on-chain. However, if the necessary information, for instance, involves a guest checking out of a hotel room (off-chain), the script cannot automatically get these data. While the blockchain itself may be relied upon, the information transferred there may not be trusted by the parties to a smart contract. This is referred to as the "oracle issue" because it affects all people, programs, and devices that take part in these activities.
Since all nodes in a network need to keep a copy of the blockchain (and any attached computer code), the technique is inefficient in theory. Smart contracts on public blockchains are performed worldwide, at each node in the blockchain on each iteration. Because computing is a predictable process, it is likely that a global code rollout is not required [30]. The storing of all data by all network members also introduces the problem of data security. The stored data cannot be quickly erased, which goes against the provisions of laws such as the "right to be forgotten" [31,32].
In their simplest form, smart contracts are just blockchain-based computer programs that are activated when certain criteria are satisfied. Common applications include automating the execution of agreements so that all parties involved know the result without delay or third-party participation. They may also automate a process by causing one action to lead to another automatically.
Coded "when . . . then . . . " and "if" expressions on a blockchain are what make smart contracts tick. If, and only if, certain requirements are validated and satisfied, the activities are carried out via a network of computers. These measures may include transferring monies to the correct accounts, registering a vehicle, notifying relevant persons, or issuing a citation. Following this, the blockchain is updated to reflect the successful completion of the transaction. This implies that after the transaction is finalized, no changes can be made, and only those who have been given access to the data may see them.
To ensure that all parties are satisfied with the agreement's conclusion, a smart contract may include as many conditions as are required. Participants must agree on the representation of data and transactions on the blockchain, the "if/when . . . then . . . " rules that apply to transactions, the exceptions to those rules, and a structure for resolving disputes to set the terms. A developer may then code the smart contract, albeit a growing number of blockchain-using businesses also provide web interfaces, templates, and other online tools to make smart contract construction more manageable.

Smart Contracts' Platforms
Expert blockchain developers are needed to help clients in identifying the optimal blockchain platform and method for developing and deploying smart contracts to their organization's needs. Different blockchain systems allow for the development and deployment of smart contracts (e.g., Ethereum, Hyperledger Fabric, NEM, STELLAR, Waves, and Corda). Because of its restricted scripting language and emphasis on security over programmability, Bitcoin was rarely mentioned when smart contracts were addressed. Bitcoin networks cannot support complex smart contracts. Furthermore, basic contracts that may be carried out on Bitcoin are often difficult to draft and expensive to carry out. For creating smart contracts, several platforms provide unique capabilities such as security levels, contract code execution, and contract programming languages. Some platforms enable the creation of smart contracts using high-level programming languages. Table 1 compiles a summary of the advantages and disadvantages of various platforms.

The Advantages of Smart Contracts
• Savings Through the use of smart contracts, the time and money often spent waiting for and paying middlemen to process transactions is eliminated. The method presented by Khatoon [33] utilizes blockchain to establish a healthcare ecosystem. Through this study, many medical system stakeholders would be assisted in providing improved healthcare services while reducing costs.

• Security
The blockchain's encrypted transaction records are almost hack-proof. Additionally, with a distributed ledger, hackers will need to modify the whole chain to change a single entry. Pan et al. [34], by developing an EdgeChain model, indicated the security advantages of smart contracts and blockchain with fair cost.

• Confidence and openness
There is no need to worry that information has been changed for nefarious purposes since there is no middleman and participants exchange encrypted records of transactions. Nugent et al. [35] demonstrated that blockchain-based smart contracts provide an innovative technical solution to the issue of data tampering by supplying an immutable record of experimental history and serving as trusted administrators.
• Accuracy, efficiency, and rapidity As soon as a condition is satisfied, the contract is instantly executed. There is no paperwork to handle and no time wasted correcting mistakes that often occur from manually filling out documentation due to the digital and automated nature of smart contracts. Griggs et al. [36] developed a system where the sensors interact with a smart device that executes smart contracts and logs all occurrences on a private blockchain on the Ethereum platform. Sending alerts to patients and medical experts, while keeping a secure record of who started these actions, would enable real-time patient monitoring. The top cited papers from 2012-2022 are shown in Table 2.

Applications
Smart contracts have many potential applications in industries including healthcare, supply chains, energy, etc. The development of smart contracts may automate procedures in many types of sectors. They offer the data accessibility necessary to provide a service when requested. Table 3 offers a concentration of the top 50 cited publications, arranged from top to bottom by citation. This is according to the paper's main focus areas, which include Healthcare, Potential Study, Supply Chain, Transparency, Authenticity, Privacy, and Security, Energy, Rights and Data Sharing, and Construction Payment.   Since smart contracts are implemented in the blockchain system, and the blockchain itself may be thought of as a distributed database, the blockchain has the added benefit of being a distributed system that can guarantee the integrity of any data stored in it. However, there are still several obstacles preventing smart contract technology from being widely used.

I. Processing
Mainstream blockchain systems lack robust data processing capabilities and efficient smart contract execution. Mainstream blockchain systems such as Hyperledger and Ethereum may be seen as distributed databases; as a consequence, every node shares the data of the whole blockchain, resulting in a platform with no more data-processing power than a single node. Smart contract code is performed sequentially, which reduces the blockchain's data processing capability. Smart contracts struggle to expand storage because of this. Every block in the blockchain has a predetermined amount of storage space, and its size cannot be increased. If a mistake has already been made in a block data record, the only way to fix it is to attach the right record to the end of the chain. This approach aids the system's decentralization but drastically restricts block storage's scalability. As the volume of blockchain data continues to grow in tandem with the number of transactions, the time has come to provide truly scalable storage for smart contracts.

II. Acceptance
There are still many myths about the technology despite the buzz around smart contracts and blockchains in both the public and consortium spheres. There have been numerous exaggerated use cases and overblown expectations. Even with appropriate use cases, convincing consumers and stakeholders to adopt new technology may be challenging. This could lead to increased development expenses and a poor return on investment. In reality, implementing some of the described use cases using conventional databases is more effective. Therefore, individuals interested in creating smart contract solutions should consider the cost of development, as well as what can and cannot be done.

III. Immutability
There is a lack of sophisticated contract development language and efficient vulnerability detection and processing techniques [82]. Once Ethereum smart contracts have been implemented, they cannot be altered, making it very difficult to find a solution to the security issue in smart contracts. After a smart contract has been integrated into a blockchain, there is no straightforward way to fix any bugs that may have been introduced during the development process. As a result, a process for updating and terminating the contract status must be developed. In contrast, this approach runs against Ethereum's guiding concept that "code is law", and even if it is built, it faces significant challenges in being accepted by every node in the network. A new blockchain is created if certain nodes are not validated. One of the difficulties with smart contracts is that they provide a security risk such as this.

IV. Integrity
Even though all nodes in a network execute predetermined software to carry out the terms of a smart contract, the data used by such contracts are under the control of other parties and hence not entirely reliable. Access to information stored in a smart contract or blockchain is often restricted. Instead, they utilize third-party wallet applications that put users' personal information at risk.

V. Usability
In contrast to conventional contracts, smart contracts are not adaptable with exceptions such as bugs since they are logic-based computer programs with a limited amount of interaction. They also do not enable individuals to discuss and make changes based on subsequently approved revisions. Allowing common consumers to directly handle their data is problematic because of the P2P nature of blockchains, and when using cryptocurrency, the exchange rate might be unpredictable.

VI. Security
One of the primary issues of any blockchain system and associated process is security. In reality, many vulnerabilities are caused by scripting language misunderstandings [37]. Wang et al. [37] classified smart contract semantic vulnerabilities as transaction-ordering reliance, call stack depth, time-stamp dependence, re-entry attacks, and mishandled exceptions. A smart contract system has low maintainability and several potential security flaws. Smart contracts pose substantial, unseen risks since their code is difficult to maintain once they have been implemented. There is no method to patch a security issue in a smart contract in the chain unless the contract code is updated and redeployed, which wastes time and space. Because of the immutable nature of the blockchain, smart contracts are almost impossible to alter. The creation of new smart contract languages and the upgrading of current ones should be carefully considered to increase the security of smart contracts. Additionally, before utilizing certain blockchain platforms, one should be aware of their mechanisms and weaknesses since the sorts of attacks differ from one platform to the next.

VII. Legal issues
Lawyers can address the issue of regulation in detail if smart contracts are well-stated. However, it is also debatable whether smart contracts need any kind of regulation (direct or indirect). It is ultimately just computer code. Regulating smart contracts in light of their particular uses, dangers, and ramifications could make more sense. According to most studies, smart contracts will not replace the law per se, but they may serve as particular, legally enforceable contracts. Therefore, it is crucial to comprehend if smart contract technology can or cannot serve as a substitute for the law. The research by Marino and Juels [83] serves as a foundation for the ongoing development of a technological smart contract system that is based on contract law and allows parties to modify or annul smart contracts under predetermined circumstances. The phrase "smart contract" may suggest that research should not be entirely focused on contract law.

VIII. Privacy
Public smart contracts' pseudonymity may not always imply a guarantee of privacy. They specifically do not ensure unlinkability, which is essential for both fungibility and privacy [84]. Integrating an additional data protection component is one method to safeguard privacy. Since the use of encryption methods often results in an increased processing load on the system, future research and development of privacy-preserving strategies will concentrate on lightweight solutions.

RQ4:
In what ways will smart contracts in the blockchain develop in the near future? The security performance of smart contracts has improved overall. Numerous aspects, including cryptography, consensus algorithms, and smart contracts, have an impact on the security performance of smart contracts. Smart contracts' security issues cannot be effectively addressed by focusing on just one component of them. Blockchain security issues have not been completely resolved by the current research. Therefore, from a global viewpoint, taking into account several levels and multiple influencing elements would be crucial for creating the safest and most ideal blockchain security protection system.
Smart contract verification on a large scale and the standardization of verification methods and tools, and tools for formally checking Ethereum bytecode and smart contract source code are still in their infancy and have few practical uses at the moment. There are a lot of ways out there, but many of them can only identify one kind of vulnerability or a small number of vulnerabilities and take a lot of effort. Due to the overlap in the vulnerabilities detected by some technologies and differences in the vulnerabilities detectable by others, vulnerability identification in contracts is a particularly complicated and uncomfortable problem. To boost detection efficiency and reduce detection costs, formal verification of smart contracts must go in the direction of scale and the unification of vulnerability security validation and monitoring technologies.
To deal with the difficulties of quantum computing, cryptographic security technology has been developed. The blockchain system relies on cryptography, which was thought to be unbreakable when it was first developed. However, cryptography is not without its flaws, and there is always the chance that it may be cracked. The quantum computing Shor algorithm, developed in 1994, offers a significant danger to encryption techniques such as DES and hence poses a threat to the security of blockchain. Because it relies on cryptography, blockchain technology will lose its primary benefits if and when its underlying security is compromised. As a result, blockchain research and development will focus on creating reliable cryptographic security technologies to counteract the threats posed by quantum computers, and harmonization and interoperability between conventional legal norms and digitally executed contracts. The current stage of smart contracts is when they work along with conventional contracts. Further work will have to be carried out to improve smart contracts' grasp of the law, set up review criteria for smart contracts, cut down on mistakes, and bring smart contracts up to par with legal review requirements. However, to prevent thorny accountability issues in the future, it is also required to enhance current laws to specify the different scenarios of smart contracts and the specific meaning communicated by the parties to the transaction. These two variables achieve the purpose of better coordinating and integrating smart contracts and traditional regulations.

Potential Developments
The following sections explore the potential of incorporating more computer science theory into smart contracts. Theories and works of significance in computer science are explored in light of their relevance to smart contracts: • Data science smart contracts Data science may use smart contracts as a scalable method. Performance constraints, failure concerns, and security threats are particularly present when managing a large amount of data in a centralized design. Smart contracts play a crucial role in data science in several ways. Trustworthy data-sharing procedures, decentralized trust, data integrity, and access control are all areas where blockchain-based smart contracts have proven useful in the field of data science. For large data, Abdullah et al. [85] presented authentication methods related to blockchain. The limits of Kerberos authentication were explored, along with how the blockchain may overcome them. To assist data analytics in the Internet of Things, Xu et al. [86] proposed the Sapphire smart-contract-based storage system to regulate access to massive data sets.

•
Artificial intelligence Smart contracts may be enhanced in several ways by using artificial intelligence (AI). Smart contracts can be validated using certain forms of AI, while other forms of AI can be included in the contracts themselves [44]. In addition, Tensor and other deep learning principles are finding new uses in blockchain-based smart contracts. In the research by Sun and Gu [87], a technique for identifying blockchain-based smart contracts' vulnerabilities is proposed. The machine learning method with great performance and speed enables speedy detection. As long as the model's threshold is adjusted, it may function as a quick prefilter for conventional symbolic analysis techniques to increase accuracy even further. Another branch of AI, cognitive computing, attempts to recreate the mental processes of humans in a digital environment. When it comes to optimizing the performance of blockchain-based smart contracts, AI's role as a utility service is crucial. The application of AI for smart contract verification was introduced by Marwala et al. [88]. They highlighted the significant ways in which AI may be used in the setting of blockchain-based smart contracts, such as enhancing security, scalability, etc. They also emphasized how formal verification based on AI may be used to judge smart contracts.
Cognitive computing is a cutting-edge area of AI study that implements human-like thought processes into the digital sphere. When compared to traditional AI methods, cognitive computing's superior accuracy is a direct result of its incorporation of human cognitive processes and execution constraints. The service values in many cognitive computing use cases will be enhanced by blockchain-based smart contracts. From the standpoint of cognitive computing, the most important aspects of blockchain-based smart contracts are their data openness, decentralized access control capacity, and decentralized trust. The potential for cognitive computing in the medical field was the subject of a survey by Daniel et al. [89]. They stressed the need of adhering to regulatory standards while using blockchain technology in healthcare.
In sync with the decentralization potential of the blockchain, federated learning is a distributed and collaborative method of education [90]. In a federated learning setup, the raw data are not uploaded and used as training datasets. Data access management and federated learning are only two of the many uses for blockchain technology, which may also be used for other types of sensitive data that are widely dispersed, such as healthcare data. Smart contracts and federated learning provide a unique opportunity for academic inquiry. An industrial Internet of Things privacy preservation strategy based on blockchain technology and federated learning was presented by Lu et al. [91]. To reduce time spent processing data and maximize the use of available computer power, the authors included federated learning in the consensus. Data privacy needs are highlighted, and unresolved concerns related to the limited computer infrastructure are examined.

•
Game theory To analyze the dynamics between players, game theorists use several mathematical methods. Game theory and smart contracts are two areas where researchers are beginning to dig deeper. The usefulness of smart contracts extends to a wide variety of contexts. The game theory of integrated smart contract casinos was studied by Piasecki [92]. The author investigated the possibility that a well-off attacker may exploit the system by buying more computing resources. To protect the Proof-of-Work blockchain from this specific kind of assault, the author offered several suggestions.

Conclusions
The decentralization, auto-enforcing ability, and verifiability characteristics of smart contracts enable their encoded business rules to be executed in a peer-to-peer network, where each node is "equal" and none has any special authority without the involvement of a trusted authority or a central server. Thus, smart contracts are expected to revolutionize many traditional industries, such as finance, healthcare, energy, etc. Not only are they commonplace in business and commerce, but they also play an important role in many other spheres of human interaction. This insight led us to conduct a thorough evaluation of blockchain-based smart contracts published between 2012 and 2022. The purpose of this study is to analyze the current state of smart contracts in the blockchain, their applications, and the potentially revolutionary effects of their unique characteristics. Constraints and their ripple effects in other domains have been noted, as have the difficulties and omissions in the literature on the issue. There are a total of 252 publications in this area that were considered for this review. Smart contract technology is promising, but it is still in its infancy, so there are a lot of kinks to work out such as the lack of strong data processing capacity and effective smart contract management by mainstream blockchain systems, the absence of a sophisticated contract development language and effective vulnerability scanning and processing technique, the low maintainability, several potential security vulnerabilities of smart contracts, etc. Future developments in domains such as data science, AI, and game theory that can be integrated into smart contracts in blockchain systems have been considered and demonstrated.