# Detection and Analysis of Ethereum Energy Smart Contracts
## 3 Related Work  
Smart contracts, unlike conventional contracts, are not written in natural language, making it difficult to determine their context. When compared to conventional programming languages, such as C and Java, uniform understanding of Ethereum smart contracts is relatively limited. Nonetheless, there have been a few attempts at classifying Ethereum smart contracts prior to this research. However, smart contract classification described in the existing works is not necessarily consistent with [PERSON]'s initial classification of  
Figure 1: The smart contracting paradigm for energy applications  
three tiers of financial, semi-financial, and non-financial applications [24]. For instance, [PERSON] et al. [25] applied NLP on bytecode to classify contracts as governance, finance, gaming, wallet, and social, although wallets are a subset of financial applications, according to [PERSON]'s early classification. Using LSTM, [PERSON] et al. [11] classified Ethereum smart contracts by identifying six behavior patterns analysing transactions including game, gambling, exchange, finance, high-risk, and social transactions. Later, [PERSON] et al. [9] developed a smart contract classification strategy based on Bi-LSTM and Gaussian latent Dirichlet allocation (LDA) to classify contracts as entertainment, management, lottery and tools, finance, IoT, and others.  
According to our experience, there is no consistent set of smart contract specifications in published research work, and smart contracts associated with comparable practices are often classified differently. The proposed study extracts domain models with the intended goal of deriving business logic from current Ethereum-based Dapps aiming at transactive energy systems. Complete formal characterizations of a program's intended behavior are rarely available; thus, it is imperative to describe smart contracts from a domain-specific standpoint. Furthermore, addressing prevalent smart contract vulnerabilities mandates a semantic and synthetic understanding of the compromised contract.  
Although the transparent execution of smart contracts has enhanced the readability of blockchain-enabled systems, the characteristics of distributed ledgers make it extremely challenging to revoke vulnerable smart contracts once they are deployed. As a result, massive financial losses caused by smart contract security breaches in former intrusions have compromised the ecological stability of the contract layer in widely adopted blockchain platforms such as Ethereum. Hence, a growing concern in blockchain security is the detection of smart contract vulnerabilities [26; 27]. Scalability and new security vulnerabilities will emerge as the scale of the Ethereum projects advances over time. Novel vulnerability detection algorithms should detect and assess novel security threats and determine how to mitigate them. Accordingly, the search for vulnerabilities can be optimized by factoring intriguing elements such as the semantics of the defects. In fact, contract classification based on the application domain and transaction context offers greater insight into the syntactic and semantic properties of a given class of contracts. This can be further used for the design and implementation of customized vulnerability and fault detection mechanisms for a specific domain, including transactive energy systems [28]. Consequently, it is important to design and employ smart contract analysis tools to gain a broader knowledge of contracts concerning their underlying domains [29]. This will help to establish the groundwork for the development of domain-specific vulnerability detection algorithms for the detection and mitigation of unknown vulnerabilities and facilitates protecting vulnerable contracts' syntactic representation to the greatest extent possible.