<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Towards Model-Driven Smart Contract Systems -Code Generation and Improving Expressivity of Smart Contract Modeling</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Marek</forename><surname>Skotnica</surname></persName>
							<email>marek.skotnica@fit.cvut.cz</email>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Information Technology</orgName>
								<orgName type="institution">Czech Technical University</orgName>
								<address>
									<settlement>Prague</settlement>
									<country key="CZ">Czech Republic</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Jan</forename><surname>Klicpera</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Information Technology</orgName>
								<orgName type="institution">Czech Technical University</orgName>
								<address>
									<settlement>Prague</settlement>
									<country key="CZ">Czech Republic</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Robert</forename><surname>Pergl</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Information Technology</orgName>
								<orgName type="institution">Czech Technical University</orgName>
								<address>
									<settlement>Prague</settlement>
									<country key="CZ">Czech Republic</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Towards Model-Driven Smart Contract Systems -Code Generation and Improving Expressivity of Smart Contract Modeling</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">4F1D6F06CA9D20E9E5300081BA658DB7</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-19T17:52+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Process Modeling</term>
					<term>Blockchain</term>
					<term>Smart Contract</term>
					<term>DasContract</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Public blockchains are increasingly important in industries such as finance, supply-chain management, and governance. In the last two years, there has been increased usage of blockchain for decentralized finance (DeFi). The usage of DeFi mainly consists of cryptocurrency lending and providing liquidity for decentralized exchanges. However, the considerable volume of reports shows large financial losses during network congestion, increasing transaction prices, programming errors, and hacker attacks. One survey suggested that only 40% of people working with DeFi smart contracts understand their source code. To address the issues, this paper proposes a model-driven approach to create blockchain smart contracts based on a visual domain-specific language called DasContract. An improved design of the DasContract language is presented, and a code generation process into a blockchain smart contract is described. The proposed approach is demonstrated on a proofof-concept model of a decentralized mortgage process where the contract is designed, generated, and simulated in a blockchain environment.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>The blockchain smart contracts promise a revolution in many industries that so far resisted the digital revolution. They may play a significant role in finance, supply chain management, voting, and many other industries. However, the promises of the blockchain technology were not yet materialized. According to the Gartner, mainstream adoption is expected in 2030 <ref type="bibr">[15]</ref>.</p><p>The public blockchains' primary use is currently the decentralized finance (DeFi) that is used for decentralized exchanges and crypto loans. However, there are many problems DeFi is currently facing. The first one is network congestion, which increases the transaction processing time and price (that reaches up to 12 USD per transaction <ref type="bibr" target="#b37">[39]</ref>). Another issue is the smart contract programming errors. In one of the many incidents, an input error led to a token price plunging 25% <ref type="bibr" target="#b24">[26]</ref>. Furthermore, according to the CoinGeco survey <ref type="bibr" target="#b6">[7]</ref>, only 40% of the DeFi users can read and understand the smart contract's source code.</p><p>To address these challenges, a visual language for modeling smart contracts, DasContract, has been proposed in <ref type="bibr" target="#b33">[35]</ref>. It argues that by using a visual domainspecific language (DSL), the readability of smart contracts would be more comfortable, and using model-driven engineering (MDE) approach generates the smart contracts source code. However, a complete method to generate the source code was not provided, and the included case study was very elementary.</p><p>Therefore, this paper aims to bridge the gap and build on top of the preliminary research. First, the DSL initially provided by the DasContract paper <ref type="bibr" target="#b33">[35]</ref> was completely redesigned to support an automatic and blockchain implementation-independent code generation suitable for a limited execution environment provided by the blockchain technology. Second, a straightforward way to generate smart contract algorithms with non-fungible tokens was described together with an open-source implementation algorithm. Finally, to demonstrate the functionality of the proposed approach, a decentralized mortgage case study was created. A model of a mortgage process running in blockchain was modeled, Solidity smart contract was generated, and finally, a simulation of the functionality was performed.</p><p>The paper is organized as follows: In Section 2, the research method and the research question are formulated. In Section 3, the underlying scientific foundations are briefly discussed. An approach to generate blockchain smart contracts from a DasContract language is introduced in Section 4. The proposed approach is demonstrated on a Mortrage case study in Section 5. The related research is discussed in Section 6. Finally, in Section 7, the current results are summarized, and further research is proposed. The key aspects of a blockchain systems are: 1)Decentralization The data in a blockchain is distributed and managed by a cluster of computers, without any central authority. 2)Transparency All the data in a blockchain is completely visible to any computer in the blockchain.3) Immutability Once a data block is verified and added to the blockchain, it is not possible to edit or remove it.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Smart Contracts</head><p>A smart contract is a computer protocol that allows creating digital contracts between multiple parties without a need for a trusted third-party intermediary. Once deployed, the smart contract will automatically evaluate the commitments that may occur to the parties over time, based on the agreed terms <ref type="bibr" target="#b34">[36]</ref>.</p><p>Ethereum <ref type="bibr" target="#b12">[13,</ref><ref type="bibr" target="#b13">14]</ref> is a smart contract implementation used in this paper that is described as: "an open source, globally decentralized computing infrastructure that executes programs called smart contracts. It uses a blockchain to synchronize and store the system's state changes, along with a cryptocurrency called ether to meter and constrain execution resource costs." <ref type="bibr" target="#b2">[3]</ref> As further described in <ref type="bibr" target="#b2">[3]</ref>, the smart contracts are deployed onto the blockchain in the form of a specialized bytecode. This bytecode then runs on each Ethereum node in a limited execution environment, called Ethereum Virtual Machine (EVM). Since creating smart contracts directly in the bytecode would be too impractical, multiple specialized high-level languages have been created, together with the compilers needed to convert them into EVM bytecode. The most popular high-level language for creating EVM-based smart contracts is Solidity.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Cryptographic Tokens</head><p>As described by Voshmgir <ref type="bibr" target="#b36">[38]</ref>: "Cryptographic tokens represent programmable assets or access rights, managed by a smart contract and an underlying distributed ledger. They are accessible only by the person who has the private key for that address and can only be signed using this private key."</p><p>On the Ethereum platform, Ethereum Improvement Proposals (EIPs) <ref type="bibr" target="#b0">[1]</ref> are used to standardize the general structure of tokens. This ensures that the smart contracts running on Ethereum can interact with tokens defined by other smart contracts.</p><p>One of these standards is the ERC-20, providing a typical list of rules on how the tokens should be structured. These tokens are fungible, meaning that tokens of the same type are interchangeable. That makes them easy to trade, as there is no need to differentiate the tokens. To represent unique assets, however, the tokens must be non-fungible -every token is unique and non-interchangeable, even if they are of the same type. In order to facilitate these types of tokens, the ERC-721 standard was created. <ref type="bibr" target="#b36">[38]</ref> 3.4 BPMN BPMN is a standard notation for business process modeling under the Object Management Group (OMG) <ref type="bibr" target="#b25">[27]</ref>. There are three levels of BPMN modeling based on the goal. This paper uses the DasContract language that builds on BPMN level 3 to express machine-executable process models.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.5">Unified Modeling Language (UML)</head><p>Unified Modeling Language (UML) <ref type="bibr" target="#b30">[32]</ref> is a standardized modeling language enabling developers to specify, visualize, construct and document artifacts of a software system. <ref type="bibr" target="#b35">[37]</ref> In this paper, a UML Class diagram is used to describe a meta-model of a DasContract language and also to represent a DasContract data model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.6">DasContract</head><p>The DasContract was first introduced in <ref type="bibr" target="#b33">[35]</ref> and it builds on top of the existing knowledge about Business Process Management (BPM) <ref type="bibr" target="#b3">[4]</ref> and Enterprise Engineering discipline <ref type="bibr" target="#b7">[8]</ref>. DasContract provides a visual domain-specific language to describe blockchain smart contracts that is based on an extended combination of DEMO modeling language <ref type="bibr" target="#b7">[8]</ref>, BPMN <ref type="bibr" target="#b5">[6]</ref>, and UML <ref type="bibr" target="#b26">[28]</ref>.</p><p>The main goal of the DasContract is to provide a way to conclude digital contracts for people, companies, and governments without the need for an intermediary. The contract conditions are agreed on upfront and inserted into a blockchain smart contract that ensures the contract's immutability and execution according to the agreed conditions.</p><p>The proposed concept architecture of the DasContract is shown on Figure <ref type="figure" target="#fig_1">2</ref>. First, a contract between parties is formalized using the DasContract language and a legal text, then a smart contract is generated, and finally, the people, companies, and legal authorities interact according to the smart contract logic.</p><p>However, the original paper does not provide a straightforward method for translating the DEMO model to the executable BPMN and does not provide code generation algorithms. This leaves a gap that this paper aims to fill by introducing a new DSL language (shown in Figure <ref type="figure" target="#fig_2">3</ref>) and describes how the smart contract code should be generated.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Towards Generating Smart Contracts from DasContract Language</head><p>This section introduces a way to generate blockchain smart contracts using a Model-Driven Engineering approach (MDE) <ref type="bibr" target="#b4">[5]</ref>. To achieve this, a complete redesign of the original DasContract metamodel <ref type="bibr" target="#b33">[35]</ref> was done, and a way of automatically generating blockchain smart contracts is described. Ethereum Solidity language is used as a demonstration; however, the principles described should be transferable to other blockchain implementations.</p><p>The new DasContract DSL metamodel is shown on fig. <ref type="figure" target="#fig_2">3</ref>. The original Das-Contract metamodel was based on DEMO models. Although the execution of DEMO models is described in <ref type="bibr" target="#b32">[34]</ref> and the translation of DEMO to BPMN in <ref type="bibr" target="#b22">[24]</ref>, the approach creates models that contain all possible execution paths according to the DEMO transaction axiom. This is not desired in a blockchain smart contract because only the necessary execution paths should be modeled to prevent unwanted behavior. However, the DEMO models still should be produced before modeling the DasContract to achieve a better ontological understanding of the domain.</p><p>As a basis for the execution behavior, an extended subset of BPMN 2.0 level 3 is used. However, compared to the BPM systems that interpret the model, an approach that generates code with the model behavior is used. This approach is used due to blockchain performance and storage limitations. Each line of code executed in the blockchain costs money, and the storage costs are also at a premium.</p><p>The algorithm described in this paper is implemented in C# programming language and published on Github under an MIT license <ref type="bibr" target="#b31">[33]</ref>. The DasContract DSL consists of the following models: Data Model Specifies data structures used inside of the smart contract. These structures can be referenced inside of the process model. Process Model Specifies a contract's business process as an extended subset of the BPMN 2.0 language. Forms Model Specifies a user form required to fill by the user in a process user task. The forms provide a way to interact with smart contracts.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Data Model</head><p>The data model's implementation is straightforward because the blockchain smart contract languages provide generous native support to specify data structures. The supported concepts are entities, properties, entity properties, and arrays. Each property can also be marked as mandatory. The data types of properties are Int, UInt, Bool, String, DateTime, Address, AddressPayable, Data, Entity. The types Address and AddressPayable are blockchain specific and support cryptocurrency or token payments.</p><p>Example Let's have an entity Payment with four properties -two addresses identifying the sender and receiver, a numeric defining the amount sent and a boolean indicating whether the payment was on schedule. The generated code is shown in Listing 1.</p><p>struct Payment { uint256 amount; bool onSchedule; address sender; address receiver; } Listing 1. An example of a generated data structure.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Process Model</head><p>The process model uses an extended subset of the BPMN 2.0 level 3 notation. The formal specification of a BPMN execution is already well researched, and there are many different formalizations such as <ref type="bibr" target="#b8">[9,</ref><ref type="bibr" target="#b19">21]</ref>. In this paper, the algorithms are based on Petri-net based formalization described in <ref type="bibr" target="#b9">[10]</ref>.</p><p>The blockchain smart contracts are more similar to a programmable database rather than a desktop, web, or console application. Due to this fact, not all of the BPMN concepts can be implemented or make sense. Therefore only a limited subset is implemented: user task, script task, XOR gateway, parallel gateway, start event, and end event. The blockchain-specific activities were added: payment task. The payment task is a task attribute that can be added to both user and script task to add support to work with cryptocurrency or tokens.</p><p>Process Flow Exclusive gateways are converted into a sequence of if-else statements, advancing the execution based on the statement's result. Parallel gateways are more complex, as they can not only create multiple execution branches but are also used for synchronizing multiple flows (branches) into a single flow. If a gateway has multiple incoming flows, then a counter is defined, keeping track of the number of flows that have reached the gateway. The outgoing flows are triggered once the counter matches the number of incoming flows. An example can be seen in Listing 2, that contains the logic of parallel gateways generated based on Figure <ref type="figure">4</ref>. Activities Functions are also used to encapsulate the logic of activities. Unlike the internal gateway functions, these functions are publicly visible. User activities allow accepting parameters and store them inside of the contract using property binding logic. The generator also allows restricting access to function execution based on the executor's address. This is done using roles defined using square brackets inside the name of the activity (see Figure <ref type="figure">4</ref>). The addresses to each role are assigned at runtime, meaning that anyone can execute an activity with an unassigned role. The first execution assigns the role, reserving the remaining activities of the given role to that address. An example of a converted user activity can be seen in Listing 3, generated based on the Escrow Property Rights activity in Figure <ref type="figure">4</ref>. The generated function contains two modifiers, checking whether the contract is in the valid state and whether the executor (Property Owner role) is authorized. The function has one input parameter that has been defined using the editor. This parameter is then stored inside the contract according to the defined property binding logic. An address of the property owner is read from the msg.sender property that provides a sender's public address verified by his private key while sending the transaction to the blockchain.</p><p>Token Activities Described in Section 3.3, tokens play a significant role in the smart contract ecosystem by allowing to express ownership of an asset. By complying with the token standards, these tokens can also interact with other smart contracts. An activity that would allow us to create/send/receive tokens would significantly improve the generated smart contracts' capabilities. For example, it would allow sending voting ballots (in the form of a token) to the voters.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Forms Model</head><p>The forms model defines a form that is shown to a user and allows interaction with a contract. Such logic is implemented in two places called on-chain and off-chain.</p><p>On-chain code is run inside the blockchain. Our algorithm is represented as parameters that are passed into a function generated from a user task. An example is shown on Listing 3 -the method EscrowPropertyRights contains a parameter Agree that will be provided by the user while calling the method.</p><p>Off-chain code is run inside a cryptocurrency wallet to provide the user with comfortable user experience while interacting with a smart contract. However, the Ethereum Solidity does not support off-chain code, and therefore we leave this aspect for further research.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4">Design, Compilation and Execution</head><p>For the modeling of the new DasContract models, a new visual modeling environment was created. The visual modeling reduces the modeler's errors and reduces the time required to produce a model. The modeling environment is available on Github under an MIT license <ref type="bibr" target="#b10">[11]</ref>.</p><p>Compilation to the Solidity code assumes a valid DasContract model created in the modeling environment and does not check for other errors. The last check is done during the Solidity code compilation (usually in the Remix environment) and allows the modeler to fix issues in custom script tasks and user task validation logic.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.5">Limitations</head><p>There are the following limitations to this approach, and they should be addressed in future research. First, the script tasks and a validation logic of user tasks still need to be expressed in Solidity language. An implementationindependent DSL for such expressions should be added to the design of the language. Second, the language only contains support for receiving tokens. Support to issue both fungible and non-fungible tokens would be required. Third, it is not clear how would people authenticate themselves and prove their roles outside of the standard smart contract wallet. A way to support decentralized identity standards such as W3C DID should be explored. Finally, according to Gartner [15], the public blockchains are still immature for mass adoption mostly because of low transaction processing capability and high cost and, therefore, only minimal applications such as initial coin offerings, escrows, and decentralized finance are currently possible.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Case Study: Mortgage</head><p>This section provides a case study to demonstrate the capabilities of the approach proposed in the previous section. A case of a decentralized mortgage that supports non-fungible tokens (ERC-721) to represent the property ownership was created. This case study designs the process in a decentralized way that means that the property token is held in the smart contract as collateral. A scenario where the lenders can request a default of the loan is modeled. The complete DasContract model and the generated source code are published on Github under an MIT license <ref type="bibr" target="#b31">[33]</ref>.  The following steps were taken while conducting this case study: 1) A Das-Contract model was created in a visual editor. 2) An Ethereum Solidity smart contract code was created by an algorithm described in Section 4. 3) A simulation of the generated smart contract was performed in the Remix <ref type="bibr" target="#b1">[2]</ref> test environment.</p><p>The process model of the proposed process can be seen in Figure <ref type="figure" target="#fig_4">5</ref>. The process begins with a borrower applying for a mortgage. Three other parties -insurer, property owner, lender -must then confirm their involvement by carrying out their specific action. If any of them declines, or the borrower changes their mind, then the contract is deemed invalid, and any escrows that have been already transferred will be released back to their previous holders.</p><p>When all parties agree and the contract is successfully validated, then the full payment to the owner is automatically released, also ending their involvement in the contract. In the next phase of the contract, the borrower is tasked to carry out to periodically pay the mortgage fees. Those fees are then automatically distributed to the insurer and lender. The payment schedule is checked afterward, resulting in three possible scenarios. First, the payment is on schedule; the contracts state will return to "waiting" for another payment. Second, The payments are behind schedule; in this case, the insurer checks the indemnity terms, paying for the borrower if they are met. Third, the payments are finished, in which case the property is automatically transferred to the borrower, ending the contract.</p><p>Before the payments are fully finished, the lender is also at any time allowed to request for borrower's default to check whether the borrower has not violated terms. If the terms have indeed been violated, then the lender will pay proportion money defined in the terms to the borrower. The property will then be transferred to the lender, ending the contract.</p><p>The described process was simulated using the Remix IDE. The test environment allows to perform transactions from various addresses, enabling to simulate people interacting with the smart contract. The transaction was successfully run by the borrower (left sidebar), returning status information about the transaction (right window).</p><p>The limitations of the case study are the following. First, the mortgage is paid in a cryptocurrency, which is a very volatile asset. This can be addressed using a stablecoins <ref type="bibr" target="#b21">[23]</ref>. The second issue is that the case requires a cadastre of properties being represented by a non-fungible token that is recognized in a country's legal context. This can be addressed by a legal binding of the token to property and mapping to a real cadastre record using a blockchain oracle solution such as <ref type="bibr" target="#b11">[12]</ref>. Third, the insurer is represented by a human oracle and is not enforced by a code to pay. Therefore, the terms of insurance would be needed to sign in a separate legal contract. This is already a part of the DasContract architecture described at Figure <ref type="figure" target="#fig_1">2</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Related Research</head><p>A very similar research is done by the Caterpillar project <ref type="bibr" target="#b28">[30,</ref><ref type="bibr" target="#b29">31]</ref> that is creating a BPM engine in the Solidity language. The main difference between the approaches is that the DasContract generates the logic of the model into the smart contract where the Caterpillar interprets it. The goal of the DasContract is to provide a decentralized way to conduct contracts between people, compa-nies, and governments in a blockchain implementation independent way. The Caterpillar is currently bound to the Solidity programming language.</p><p>Other approaches provide a graphic environment to visually compose smart contract code based on Blockly <ref type="bibr" target="#b15">[17]</ref> such as <ref type="bibr" target="#b14">[16]</ref>. There is also another approach that proposes a domain specific language for definition of financial smart contracts called Marlowe <ref type="bibr" target="#b20">[22]</ref>. The approach presented in this paper does not represent the script part in the visual format; it instead focuses on modeling data, processes, and forms that is not supported by Blockly-based approaches.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Conclusions</head><p>The paper introduced an approach to creating a model-driven blockchain smart contracts. The potential benefits are: 1) An increase readability of the blockchain smart contracts by providing a visual DSL that allows contract simulation. 2)The simulation also contributes to eliminating smart contract errors as the behavior can be examined before publishing the contract. 3)The expressivity was improved by a complete redesign of the DasContract DSL and providing the capability to support non-fungible tokens. To demonstrate the proposed approach's functionality, a decentralized mortgage case study was presented in Section 5. The mortgage case was modeled; a Solidity code was generated and simulated in the Remix environment.</p><p>The major limitation of this approach remains the immaturity of available blockchain implementations. According to the Gartner [15], the blockchain technology is very immature to support most of the potential use cases, and there is still a tremendous amount of research, implementation, and adoption to be done.</p><p>Further research is following: 1) Support for generation of smart contracts on different platforms. 2) Case studies and usability studies to improve the proposed language design. 3) Explore a possible extension with more BPMN symbols and concepts. 4) Explore a possible extension of the proposed model by DMN <ref type="bibr" target="#b27">[29]</ref> OMG standard. 5) Propose a method to devise DasContract models from DEMO. 6) Propose a case study of a smart contract in financial domain aligned with CC-CP ontology <ref type="bibr" target="#b18">[20]</ref>.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 1 .</head><label>1</label><figDesc>Fig.1. Design Science Research Cycles<ref type="bibr" target="#b16">[18]</ref> </figDesc><graphic coords="3,150.52,95.91,311.24,135.88" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Fig. 2 .</head><label>2</label><figDesc>Fig.2. A proposed concept architecture of DasContract<ref type="bibr" target="#b33">[35]</ref>.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 3 .</head><label>3</label><figDesc>Fig. 3. A new DasContract DSL metamodel</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Fig. 4 .Listing 2 .</head><label>42</label><figDesc>Fig. 4. A contract snippet used to demonstrate a gateway conversion in Listing 2 and user task conversion in Listing 3</figDesc><graphic coords="8,202.39,95.91,207.50,173.97" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Fig. 5 .</head><label>5</label><figDesc>Fig. 5. Mortgage Process Model</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>User task logic generated based on the model snippet in Figure4.</figDesc><table><row><cell>modifier isEscrowPropertyRightsAuthorized{</cell></row><row><cell>if(addressMapping["Property Owner"] == address(0x0)){</cell></row><row><cell>addressMapping["Property Owner"] = msg.sender;</cell></row><row><cell>}</cell></row><row><cell>require(msg.sender==addressMapping["Property Owner"]);</cell></row><row><cell>_;</cell></row><row><cell>}</cell></row><row><cell>modifier isEscrowPropertyRightsState{</cell></row><row><cell>require(isStateActive("EscrowPropertyRights")==true);</cell></row><row><cell>_;</cell></row><row><cell>}</cell></row><row><cell>function EscrowPropertyRights(bool Agree) isEscrowPropertyRightsState</cell></row><row><cell>isEscrowPropertyRightsAuthorized public {</cell></row><row><cell>ActiveStates["EscrowPropertyRights"] = false;</cell></row><row><cell>escrowagreement.agreeToEscrow = Agree;</cell></row><row><cell>ActiveStates["EscrowProperty"] = true;</cell></row><row><cell>EscrowProperty();</cell></row><row><cell>}</cell></row><row><cell>Listing 3.</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0">Copyright © 2020 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Acknowledgement This research has been supported by CTU SGS grant No. SGS20/209/OHK3/3T/18</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<ptr target="https://eips.ethereum.org/" />
		<title level="m">Ethereum improvement proposals</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<ptr target="https://ethereum.org/en/foundation/" />
		<title level="m">Remix -ethereum</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<author>
			<persName><forename type="first">A</forename><surname>Antonopoulos</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Wood</surname></persName>
		</author>
		<ptr target="https://github.com/ethereumbook/ethereumbook/blob/develop/book.asciidoc" />
		<title level="m">Mastering Ethereum: Building Smart Contracts and DApps</title>
				<imprint>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<ptr target="http://bpm.com/what-is-bpm" />
		<title level="m">BPM: What is BPM</title>
				<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<title level="m" type="main">Model-Driven Software Engineering in Practice: Second Edition</title>
		<author>
			<persName><forename type="first">M</forename><surname>Brambilla</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Cabot</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Wimmer</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2017">2017</date>
			<publisher>Morgan &amp; Claypool Publishers</publisher>
		</imprint>
	</monogr>
	<note>2nd edn.</note>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<ptr target="https://camunda.com/bpmn/reference/" />
		<title level="m">Bpmn 2.0 symbol reference</title>
				<imprint/>
	</monogr>
	<note>CAMUNDA</note>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<author>
			<persName><surname>Coingeco</surname></persName>
		</author>
		<ptr target="https://www.coingecko.com/buzz/yield-farming-survey-2020?locale=en" />
		<title level="m">Coingecko yield farming survey 2020</title>
				<imprint>
			<date type="published" when="2020-09-22">2020-09-22</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Enterprise Ontology: A Human-Centric Approach to Understanding the Essence of Organisation</title>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">L G</forename><surname>Dietz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><forename type="middle">B F</forename><surname>Mulder</surname></persName>
		</author>
		<ptr target="https://www.springer.com/gp/book/9783030388539" />
	</analytic>
	<monogr>
		<title level="m">The Enterprise Engineering Series</title>
				<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Bpmn 2.0 execution semantics formalized as graph rewrite rules</title>
		<author>
			<persName><forename type="first">R</forename><surname>Dijkman</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Van Gorp</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Business Process Modeling Notation</title>
				<editor>
			<persName><forename type="first">J</forename><surname>Mendling</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">M</forename><surname>Weidlich</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">M</forename><surname>Weske</surname></persName>
		</editor>
		<meeting><address><addrLine>Berlin Heidelberg; Berlin, Heidelberg</addrLine></address></meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2010">2010</date>
			<biblScope unit="page" from="16" to="30" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Formal semantics and analysis of bpmn process models using petri nets</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">M</forename><surname>Dijkman</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Dumas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Ouyang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Queensland University of Technology, Tech. Rep</title>
		<imprint>
			<biblScope unit="page" from="1" to="30" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<monogr>
		<author>
			<persName><forename type="first">M</forename><surname>Drozdík</surname></persName>
		</author>
		<ptr target="https://github.com/drozdik-m/das-contract-editor" />
		<title level="m">Dascontract editor github repository</title>
				<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<monogr>
		<author>
			<persName><forename type="first">S</forename><surname>Ellis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Juels</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Nazarov</surname></persName>
		</author>
		<ptr target="https://link.smartcontract.com/whitepaper" />
		<title level="m">Chainlink: A decentralized oracle network</title>
				<imprint>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<monogr>
		<ptr target="https://ethereum.org/en/foundation/" />
		<title level="m">About the ethereum foundation</title>
				<imprint/>
	</monogr>
	<note>Ethereum Foundation</note>
