# Smart Contract Design Pattern for Processing Logically Coherent Transaction Types
## 2 Related Work
Logistics, in particular supply chain management, is also a constantly developed area of application (Natanelov et al. [27]). Interesting research works can be expected in the area of smart contract unification. There is a place for research on both domain-specific and domain-independent design patterns. Anyway, the first papers on these issues have already been published. Wohrer et al. [28] show how to move from domain-specific language to smart contract code. On the other hand, Capocasale et al. [29] discuss the issue of standardization of smart contracts in a broader context, independent of the field of application. Various formal verification methods are used in efforts to improve smart contracts. Concerning recent work in this area, Nam et al. [30] propose to analyze Solidity smart contracts using Alternating-time Temporal Logic model checking, whereas Almakhour et al. [31] deal with formal verification of composite smart contracts that require other smart contracts to be executed. They employ the finite state machine models to verify Solidity smart contracts. In contrast, Pasqua et al. [32] introduce the method that analyzes Ethereum bytecode and extract precise Control-Flow Graphs. From the point of view of software engineering, it is important to be able to reuse already written source code. In this regard, Pierro et al. [33] propose to organize a repository of Ethereum smart contracts. Smart contract source code reuse is also discussed by Chen et al. [34]. Their research reveals that about 26% of smart contract source code blocks are reused in 146,452 analyzed open-source Ethereum projects, whereas Khan et al. [35] introduce the topic of source code cloning of Ethereum smart contracts. In this aspect, Gorski [11] presents a design pattern that enables the reuse of validation rules used in a smart contract. The usage of classes to define verification rules enables the reuse of rules within the same contract and between different contracts. It should be also emphasized that the self-adaptation characteristic is not sufficiently researched in the context of smart contracts. However, scientific work is emerging in this area. Singh et al. [36] propose a self-adaptive security approach for smart contracts based on Service Level Agreements to provide countermeasures to attacks. Looking even more broadly from the point of view of software architecture, smart contracts are considered an important type of IT system function. The \(1+5\) architectural view model for cooperating systems proposed by Gorski in 2012 already included the _Contracts_ view [37]. However, it was only at the EUROCAST conference in February 2019 that the same author presented the context of using the _Contracts_ view for smart contracts [38; 39]. In this model, the key is to obtain business justification for the functions considered in the IT system. The business process is modeled in the _Integrated Processes_ view. A similar aspect was underlined at the OTM Conferences in October 2019 by Bagozi et al. [40]. They showed the design of smart contracts identified from business process models of collaborating organizations. In their work, they also used a two-level model of smart contract design: abstract and concrete. This confirms the validity of the adopted architecture for the _AdapT_ pattern. The currently proposed _AdapT_ v2.0 design pattern takes source code reuse to an even higher level. Validation rule objects are shared at runtime. Thanks to this, their redundancy was eliminated. In consequence, the efficiency of memory usage has been raised. The pattern is also now adapted to support any number of transaction types. As a result, the pattern has also been made more flexible as far as self-adaptation is concerned.