</biblStruct>

<biblStruct xml:id="b13">
	<monogr>
		<ptr target="https://www.gartner.com/smarterwithgartner/the-reality-of-blockchain/" />
		<title level="m">Ethereum whitepaper</title>
				<imprint>
			<date type="published" when="2019-01-29">2019-01-29</date>
		</imprint>
		<respStmt>
			<orgName>Ethereum Foundation</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<monogr>
		<ptr target="https://github.com/promethe42/blockly-solidity" />
		<title level="m">Solidity for blockly</title>
				<imprint>
			<date type="published" when="2020-08-10">2020-08-10</date>
		</imprint>
	</monogr>
	<note>Github</note>
</biblStruct>

<biblStruct xml:id="b15">
	<monogr>
		<ptr target="https://developers.google.com/blockly/" />
		<title level="m">Blockly</title>
				<imprint>
			<date type="published" when="2020-08-10">2020-08-10</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">A Three Cycle View of Design Science Research</title>
		<author>
			<persName><forename type="first">A</forename><surname>Hevner</surname></persName>
		</author>
		<ptr target="http://aisel.aisnet.org/sjis/vol19/iss2/4" />
	</analytic>
	<monogr>
		<title level="j">Scandinavian Journal of Information Systems</title>
		<imprint>
			<biblScope unit="volume">19</biblScope>
			<biblScope unit="issue">2</biblScope>
			<date type="published" when="2007-01">Jan 2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">Design Science in Information Systems Research</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">R</forename><surname>Hevner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">T</forename><surname>March</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Park</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Ram</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">MIS Q</title>
		<imprint>
			<biblScope unit="volume">28</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="75" to="105" />
			<date type="published" when="2004-03">Mar 2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<monogr>
		<title level="m" type="main">A Generic DEMO Model for Co-creation and Co-production as a Basis for a Truthful and Appropriate REA Model Representation</title>
		<author>
			<persName><forename type="first">F</forename><surname>Huňka</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Kervel</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2019-08">08. 2019</date>
			<biblScope unit="page" from="203" to="218" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">A precise execution semantics for bpmn</title>
		<author>
			<persName><forename type="first">V</forename><forename type="middle">S</forename><surname>Lam</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IAENG International Journal of Computer Science</title>
		<imprint>
			<biblScope unit="volume">39</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="20" to="33" />
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<monogr>
		<author>
			<persName><forename type="first">Lamela</forename><surname>Seijas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Thompson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename></persName>
		</author>
		<title level="m">Marlowe: Financial Contracts on Blockchain: 8th International Symposium, ISoLA 2018</title>
				<meeting><address><addrLine>Limassol, Cyprus</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2018-11-09">November 5-9, 2018. 11. 2018</date>
			<biblScope unit="page" from="356" to="375" />
		</imprint>
	</monogr>
	<note>Proceedings, Part IV</note>
</biblStruct>

<biblStruct xml:id="b21">
	<analytic>
		<title level="a" type="main">What is stablecoin?: A survey on price stabilization mechanisms for decentralized payment systems</title>
		<author>
			<persName><forename type="first">M</forename><surname>Mita</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Ito</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Ohsawa</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Tanaka</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">8th International Congress on Advanced Applied Informatics (IIAI-AAI)</title>
				<imprint>
			<publisher>IEEE</publisher>
			<date type="published" when="2019">2019. 2019</date>
			<biblScope unit="page" from="60" to="66" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b22">
	<analytic>
		<title level="a" type="main">Converting DEMO PSI Transaction Pattern into BPMN: A Complete Method</title>
		<author>
			<persName><forename type="first">O</forename><surname>Mráz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Náplava</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Pergl</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Skotnica</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-319-57955-9_7</idno>
		<ptr target="http://dx.doi.org/10.1007/978-3-319-57955-9_7" />
	</analytic>
	<monogr>
		<title level="m">Advances in Enterprise Engineering XI: 7th Enterprise Engineering Working Conference, EEWC 2017</title>
				<editor>
			<persName><forename type="first">D</forename><surname>Aveiro</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Pergl</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">G</forename><surname>Guizzardi</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><forename type="middle">P</forename><surname>Almeida</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Magalhães</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">H</forename><surname>Lekkerkerk</surname></persName>
		</editor>
		<meeting><address><addrLine>Antwerp, Belgium; Cham</addrLine></address></meeting>
		<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2017">May 8-12, 2017. 2017</date>
			<biblScope unit="page" from="85" to="98" />
		</imprint>
	</monogr>
	<note>Proceedings</note>
</biblStruct>

<biblStruct xml:id="b23">
	<monogr>
		<author>
			<persName><forename type="first">S</forename><surname>Nakamoto</surname></persName>
		</author>
		<ptr target="https://bitcoin.org/bitcoin.pdf" />
		<title level="m">Bitcoin: A peer-to-peer electronic cash system</title>
				<imprint>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b24">
	<monogr>
		<author>
			<persName><forename type="first">B</forename><surname>News</surname></persName>
		</author>
		<ptr target="https://blockchain.news/news/defi-smart-contract-risks-cream-finance-input-error-token-plunge" />
		<title level="m">Defi&apos;s smart contract risks: Cream finance&apos;s input error led to cream token plunging 25%</title>
				<imprint>
			<date type="published" when="2020-09-22">2020-09-22</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b25">
	<monogr>
		<ptr target="http://www.omg.org/spec/BPMN/2.0" />
		<title level="m">OMG: Business Process Model and Notation (BPMN)</title>
				<imprint>
			<date type="published" when="2011-01">Jan 2011</date>
			<biblScope unit="volume">2</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b26">
	<monogr>
		<ptr target="http://www.omg.org/spec/UML/2.5" />
		<title level="m">OMG: Unified Modeling Language, version 2</title>
				<imprint>
			<date type="published" when="2015-03">Mar 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b27">
	<monogr>
		<ptr target="https://www.omg.org/spec/DMN/1.2/" />
		<title level="m">OMG: Decision Model and Notation (DMN)</title>
				<imprint>
			<date type="published" when="2019-01">Jan 2019</date>
			<biblScope unit="volume">1</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b28">
	<monogr>
		<title level="m" type="main">Caterpillar: A Blockchain-Based Business Process Management System</title>
		<author>
			<persName><forename type="first">O</forename><surname>Pintado</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b29">
	<monogr>
		<author>
			<persName><forename type="first">O</forename><surname>Pintado</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>García-Bañuelos</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Dumas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Weber</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Ponomarev</surname></persName>
		</author>
		<title level="m">CATER-PILLAR: A Business Process Execution Engine on the Ethereum Blockchain</title>
				<imprint>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b30">
	<monogr>
		<title level="m" type="main">Unified Modeling Language Reference Manual, The</title>
		<author>
			<persName><forename type="first">J</forename><surname>Rumbaugh</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Jacobson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Booch</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2004">2004</date>
			<publisher>Pearson Higher Education</publisher>
		</imprint>
	</monogr>
	<note>2nd Edition</note>
</biblStruct>

<biblStruct xml:id="b31">
	<monogr>
		<title level="m" type="main">Dascontract 1.0 github repository</title>
		<author>
			<persName><forename type="first">M</forename><surname>Skotnica</surname></persName>
		</author>
		<ptr target="https://github.com/CCMiResearch/DasContract/tree/v1.0" />
		<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b32">
	<analytic>
		<title level="a" type="main">A DEMO Machine -A Formal Foundation for Execution of DEMO Models</title>
		<author>
			<persName><forename type="first">M</forename><surname>Skotnica</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">J H</forename><surname>Van Kervel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Pergl</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Advances in Enterprise Engineering XI</title>
				<editor>
			<persName><forename type="first">D</forename><surname>Aveiro</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Pergl</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">G</forename><surname>Guizzardi</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><forename type="middle">P</forename><surname>Almeida</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">R</forename><surname>Magalhaes</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">H</forename><surname>Lekkerkerk</surname></persName>
		</editor>
		<meeting><address><addrLine>Cham</addrLine></address></meeting>
		<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2017">2017</date>
			<biblScope unit="page" from="18" to="32" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b33">
	<analytic>
		<title level="a" type="main">Das contract -a visual domain specific language for modeling blockchain smart contracts</title>
		<author>
			<persName><forename type="first">M</forename><surname>Skotnica</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Pergl</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Advances in Enterprise Engineering XIII</title>
				<editor>
			<persName><forename type="first">D</forename><surname>Aveiro</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">G</forename><surname>Guizzardi</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><surname>Borbinha</surname></persName>
		</editor>
		<meeting><address><addrLine>Cham</addrLine></address></meeting>
		<imprint>
			<publisher>Springer International Publishing</publisher>
			<date type="published" when="2020">2020</date>
			<biblScope unit="page" from="149" to="166" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b34">
	<monogr>
		<author>
			<persName><forename type="first">N</forename><surname>Szabo</surname></persName>
		</author>
		<ptr target="https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html" />
		<title level="m">Smart contracts</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b35">
	<monogr>
		<ptr target="https://www.techopedia.com/definition/3243/unified-modeling-language-uml" />
		<title level="m">Techopedia: Definition -what does unified modeling language (uml) mean?</title>
				<imprint>
			<date type="published" when="2019-01-29">2019-01-29</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b36">
	<monogr>
		<author>
			<persName><forename type="first">S</forename><surname>Voshmgir</surname></persName>
		</author>
		<title level="m">Token Economy: How Blockchains and Smart Contracts Revolutionize the Economy</title>
				<imprint>
			<publisher>Shermin Voshmgir</publisher>
			<date type="published" when="2019">2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b37">
	<monogr>
		<ptr target="https://ycharts.com/indicators/ethereum_average_transaction_fee" />
		<title level="m">Ethereum average transaction fee</title>
				<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
	<note>YChart</note>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
