Next Article in Journal
Investigation of the Tensile Properties of High-Strength Bolted Joints in Static Drill Rooted Nodular Piles
Next Article in Special Issue
D2D-Assisted Adaptive Federated Learning in Energy-Constrained Edge Computing
Previous Article in Journal
Research on Tree Flash Fault Localization of Hybrid Overhead–Underground Lines Based on Improved Double-Ended Traveling Wave Method
Previous Article in Special Issue
Toward Patient-Centric Healthcare Systems: Key Requirements and Framework for Personal Health Records Based on Blockchain Technology
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Improving Supply Chain Management Processes Using Smart Contracts in the Ethereum Network Written in Solidity

1
Computer Engineering Department, Faculty of Engineering and Natural Sciences, Kadir Has University, Cibali, İstanbul 34083, Türkiye
2
College of Engineering and Technology, American University of the Middle East, Egaila 54200, Kuwait
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Appl. Sci. 2024, 14(11), 4738; https://doi.org/10.3390/app14114738
Submission received: 20 October 2023 / Revised: 12 May 2024 / Accepted: 21 May 2024 / Published: 30 May 2024
(This article belongs to the Special Issue Blockchain and Intelligent Networking for Smart Applications)

Abstract

:
This paper investigates the potential of integrating supply chain management with blockchain technology, specifically by implementing smart contracts on the Ethereum network using Solidity. The paper explores supply chain management concepts, blockchain, distributed ledger technology, and smart contracts in the context of their integration into supply chains to increase traceability, transparency, and accountability with faster processing times. After investigating these technologies’ applications and potential use cases, a framework for smart contract implementation for supply chain management is constructed. Potential data models and functions of a smart contract implementation improving supply chain management processes are discussed. After constructing a framework, the effects of the proposed system on supply chain processes are explained. The proposed framework increases the reliability of the supply chain history due to the usage of DLT (distributed ledger technology). It utilizes smart contracts to increase the manageability and traceability of the supply chain. The proposed framework also eliminates the SPoF (Single Point of Failure) vulnerabilities and external alteration of the transactional data. However, due to the ever-changing and variable nature of the supply chains, the proposed architecture might not be a one-size-fits-all solution, and tailor-made solutions might be necessary for different supply chain management implementations.

1. Introduction

In the ever-changing and constantly evolving world of commerce and technology, supply chains have become more complex and now involve more variables and parties. Hence, supply chain management became a crucial aspect of all business operations, significantly influenced by digital advancements alongside traditional commodities and services. With the constant supply and demand increase, managing the pipeline and timely deliveries of goods and services to the receiving parties became tedious. Supply chains were a cog in the wheel once, but in today’s world, even small disruptions in this supply chain process become a threat [1] that affects both regional and global economies. In recent years, the COVID-19 pandemic and its effect on the global economy have consolidated the importance of the supply chain [2].
The objectives of this paper are to emphasize the importance of supply chains, their management and usage, and the technology behind blockchain and smart contract technologies, as well as the importance of their usage in the supply chain management processes. In this paper, the implementation of supply chain management using smart contracts on the Ethereum network written in the Solidity language is explored, and a foundation for using similar technologies in supply chain management processes is exemplified. This research will consist of information regarding blockchain technology, its advantages and limitations, what a smart contract is, and its real-life use case scenarios. Following information about blockchain and smart contracts, the paper will dive into supply chain management and its importance; after laying the foundation of these concepts, this paper will try to create a framework for optimally integrating smart contracts into existing supply chain processes alongside discussing other possible tech stacks that are not used in the implementation provided in this paper. This paper will aim to provide a comprehensive understanding of the underlying technologies and construct a direct implementation of a supply chain management architecture using smart contracts.
This paper explores the implementation of smart contracts in supply chains, offering theoretical insights regarding the technologies and methodologies used and their potential benefits and challenges. It highlights how smart contracts enhance efficiency, transparency, and risk management in supply chain operations by automating processes and ensuring compliance with predefined terms. The paper provides valuable guidance for industry practitioners and researchers seeking to leverage blockchain technology to optimize supply chain management processes and creates an exemplary framework for them.
The remainder of this paper is organized as follows. In Section 2, the fundamentals of blockchain technology are described, and the advantages and limitations of blockchain technology compared with other technologies are discussed. Afterward, the concepts of a contract and a digital trust, as well as the fundamentals of smart contracts, are explained. After explaining these concepts, the advantages and limitations of smart contracts are discussed, and then real-life implementations of smart contracts are examined and explicated in light of these concepts, in addition to the literature review and discussion of differences in the literature. In Section 3.2, possible technological stack options are analyzed and their advantages and disadvantages are discussed. In the following Section 3.3, the decision making behind the construction of smart contracts used in the system is discussed, and the functions themselves are explained along with a discussion of their workflow and validation in Section 4.

2. Literature Review and Exploration of Concepts

2.1. Literature Review and Technological Background

In this section, what a blockchain is and which concepts and technologies help blockchains to emerge are examined. The following questions will be answered thoroughly in the section: what is hashing, and how does the Hashcash algorithm work? What are distributed ledger technologies (DLTs)? What a blockchain is, how Proof of Work (PoW) works, what Ethereum is, and the advantages of using blockchain technology over its legacy counterparts, alongside its inherent limitations and those compared with legacy applications, will be discussed.
The notion of an immutable and tamper-proof chain of hashed blocks was initially proposed by Haber and Stornetta in 1991 [3]. Their pioneering work aimed at authenticating and timestamping digital documents, involving one-way hashing and timestamping by a pool of clients selected pseudo-randomly. This concept laid the foundation for chaining hash values to verify predecessor transactions. Furthermore, they introduced the idea of consensus mechanisms via distributed ledgers. Distributed ledgers are defined as databases of transactions or assets shared among participants, irrespective of their statuses [4] or geographical locations. This consensus mechanism mandates systems to reach a consensus, enhancing resilience against forgery due to the eventual consistency of these systems, even in the face of disruptive attempts to alter ledgers or disrupt networks.
A blockchain comprises blocks composed of hashes, data, and nonce values. Hashes result from hashing functions, which convert data into fixed-length strings. Initially, the Hashcash function, proposed by Adam Back in 1997 [5], played a pivotal role in generating these hashes. Hash functions are mathematical algorithms with critical properties, including determinism, efficiency, uniform distribution, and the avalanche effect [6]. They find applications in data structures, cryptography, and data verification, serving purposes such as efficient data storage and retrieval through hash tables and ensuring data integrity and authentication in digital signature schemes.
Ethereum, another blockchain implementation introduced in 2013 and deployed in 2015 by Vitalik Buterin, stands out as an innovative and disruptive technology. Ethereum prioritized smart contracts and Turing completeness over being merely a financial instrument. Smart contracts encode contract terms directly into the code and execute autonomously, eliminating the need for intermediaries and escrows. Ethereum’s native cryptocurrency, Ether (ETH), offers transactional value and fuel for smart contract execution. Ethereum initially relied on PoW for consensus, later transitioning to PoS [7].
DLTs, as illustrated in Figure 1, can be considered a type of distributed database management, spreading the database across multiple locations, parties, or devices, either with equal rights or in a master-slave management schema [8]. This approach mitigates single points of failure that result from centralized databases, which can be seen in Figure 2, and ensures the database remains desired. Ethereum’s impact on the blockchain ecosystem has inspired various alternative blockchain implementations and platforms, marking a significant shift in the blockchain landscape.
In the study titled “Making Drug Supply Chain Secure, Traceable and Efficient: a Blockchain and Smart Contract Based Implementation” [9], the complexities and vulnerabilities of the healthcare supply chain are addressed. The authors leverage Ethereum blockchain technology and smart contracts to propose a decentralized track-and-trace system. This approach aims to mitigate issues such as fraud, data inaccuracies, and transparency deficits that are prevalent in the healthcare supply chain. By employing smart contracts and hash functions, the system ensures data protection, automates agreement execution, and provides a balance between data protection and disclosure. When tested, the proposed methodology showcased its potential to enhance security, traceability, and efficiency in the supply chain, making it a significant contribution to blockchain applications in healthcare supply chain management.
In the realm of agricultural supply chain management, the paper titled “Agriculture Supply Chain Management Based on Blockchain Architecture and Smart Contracts” offers a perspective on the application of blockchain in the agricultural supply chain management domain. The authors emphasize the inherent challenges of the traditional agricultural supply chain, such as its lack of transparency, inefficiencies, and susceptibility to fraud. The paper introduces a blockchain-based solution to address these issues, leveraging the Ethereum platform. This decentralized approach ensures enhanced traceability, transparency, and security throughout the supply chain [10]. Furthermore, integrating smart contracts automates various processes, reducing manual interventions and potential errors. Such a system streamlines operations and fosters trust among stakeholders, from farmers to consumers.
Smart contracts, as electronic transaction protocols, are designed to digitally facilitate, verify, or enforce the negotiation and execution of the terms of underlying legal contracts. These contracts aim to fulfill perpetual conditions, such as payments, legal obligations, and enforcement, without the need for third-party intermediaries. By leveraging blockchain technology for distributed databases, smart contracts seek to reduce transaction costs, including arbitration and enforcement costs [11]. However, the potential of smart contracts extends beyond cost reductions for these transactions. They can facilitate the cross-organizational business processes characteristic of smart supply chains. A significant number of smart contract applications in the business realm are associated with supply chain management, the Internet of Things (IoT), and Industry 4.0 solutions. This paper, based on expert interviews, surveys, and case studies conducted in the context of EU projects focusing on the Baltic Sea Region, explores how smart contracting and blockchain technology can aid in the implementation of collaborative business structures for sustainable entrepreneurial activities within smart supply chains.
Another differentiating specification is that this approach stores all data related to the processes and transactions in the Ethereum Virtual Machine (EVM) via memory. All structs, mappings, arrays, and other primitive type definitions are stored in-chain with their values. These data include the participant information, product information, product health status in transit, product history, participant history, return history, and balance sheets. Four approaches can be taken in the data storage for smart contracts: you can entirely offload your data to external sources, you can use IPFS and hash for storing your data in a decentralized way outside of the chain, you can use a mixture of them via storing some data on-chain and some of them off-chain, or you can entirely store all your data on-chain. In this implementation, entirely-on-chain data storage is chosen both for fully utilizing the data protection aspects of blockchain, such as SHA-3 encryption, 100% up-time and hacking prevention due to the distributed network principles of it, and for providing a never-impaired transparency and traceability for the data stored in the chain. This approach of storing data on-chain costs more than other data storage options, but these cost increases can be mitigated via the utilization of local blockchain networks or using sibling networks of Ethereum that take much lower transaction fees [12] when we convert it to fiat money.
The framework applied in this study also implements a bidirectional flow to the supply chain management implementation for returning goods that are somehow faulty or not needed anymore. A return option is essential for a supply chain to have. Aside from return processes, this implementation also implements an extensive inventory tooling that enables participants to see their inventories with their history. End-users are able to trace their products and their health status from the manufacturing of the product all the way to themselves. This implementation also enhances its smart contracts processes with extensive authorization and flow-checking for enabling malicious participants in the network and eliminating the chance of misconduct or misuse with them.

2.2. Smart Contracts and Digital Trust

Contracts are fundamental binding agreements that govern interactions between parties, encompassing rights, duties, obligations, and costs. They can be verbal or written, often legally binding [13] and subject to oversight by legal entities, ensuring compliance with laws and human rights.
A typical contract includes the identifying parties and the contract’s purpose, terms and conditions, duration, and dispute resolution. Contracts are not limited to formal business agreements and encompass daily activities like following traffic rules, using public transit, or making purchases, effectively forming implicit contracts [13].
While contracts provide a structured framework for agreements and protect parties’ interests, they rely on mutual trust between the parties [13]. This inherent trust issue poses a challenge as contracts serve as frameworks, not guarantees, and parties may not always honor their commitments.
To address this trust issue, contracts can involve intermediaries or escrows. However, this approach introduces additional parties [14] and does not eliminate the need for underlying trust.
The concept of digital trust, often called trustless [15] or mathematical trust, embodies systems functioning without relying on trust between parties. Achieved through mathematical proofs or cryptography, digital trust minimizes reliance on intermediaries, enhancing security and reliability. Blockchain, as an example, empowers participants to control their assets and data, reducing the risks associated with third-party involvement [16,17].
Digital trust also enables the use of smart contracts, first conceptualized by Nick Szabo [18]. These contracts are self-executing, utilizing digital systems to enforce terms and conditions and minimizing exceptions and errors. Smart contracts operate without intermediaries, as parties can clearly comprehend the agreement’s terms and automatically fulfill [19] their obligations when predefined conditions are met.
In summary, contracts form the basis of binding agreements, covering various aspects of parties’ commitments. However, they require mutual trust, which can be challenging to ensure. Digital trust, or trustless trust, addresses this issue by allowing systems to function securely without relying on intermediaries. Smart contracts, a product of digital trust, automate and enforce agreements, reducing the need for third-party oversight and enhancing transaction reliability.

2.3. Supply Chains

A supply chain represents a complex network of organizations, individuals, activities, information, and resources involved in producing, handling, and distributing goods and services, from raw materials to end customers. It encompasses forward material/product flows and backward information flows, requiring coordination and collaboration among multiple entities [20], including suppliers, manufacturers, distributors, retailers, logistics providers, and customers.
The modern supply chain is marked by its intricacy, with numerous participants and evolving real-world conditions, leading to increased complexity [21] and reduced traceability. These challenges demand mutual trust among participants due to the extensive network size, as entities tend to maintain their individual ledgers rather than rely on a centralized ledger.
Efficient SCM fosters competitive advantages, offering cost savings, improved quality, and enhanced partner and customer satisfaction. It allows companies to differentiate themselves and remain competitive in global markets. Furthermore, SCM contributes to risk mitigation [22] and sustainability, identifying and managing potential risks, reducing their impact, and promoting eco-friendly practices [23].
Smart contracts and blockchain technologies offer significant advantages in SCM. Smart contracts, as automated self-executing agreements, streamline complex processes, reduce manual verification, enhance transparency, and eliminate the need for intermediaries like escrows. This automation reduces costs, improves operational efficiency [24], and allows for faster transaction completion.
Blockchain, complementing smart contracts, provides a transparent and immutable transaction record. Its transparency increases stakeholder trust and collaboration, minimizing fraud and human error. Multiple ledger copies enhance accountability and reduce dispute risks. Blockchain also offers decentralized traceability, making all participants’ status, location, and ownership of goods and services visible. For sensitive products, such as medicines or perishables, blockchain ensures the integrity of transaction data [25], ensuring the safety and quality of the transferred items.
Smart contracts and blockchain also facilitate regulatory compliance and adherence to industry standards like the Global Food Safety Initiative (GFSI). The automation provided by these technologies simplifies compliance efforts [26] and offers a deeper understanding of supply chain processes and potential issues, enabling better risk mitigation and efficient supply chain management.
The paper explores a novel paradigm in supply chain management by integrating the Internet of Things (IoT) with blockchain technology, specifically focusing on Ethereum. This system combines IoT-based Radio Frequency Identification (RFID) with blockchain to offer real-time product tracking and enhanced data security [27] across the supply chain. This innovative approach addresses challenges related to traceability and transparency in supply chains and has the potential to revolutionize supply chain operations by ensuring efficiency and security in a digitally interconnected ecosystem.
The concept of smart contracts, electronic transaction protocols that facilitate, verify, or enforce the terms of underlying legal contracts, is explored. These contracts aim to fulfill perpetual conditions without needing third-party intermediaries, reducing transaction costs. Smart contracts extend beyond cost reduction and find application in supply chain management, the Internet of Things (IoT), and Industry 4.0 solutions, streamlining cross-organizational processes [11] in smart supply chains.
Blockchain technology, with its properties of traceability, transparency, and trust, is transforming supply chain management. The paper introduces a collaborative resource-sharing framework [28] using blockchain and smart contracts. This framework addresses quality and data authenticity issues in supply networks, offering a solution for challenges related to outsourcing and production surpluses.
Furthermore, the framework presented in the paper implements smart contracts with unique features for supply chains. It includes a multi-layered participant schema, allowing flexibility for supply chain structures and enabling decentralized fund control for participants. Data related to processes and transactions are stored entirely on the Ethereum Virtual Machine (EVM), ensuring data protection, transparency, and traceability. The framework also incorporates bidirectional flow for returns and an extensive inventory tool, enhancing supply chain transparency, traceability, and security while preventing misconduct or misuse by participants [29].

3. Methodology and Implementation

3.1. Value Proposition and Improvements on Supply Chain Management Processes

Blockchain technology offers numerous transformative advantages for supply chain management (SCM), primarily due to its utilization of public key cryptography. This cryptographic method enhances security, identity verification, and electronic signatures within the network. Public key cryptography relies on mathematical functions, such as Elliptic Curve Cryptography, ensuring the security of user wallets and transactions. Additionally, it provides quantum resilience, making it highly secure. This cryptographic approach strengthens the security of funds and data managed by supply chain participants and guarantees the authenticity of electronic signatures.
Another critical aspect of blockchain technology is hash functions, which ensure data verification and validation. Each block in the blockchain contains a hash of the previous block, creating an immutable and tamper-proof transaction ledger, as can be seen in Figure 3. This feature eliminates the risk of data manipulation and fraud, making data stored on the blockchain highly secure and transparent.
Furthermore, blockchain systems are decentralized and distributed, eliminating single points of failure (SPOF) and enhancing security. Decentralization ensures that all participants verify transactions and a consensus mechanism is employed to determine the correct blockchain ledger. This replication and consensus mechanism results in a secure and tamper-resistant system, making it challenging for malicious actors to disrupt the network.
The transparency and traceability inherent in blockchain technology make it an ideal solution for supply chain management. All transactions in the blockchain are transparent and traceable, providing a clear history of goods and funds. This transparency enables stakeholders to track the status of products, ensuring accountability and trust among participants.
By eliminating their effectiveness, blockchain technology safeguards supply chain participants from common cyberattacks, such as ransomware and crypto-lockers. The decentralized nature of blockchain ensures that participants are not solely responsible for securing their data, making it difficult for attackers to target individual participants.
Moreover, blockchain transactions are known for their speed, typically taking seconds to minutes to complete. This quick transaction speed enables fast monetary transfers, even for international transactions. Additionally, the multi-cloud paradigm, or interoperability principle, enables applications to migrate between blockchains and communicate with other applications, increasing flexibility and removing infrastructure dependency. This interoperability is not only limited to technological interoperability; blockchain also enables multi-region complex applications and systems [31] to operate and exchange data seamlessly.
Smart contracts play a vital role in supply chain management by automating various processes, including payments, delivery updates, and product status control. These self-executing digital agreements eliminate the need for trust between parties, ensuring that each party fulfills its obligations when predefined contract conditions are met.
In summary, using blockchain technology and smart contracts in supply chain management offers many benefits, including enhanced security, transparency, traceability, and efficiency. These technologies revolutionize traditional supply chain processes and provide a robust foundation for secure and efficient operations.

3.2. Technological Stack Analysis

This section discusses the evolution of blockchain technology and its applications in supply chain management, focusing on smart contracts and their role in the proposed system architecture. Initially introduced by Satoshi Nakamoto in 2008 with Bitcoin, blockchain implementations have diversified over time, leading to variations in codebases, algorithms, and philosophical approaches. These changes have extended to the development of smart contracts, which automate processes in supply chain management.
The first blockchain implementations, including Bitcoin, prioritized creating secure and immutable transaction ledgers rather than enabling smart contracts. Initially, smart contract logic was implemented using “OP-CODES”, logical instructions embedded in the blockchain’s scripting system. These implementations were not Turing-complete, limiting their capabilities to increase network security.
Ethereum, introduced as a Turing-complete blockchain, revolutionized smart contract development by proposing the Ethereum Virtual Machine (EVM). EVM serves as a decentralized, deterministic, and sandboxed environment that executes and enables the usage of smart contracts. Ethereum’s adoption and EVM’s compatibility with other chains have made it a popular choice for smart contract implementation.
The proposed system architecture leverages Ethereum due to its Layer-1 blockchain status, interoperability with Layer-2 chains, and extensive adoption. Solidity, the native programming language for EVM, is chosen for smart contract development. The architecture incorporates Truffle Suite for managing smart contracts offering development, testing, debugging, and deployment tools. Ganache, part of the Truffle Suite, provides a local blockchain environment for cost-effective testing and development.
Oracles are crucial in the proposed system, bridging the gap between smart contracts and real-world data sources. Chainlink is selected as the oracle provider due to its decentralized and integrable nature. Oracles retrieve data such as temperature, product conditions, and transfer times, enhancing the smart contract’s decision-making capabilities.
The Ethereum blockchain is utilized for data storage, ensuring transparency, immutability, and tamper-proof data records. By using blockchain, the system minimizes the risk of data alteration and deception among participants.
The proposed system architecture is designed to manage the distribution of cold-chain critical medicines but is adaptable to various supply-chain applications. It provides a high-level view of the implementation, with defined parties, processes, rules, and restrictions to increase the system’s robustness. Well-defined rulesets for events and actions are recommended for event-driven and critical business applications, especially in the context of smart contracts’ irreversible transactions and tamper-proof nature.
Overall, the proposed architecture combines blockchain technology, smart contracts, oracles, and Ethereum to create a secure, transparent, and automated supply chain management system with the flexibility to adapt to different use cases.
Our proposed system defines the following rulesets and restrictions in it:
  • Only the manufacturer can add products to the supply chain.
  • Parties cannot change their roles in the supply chain environment.
  • One can only add a party to which they have a direct connection.
  • Parties can only see details of parties to which they have a direct connection.
  • Everyone can see the status of the transferred product.
  • A damaged product cannot move forward in the chain.
  • A product set for return cannot move forward in the chain
  • A product set for return should stop at its predefined return location.
  • A party with a product in its inventory cannot be removed from the chain.
  • Parties should pay predefined fees to their receiver.
  • Parties can only withdraw the amount in their wallets from the contract.
The proposed system architecture involves several participants in the supply chain, such as manufacturers, national vaccine storage facilities, provincial vaccine storage facilities, district vaccine storage facilities, hospitals, and patients. These are the main participants of our supply chain; between each main participant, a party that is responsible for transfer exists. These parties that handle transfers are called first conveyance, second conveyance, third conveyance, and fourth conveyance; there will be no transportation between hospital and patient since the application or last delivery of the medicines will be conducted at the hospital, and the patient is just a receiver in a hospital. As for the data storage, our application will be storing the following data related to parties participating in the supply chain alongside the product that is transferred: Party details stored with the PartyDetails struct can also be seen in Table 1.

3.3. Functions

In this section, we explain the decision making behind the construction of our smart contracts and try to describe functions used in these contracts and their jobs.
We have a separate function for each action that can be performed during the lifecycle of the supply chain. In this project’s codebase, we implement common programming best practices such as DRY (don’t repeat yourself), which represents reusing code blocks defined at functions as much as possible without writing new code blocks. ACID (atomicity consistency isolation and durability) represents transactions that are happening at the chain and have a binary status. They are either performed or not performed, and there will be no unfinished transactions at any stage of the workflow; each transaction is independent of the other at the flow of the system, so there will be no race condition or contradiction between their states; when a transaction is completed, its state will be recorded to the ledger, and it is not going to be corrupted by other states, or its states will not be lost. But, also, due to not creating any security vulnerabilities and exploitable logical fallacies in the code, we tried to isolate functions to their specific roles and make their logic as non-complex as possible.
To increase the manageability of our code base, we utilized the import feature of the Solidity language. The important feature of Solidity, which also exists in most modern programming languages, is the implementation of modular programming. The idea behind modular programming is to break the codebase into reusable components and then expose these components to other files or a handler file to manage their relationship. Modular programming helps developers organize codebase by grouping variables and functions that make sense to be together. For example, functions are variables that define or manipulate an entity or variables or functions that represent similar functions. By utilizing Solidity imports, we can create reusable pieces that other files can import, make it easier to understand and digest the project’s codebase, focus on individual parts, and debug a part of the codebase.
We have four modules in our main contract called Structs.sol, Parties.sol, Products.sol, and SuppylChain.sol. In Types.sol, we define the names and data types of the group of variables. These data models are mentioned above as structs.
In Products.sol, operations that involve products directly are handled. This contract inherits Struct.sol for product structure definitions and emits a product if it is newly added to the chain, or the ownership of a product is changed; this contract utilizes the following functions, and the functional diagram of Products.sol and its interactions with other contracts can be seen in Figure 4, while the UML diagram for the contract can be seen in Figure 5.
  • Public functions:
  • getPartyProductsInternal(): This function returns all the products registered in the inventory of the caller party; this function returns data in the product struct.
  • getSpecificProduct(): This function returns the details of the specified product and its lifecycle and timeline, such as transferred from whom to whom and when. This function takes productid as a parameter and returns productHistory.
  • setForReturn(): This function flags products that will be entered to return flow, takes productid as an argument, and sets product structs isReturning field to true for activating return flow.
  • addProductInternal(): This function adds a new product to the ledger, taking input data in the product struct as argument and currentTime as epoch timestamp.
  • transfer(): This function transfers the ownership of the product. It takes sender and receiver addresses, current time, and productid as parameters. It checks whether the product is using normal flow and not the return flow and if the product has any abnormality in its status. Then, it updates the product ownership and calls the transferOwnership function to complete the product transfer.
  • returnTransfer(): This function is doing the exact same condition checks and inherits exact logic with the transfer function, but it handles the return logic in the supply chain, so it only allows ownership change in the reverse flow.
  • transferFee(): This function transfers due to commission from one party to another.
  • Modifier functions:
  • productExists(): This function acts as a modifier to check if a product exists; this is an auxiliary function to help other functions with condition checks.
  • productNotExists(): This function acts as a modifier to check if a product does not exist; this is an auxiliary function to help add a product function for condition check.
  • Internal functions:
  • transferOwnership(): This function alters the state of the product ownership and removes the product from its owner once its ownership is passed to another party.
  • compareStrings(): Unfortunately, Solidity inherently does not include a function to compare strings, so we are using this function for string comparison; this function is a pure function, which means it does not alter any state in the chain.
In Parties.sol, functions necessary for party manipulation in the supply chain organization are located. This contract also utilizes Struct.sol for object model definitions and emits an event when a new party is added to the organization or a party is removed. The functional diagram of Parties.sol and its interactions with other contracts can be seen in Figure 6, and the UML diagram for the contract can be seen in Figure 7.
  • Internal functions:
  • addPartyPrimitive(): This function adds a party to the network. It is called by the addPartyPrimitive function, and when the contract is deployed, the contract creator is the manufacturer.
  • addPartyInternal(): After condition checks, this function adds a particular party to the contract caller’s party list. It is called the addPartyPrimitive function. It requires party details of the party to be created as a parameter. This function has condition checks for preventing organizations from adding themselves as to their party list or earlier in the flow, and organizations are only able to add their direct predecessor to the network.
  • getPartyList(): This function is strictly set as a view function; hence, it does not alter any state in the chain. It takes the contract caller’s address and retrieves the parties registered by the contract caller.
  • getPartyDetailsInternal(): An internal view function that does not alter any state in the chain and uses contract caller’s ID address as a parameter. Gets the party details of the contract callers and returns it.
  • getParty(): Wrapper utility function for getting details of the specific party; does not alter states and has internal and view decorators and return parties struct.
  • removePartyInternal(): Utility function for removing a party from the network; has internal decorators and checks whether the requested party is not the caller’s party struct, and the caller has the authorization to remove that user from the network; then, it emits an event that notifies network about the deletion of the party.
  • Modifier functions:
  • IsPartyExists(): This function checks whether the requested party exists in the network.
  • hasParty(): This function checks if a party already exists with the same role. It gets a role as a party role that needs to be checked and an account as an account address identifier that needs to be verified, then does condition checks on them to verify whether a party with that specific role exists and returns a boolean variable according to that.
  • OnlyManufacturer(): This function is for checking whether the contract caller has the role of the manufacturer or not. This function is used for limiting access to some features in the network, such as adding products.
As a main smart contract, Handler.sol can be countable as the main entry point. Handler.sol basically imports both products and parties’ smart contracts and prepares them for interactions with smart contracts. All of the functions in this contract are public functions since the main purpose of this function is to enable user interaction with the network. This function includes a constructor that defaults to the contract creator as the manufacturer on the contract deployment. The functional diagram of Handler.sol and its interactions with other contracts can be seen in Figure 8, and the UML diagram for the contract can be seen in Figure 9.
View functions: The following functions use a view modifier, which indicates that the function is only limited to read rights and has no means to alter the network.
Public functions:
  • contractBalance(): Returns the contract’s total balance. This function can only be invoked by the contract owner.
  • getAllProducts(): Function for retrieving all products. Returns product struct.
  • getPartyProducts(): Function for retrieving all the products linked to a particular party; invokes getPartyProductsInternal function from product contract and returns product struct.
  • getSingleProduct(): Function for retrieving a specific product; takes productId as a parameter and invokes getSpecificProduct function from product contract. Returns product history struct.
  • getPartyDetailsHandler(): Function for retrieving details of a party in the network; takes party address identifier as a parameter and invokes getPartyDetails function using address identifier parameter. Returns party details struct.
  • getPartyDetails(): Function for retrieving details of the contract caller’s party; takes no parameter and instead uses msg.sender as a parameter when calling getPartyDetails function. Returns party details struct.
  • getPartiesList(): Function for retrieving list of parties added by a specific party; takes no parameter and instead uses msg.sender as a parameter and invokes getMyPartyList function using address identifier parameter. Returns party details struct.
  • Functions that are altering network state:
  • addProduct(): Returns invoker’s Ethereum balance in the network.
  • addParty(): Function for retrieving all products. Returns product struct.
  • transferProduct(): Function for retrieving a specific product; takes productId as a parameter and invokes getSpecificProduct function from product contract. Returns product history struct.
  • returnTransferProduct(): Function for retrieving details of a party in the network; takes party address identifier as a parameter and invokes getPartyDetails function using address identifier parameter. Returns party details struct.
  • removeParty(): Publicly accessible wrapper for removing a party. Calls removePartyInternal from Parties.sol before calling. It performs a condition check to determine whether the due party has a product in its inventory.
  • setProductForReturn(): Publicly accessible wrapper for setting a product for return flow. Calls addPartyInternal from Products.sol.
  • deposit(): Function for depositing Ether to the contract for the caller’s wallet.
  • withdraw(): Function for withdrawing Ether from the contract for the caller’s wallet. The party is only able to withdraw the amount in its wallet.

3.4. Workflow of the System

The workflow of the proposed supply chain management system is centered around the product’s journey from manufacturing to its final destination. This system leverages the use of IoT-enabled circuit boards attached to products or their packaging to monitor various environmental conditions such as temperature, humidity, and potential physical damage. These circuit boards contain sensors configured according to the product’s specific requirements, ensuring its safety and quality during transit. Figure 10 illustrates the handling of sensor data, showcasing how data from multiple sensor groups is processed to ensure accuracy.
Product ownership transfers occur at various checkpoints in the supply chain, and relevant information about the product and its transfer process is logged into the blockchain ledger. This information includes data related to the product’s condition at the transfer time. However, rather than directly inputting sensor data at checkpoints, the system utilizes oracles to maintain decentralization.
The rapid evolution of Internet of Things (IoT) technology has significantly reduced the size, cost [32], and power consumption of IoT devices, making it increasingly feasible to embed such devices into a wide variety of products. Advances in microelectronics, energy-efficient computing, and miniaturization have enabled the development of compact, energy-efficient IoT sensors and circuit boards that are capable of long-term operation without requiring frequent maintenance or battery replacement. For example, developments in low-power wide-area network (LPWAN) technologies, such as LoRaWAN and NB-IoT, provide cost-effective, energy-efficient connectivity options for IoT devices over wide geographical areas, further enhancing the practicality [33] of deploying IoT-enabled tracking solutions. A pertinent example that illustrates the feasibility and effectiveness of small, IoT-enabled tracking devices is Apple’s AirTag [34]. The success and widespread adoption of AirTags demonstrate the practicality and consumer acceptance of small, IoT-enabled tracking devices, providing a strong precedent for the proposed use of IoT-enabled circuit boards in product tracking and monitoring.
The product’s lifecycle involves multiple stages, from manufacturing to distribution and delivery. Key parties in this process include the manufacturer, distributor, and shipping partners. At each transfer of ownership, the product’s condition is checked and recorded in the ledger. If the product’s condition remains intact, payment is made to the relevant parties, and the product continues along the supply chain. The sequence diagram for the transfer of the product can be seen in Figure 11.
A return process is initiated if any issues arise during the journey, such as damage or deviations from environmental requirements. Products with abnormalities are flagged, preventing them from advancing in the supply chain. Depending on the product’s nature, these products are returned to a designated location for further assessment, including examination and potential repair. The sequence diagram for the return transfer of the product can be seen in Figure 12.

4. Testing and Validation

Smart contract validation and testing are performed using Truffle Suite [35] and Ganache [36]. Ganache is used to create a simulated local blockchain network, and Truffle is used to deploy contracts to Ganache and execute automated tests. Two separate test files are used for combining several tests inside them.
The flow test file includes 36 tests that test the main functions of the contract, such as deploying the contract, product creation, depositing Ether to the contract, checking for party information, adding parties, transferring products to other parties, setting a product for return, and returning the product to its defined return location.
In the Truffle-flavoured Mocha tests [37], individual tests are wrapped in a contract instance, usually “described” in the vanilla Mocha framework. Two arrays, one with normal and one with reverse sequences, are defined for later use to prompt logs regarding test steps. Then, smart contract instance is deployed before the hook. The hook is used to ensure the contract is deployed to the network before any tests are run. Deploying the contract consumes 4,518,628 gas, as per Figure 13. As the writing of this paper, the price of Ether is $1500, and the average gas price is six gwei (gwei is the lowest denomination of Ether, which is a one after 18 zeros; that makes one quintillion wei equal 1 Ether) and the gas cost of deployment is 4,518,628. The total transaction fee is calculated with the following formula: units of gas used * (base fee + priority fee), meaning that we paid $40.66 for the contract deployment. Nevertheless, this fiat value could be even lower than $0.1 if another EVM-compatible chain were used for the deployment.
After deploying the contract, some tests are conducted to verify contract deployment, obtain manufacturer account details, and add Ether to the manufacturer’s wallet. As per Figure 14, verifying the contract costs around $0.2 with 26,346 gas, checking account details costs around $0.4, and funding a wallet costs $10 with 1,138,258 gas.
For testing, adding a product to the smart contract addProduct() method is used. Product creation costs 194,068 gas, as per Figure 15.
Then, we add a party for each party and each role in the supply chain, thus creating all participants of the proposed chain by simulating it. By passing an additional from: address parameter to the addParty() functions with the help of truffle, we are able to simulate running this function in different accounts, and each party addition costs an estimated 190,000 gas, as can be seen in Figure 16.
After adding parties, the product that was created earlier is transferred between parties from the start to the end to test the transfer functionality. Assertions are made to assess whether the product is successfully conducted between parties. The gas cost for each transfer product function call can be seen in Figure 17.
To test whether the return flow using the returnProductTransfer function works, tests are implemented with the same methodology as the previous test, including assertions for checking for party inventories before and after transactions with function callback assertions. The gas usage of this function can be seen in Figure 18.
According to flow tests, the usual flow features, such as contract deployment, adding and withdrawing Ether to the wallet, product creation, adding new parties, transferring products, setting products for return, and returning products, are working. The test results can be seen in Figure 19.
Besides flow tests, for determining how a smart contract behaves in unwanted situations or for determining whether it abides by the chain rules that are defined or not, edge case tests are used. In edge case tests, the following situations are tested:
  • A party trying to change its own role.
  • A party trying to add a party that is not allowed (not directly linked).
  • A party trying to send a product to a party that is not allowed (not directly linked).
  • Another party besides the manufacturer trying to add a product.
  • Checking whether a party with insufficient funds can perform a transfer.
  • An unhealthy product trying to move forward in the chain.
  • A product trying to move further after it arrives at its return checkpoint.
Like flow tests for initializing edge cases, contract deployment is performed before the hook and then later tested to determine whether it was successfully deployed. Then, it checks for whether a party can change its role and permissions or not. After testing the permission feature, another test is performed for duplicate party addition and unlinked party addition. Later, a series of tests are performed to see if only the manufacturer can add a product to the system. Then, a test for the case of trying to skip a party in the chain is performed. Afterward, a test for whether a product can be transferred with insufficient funds is performed. Then, tests are performed to check whether an unhealthy product can move further in the chain. These tests are performed for all possibilities for a product to be unhealthy. Lastly, tests are performed to check if return conditions and functionality are working as intended. These tests include conditions such as trying to move a product set for return and moving a return transfer further after it reaches its return checkpoint.
As per Figure 20, all test cases for edge cases have passed, and the system performs as intended.
These tests are performed using Truffle and Ganache with the following configuration that can be seen in Figure 21.
After the tests are concluded, the contract is deployed to the Sepolia Test Network of Ethereum. Deployment can be seen in Figure 22 and can be followed online at https://sepolia.etherscan.io/address/0x02cC5F4a884e96837F093784C0479B8F8249f01D (accessed on 12 April 2024).

5. Discussion

The system’s initial implementation focuses on the vaccine supply chain, demonstrating its potential benefits in addressing the challenges observed in real-world vaccine supply chains, particularly during the COVID-19 pandemic [38]. However, the system’s flexibility allows it to adapt to various supply chain scenarios, including cold-chain logistics for sensitive products like medicines and food.
The system’s transparency and traceability are key features, enabling end-users, such as patients, to access the complete history of a product using a unique identifier or QR code. This transparent record, stored on a distributed ledger, enhances trust and confidence in the product’s authenticity and quality.
Moreover, the proposed system addresses trust issues among participating parties in the supply chain by providing a trustless trust mechanism. It ensures timely and accurate payments, reducing potential disputes and enhancing collaboration among parties. The system’s transparency also facilitates the early detection of faulty products, preventing them from causing disruptions and additional costs within the supply chain.
Despite its potential advantages, implementing this system in real-world supply chains poses challenges due to supply chain operations’ complexity, variability, and dynamic nature. Each supply chain may require a customized version of the system, adapted to its specific variables, parties, and sub-flows. Furthermore, not all supply chains require the same level of transparency, and financial considerations, such as batch payments, may differ. Partner selections within supply chains are dynamic, adding further complexity.
The implementation of smart contracts in supply chain management varies significantly with territorial application due to differences in technological infrastructure [39], legal environments, and business practices. For instance, in developed countries with advanced IT infrastructure and widespread Internet connectivity, deploying smart contracts for supply chain operations may be relatively straightforward. These countries typically have more robust digital frameworks, which facilitate the quicker integration and acceptance of blockchain technologies.
Conversely, in developing nations, challenges such as limited technological penetration and unstable Internet access can hinder the effectiveness of smart contracts. These territories might require additional investments in digital infrastructure and localized training programs to ensure that all participants in the supply chain can engage effectively with the new systems. However, this lack of a robust digital framework can also be beneficial to the implementation of disruptive technologies since the resistance to new technologies will be lower. In fact, the African continent, which includes many developing countries, is a contender in the world for the highest adoption rate of blockchain and cryptocurrencies [40]. Furthermore, the design of smart contracts must be sensitive to local business customs and practices, which can vary widely and may impact the acceptance and successful operation of these contracts.
Incorporating an international perspective, the deployment of smart contracts for supply chain management on the Ethereum network must consider regulatory and operational differences across countries. For example, varying legal frameworks concerning digital transactions and data privacy could influence how smart contracts are written and enforced. Countries that are located in the European Union, such as Germany, which has stringent data protection laws under the GDPR (General Data Protection Regulation), may require modifications to smart contract protocols to ensure compliance. Additionally, international trade involves cross-border transactions that might be subject to tariffs and import/export regulations, necessitating smart contracts that can dynamically adapt to these legal complexities.
However, the benefits of using smart contracts in international settings are substantial enough to make it feasible to overcome the aforementioned challenges, particularly in enhancing coordination among diverse geographical entities. By automating transactions and maintaining an immutable record of supply chain events, smart contracts can simplify the complexities involved in international logistics, such as customs clearances and freight tracking. This automation not only reduces the time and costs associated with manual processing [41] but also minimizes the risk of errors and fraud, thus fostering a more efficient and secure global trade environment.
Further research could explore the integration of multi-language support within smart contracts to cater to international participants, enhancing understanding and accessibility. Moreover, future studies should examine the impact of geopolitical factors on the stability and reliability of decentralized systems like Ethereum. As nations vary in their technological infrastructure, exploring decentralized applications’ performance in lower-bandwidth environments could be crucial for their broader adoption.
In conclusion, the proposed supply chain management system offers transparency, accuracy, and automation benefits, but its successful implementation requires tailoring to the unique needs of the individual supply chains and parties involved. Configurable smart contracts and careful consideration of specific supply chain requirements are essential for effective deployment.

6. Conclusions

This study explores the fundamental philosophy behind blockchain and smart contract technologies, setting the stage by delving into the concepts and technologies that paved the way for their development. It investigates their inherent limitations and advantages, particularly when compared with existing technological solutions, and identifies numerous potential applications of blockchain and smart contracts within the realm of supply chain management. These real-world use cases highlight the innovative potential of integrating smart contracts and leveraging blockchain technology to enhance business transactions, offering increased security, transparency, efficiency, and traceability.
After examining foundational principles and technologies, a comprehensive literature analysis scrutinizes other implementations that target similar concepts or employ comparable technologies and methodologies. The review distinguishes the implementation of smart contracts in supply chain management presented in this study from the existing literature. It outlines the value proposition of the framework and the enhancements it brings, including enhanced data and monetary security, seamless proof of authenticity, reduced data management costs and efforts, thet elimination of single points of failure, expedited processes and transactions through automation and blockchain usage, protection against crypto-locker and ransomware attacks, and the promotion of trust among supply chain parties.
Various technological stacks and frameworks that enable and empower smart contracts for supply chain management are discussed, weighing the trade-offs of different implementation approaches and methodologies and highlighting their respective advantages and disadvantages. The criteria for selecting tooling, frameworks, and architectural choices are explained. Subsequently, the proposed system architecture, its rulesets and restrictions, and the framework’s process flow are detailed. Datasets, data structures, functions, contracts, and libraries employed in the implementation are presented, elucidating their application logic and source code.
Comprehensive testing and validation are conducted following the explanation of the system’s workflow through process flows and use cases. Testing covers edge cases and regular system flows, accompanied by expected cost assessments for operating the system on the Ethereum Main Network. While tests are initially performed on the local network, contract deployment to the test network is also executed. The framework proposal for supply chain management using smart contracts is then concluded.
This paper sets itself apart from others in the field by adopting a unique approach to data management within smart contracts for supply chains. It exclusively stores all related data—encompassing participant and product information, product transit health, historical data, and financial records—directly on the Ethereum Virtual Machine (EVM). Unlike common practices that may offload data externally, use decentralized storage like IPFS, or combine on- and off-chain storage, this work opts for full on-chain storage. This choice leverages blockchain’s data protection, uptime, and hacking prevention benefits, due to the elimination of oracles and third-party requests, and increases the total execution time, ensuring unmatched transparency and traceability at a higher cost. However, it suggests offsetting these costs through local or lower-fee Ethereum sibling networks.
Additionally, the paper introduces a novel bidirectional flow in supply chain management, accommodating returns of faulty or unwanted goods. It incorporates comprehensive inventory management tools, allowing participants to track product histories and statuses from manufacture to delivery. Enhanced smart contract protocols are also implemented to prevent malicious activities, ensuring integrity and security within the network. This distinct methodology not only prioritizes transparency and security but also enhances supply chain functionality.
However, this framework proposal may not fully address the complexities of introducing digital technologies to the business domain of supply chains or other domains, as it faces various challenges. These challenges encompass the need for a qualified technological workforce and equipment to enable IoT data feeds, the establishment of robust predefined rules for business transactions, the required disclosure of certain data to participants, and the relatively increased costs compared with current implementations. Consequently, further research is essential to explore these challenges in depth and develop more effective solutions, ideally involving surveys with professionals from the business domain.
Building on the foundation laid by this study, future research should explore avenues for enhancing cost efficiency and performance within blockchain-enabled supply chains. This includes investigating alternative blockchain platforms that may offer lower transaction costs or superior scalability compared with the Ethereum Virtual Machine (EVM), without compromising on data security and transparency. Further, studies could delve into advanced optimization algorithms for smart contract execution, aiming to reduce gas fees while maintaining or improving transaction processing speed.
Moreover, there is a significant opportunity to expand on the integration of emerging technologies such as AI and machine learning with blockchain for predictive analytics, demand forecasting, and automated decision-making within supply chains. This integration could lead to smarter, more responsive supply chain systems that anticipate changes in demand and supply conditions in real-time, minimizing waste and enhancing sustainability. Additionally, the exploration of decentralized finance (DeFi) mechanisms for supply chain financing could revolutionize how supply chains are funded by providing more transparent, efficient, and accessible financing options for stakeholders. This could further enhance the liquidity and resilience of supply chains, especially in developing economies.
Finally, given the rapid evolution of digital technologies and their impact on global supply chains, continuous investigation into regulatory and ethical considerations is essential. Ensuring that advancements in blockchain and supply chain management adhere to evolving legal standards and ethical norms will be crucial for widespread adoption and societal acceptance.
In essence, the path forward calls for a multidisciplinary approach that not only seeks to refine blockchain applications for supply chains in terms of efficiency and cost-effectiveness but also aims to harness the potential of complementary technologies for the holistic improvement of supply chain ecosystems.

Author Contributions

Conceptualization, E.Y.; Methodology, E.Y.; Software, E.Y.; Validation, E.Y.; Formal analysis, E.Y.; Investigation, E.Y.; Resources, E.Y.; Data curation, E.Y.; Writing—original draft, E.Y.; Writing—review & editing, E.Y. and T.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
DLTDistributed Ledger Technology
SPoFSingle Point of Failure
PoWProof of Work
EVMEthereum Virtual Machine
GFSIGlobal Food Safety Initiative
RFIDRadio Frequency Identification
IoTInternet of Things
SCMSupply Chain Management
DeFiDecentralized Finance

References

  1. Attinasi, M.G.; Balatti, M.; Mancini, M.; Metellis, L. Supply chain disruptions and the effects on the global economy. ECB Econ. Bull. 2022, 8, 1. [Google Scholar]
  2. Sarkis, J. Supply chain sustainability: Learning from the COVID-19 pandemic. Int. J. Oper. Prod. Manag. 2020, 41, 63–73. [Google Scholar] [CrossRef]
  3. Haber, S.; Stornetta, W.S. How to time-stamp a digital document. J. Cryptol. 1991, 3, 99–111. [Google Scholar] [CrossRef]
  4. Government Office for Science; Hancock, M.P.; Vaizey, E. Distributed Ledger Technology: Beyond Block Chain; Government Office for Science: London, UK, 2016. [Google Scholar]
  5. Back, A. [ANNOUNCE] Hash Cash Postage Implementation. 1997. Available online: http://hashcash.org/papers/announce.txt (accessed on 16 November 2023).
  6. Preneel, B. Analysis and Design of Cryptographic Hash Functions. Ph.D. Thesis, Katholieke Universiteit te Leuven, Leuven, Belgium, 1993. [Google Scholar]
  7. Buterin, V.; Reijsbergen, D.; Leonardos, S.; Piliouras, G. Incentives in Ethereum’s hybrid Casper protocol. Int. J. Netw. Manag. 2020, 30, e2098. [Google Scholar] [CrossRef]
  8. Sunyaev, A. Internet Computing; Springer International Publishing: Cham, Switzerland, 2020. [Google Scholar] [CrossRef]
  9. Bandhu, K.C.; Litoriya, R.; Lowanshi, P.; Jindal, M.; Chouhan, L.; Jain, S. Making drug supply chain secure traceable and efficient: A Blockchain and smart contract based implementation. Multimed. Tools Appl. 2022, 82, 23541–23568. [Google Scholar] [CrossRef] [PubMed]
  10. El Mane, A.; Chihab, Y.; Tatane, K.; Korchiyne, R. Agriculture Supply Chain Management Based on Blockchain Architecture and Smart Contracts. Appl. Comput. Intell. Soft Comput. 2022, 2022, 8011525. [Google Scholar] [CrossRef]
  11. Hoffmann, T.; Prause, G. Smart Contracts for Smart Supply Chains. Ifac-Papersonline 2019, 52, 2501–2506. [Google Scholar] [CrossRef]
  12. Active Gas Fees Comparison for EVM Compatible Chains. 2023. Available online: https://dune.com/msilb7/l2-and-l1-fee-comparison-benchmarks (accessed on 21 February 2023).
  13. Kornhauser, L.; MacLeod, W.B. Contracts between Legal Persons; Technical Report, National Bureau of Economic Research: Cambridge, MA, USA, 2010. [Google Scholar] [CrossRef]
  14. Malhotra, D.; Murnighan, J.K. The Effects of Contracts on Interpersonal Trust. Adm. Sci. Q. 2002, 47, 534–559. [Google Scholar] [CrossRef]
  15. Werbach, K. Summary: Blockchain, the Rise of Trustless Trust? University of Pennsylvania: Philadelphia, PA, USA, 2019.
  16. Shin, H.S. Reflections on Northern Rock: The Bank Run that Heralded the Global Financial Crisis. J. Econ. Perspect. 2009, 23, 101–119. [Google Scholar] [CrossRef]
  17. Isaak, J.; Hanna, M.J. User Data Privacy: Facebook, Cambridge Analytica, and Privacy Protection. Computer 2018, 51, 56–59. [Google Scholar] [CrossRef]
  18. Szabo, N. Smart Contracts. 1994. Available online: https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html (accessed on 21 December 2023).
  19. Szabo, N. The idea of smart contracts. In Nick Szabo’s Papers and Concise Tutorials; Universiteit Van Amsterdam: Amsterdam, The Netherlands, 1997; Volume 6, p. 199. [Google Scholar]
  20. Beamon, B.M. Supply chain design and analysis: Models and methods. Int. J. Prod. Econ. 1998, 55, 281–294. [Google Scholar] [CrossRef]
  21. Langley, C.J.; Novack, R.A.; Gibson, B.; Coyle, J.J. Supply Chain Management: A Logistics Perspective; Cengage Learning: Boston, MA, USA, 2020. [Google Scholar]
  22. Lambert, D.M.; Cooper, M.C.; Pagh, J.D. Supply chain management: Implementation issues and research opportunities. Int. J. Logist. Manag. 1998, 9, 1–20. [Google Scholar] [CrossRef]
  23. Fan, Y.; Stevenson, M. A review of supply chain risk management: Definition, theory, and research agenda. Int. J. Phys. Distrib. Logist. Manag. 2018, 48, 205–230. [Google Scholar] [CrossRef]
  24. De Giovanni, P. Blockchain and smart contracts in supply chain management: A game theoretic model. Int. J. Prod. Econ. 2020, 228, 107855. [Google Scholar] [CrossRef]
  25. Hewa, T.; Ylianttila, M.; Liyanage, M. Survey on blockchain based smart contracts: Applications, opportunities and challenges. J. Netw. Comput. Appl. 2021, 177, 102857. [Google Scholar] [CrossRef]
  26. Hong, Z.; Guo, X. Green product supply chain contracts considering environmental responsibilities. Omega 2019, 83, 155–166. [Google Scholar] [CrossRef]
  27. Mishra, A.; Karmakar, S.; Dutta, A.; Bose, A.; Mohapatro, M. Design and Deployment of IoT enabled Blockchain based resilient Supply-chain Management System using Ethereum. Int. J. Comput. Digit. Syst. 2022, 12, 1029–1050. [Google Scholar] [CrossRef] [PubMed]
  28. Agrawal, T.; Angelis, J.; Khilji, W.A.; Kalaiarasan, R.; Wiktorsson, M. Demonstration of a blockchain-based framework using smart contracts for supply chain collaboration. Int. J. Prod. Res. 2022, 61, 1497–1516. [Google Scholar] [CrossRef]
  29. Buterin, V. EIP-170: Contract Code Size Limit. 2016. Available online: https://eips.ethereum.org/EIPS/eip-170 (accessed on 8 January 2024).
  30. Unova. Website Blockchain Replication Representation Example. 2022. Available online: https://unova.io/blockchain/ (accessed on 1 February 2024).
  31. Biswas, S.; Yao, Z.; Yan, L.; Alqhatani, A.; Bairagi, A.K.; Asiri, F.; Masud, M. Interoperability Benefits and Challenges in Smart City Services: Blockchain as a Solution. Electronics 2023, 12, 1036. [Google Scholar] [CrossRef]
  32. Al-Fuqaha, A.; Guizani, M.; Mohammadi, M.; Aledhari, M.; Ayyash, M. Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications. IEEE Commun. Surv. Tutor. 2015, 17, 2347–2376. [Google Scholar] [CrossRef]
  33. Raza, U.; Kulkarni, P.; Sooriyabandara, M. Low Power Wide Area Networks: An Overview. IEEE Commun. Surv. Tutor. 2017, 19, 855–873. [Google Scholar] [CrossRef]
  34. Apple Inc. Apple Introduces AirTag. [Press Release]. 2021. Available online: https://www.apple.com/newsroom/2021/04/apple-introduces-airtag/ (accessed on 2 April 2024).
  35. Technology, C. Trufle Suite Framework, Version 5.5.24. 2024. Available online: https://trufflesuite.com (accessed on 14 April 2024).
  36. Technology, C. Ganache Emulator, Version 7.9.0. 2024. Available online: https://trufflesuite.com/ganache (accessed on 14 April 2024).
  37. Technology, C. Mocha Framework, Version 8.0.0. 2024. Available online: https://mochajs.org/ (accessed on 12 April 2024).
  38. Shakur, M.S.; Lubaba, M.; Debnath, B.; Bari, A.B.M.M.; Rahman, M.A. Exploring the Challenges of Industry 4.0 Adoption in the FMCG Sector: Implications for Resilient Supply Chain in Emerging Economy. Logistics 2024, 8, 27. [Google Scholar] [CrossRef]
  39. Richnák, P. Current Trend of Industry 4.0 in Logistics and Transformation of Logistics Processes Using Digital Technologies: An Empirical Study in the Slovak Republic. Logistics 2022, 6, 79. [Google Scholar] [CrossRef]
  40. Organisation for Economic Co-operation and Development. Blockchain Adoption in Africa. In Proceedings of the 15th African AI and Blockchain Policy Forum, Pointe aux Piments, Mauritius, 15–16 November 2023; Technical Report. OECD: Paris, France, 2023. [Google Scholar]
  41. Yuan, X.M.; Xue, A. Supply Chain 4.0: New Generation of Supply Chain Management. Logistics 2023, 7, 9. [Google Scholar] [CrossRef]
Figure 1. DLT database.
Figure 1. DLT database.
Applsci 14 04738 g001
Figure 2. Traditional centralized database.
Figure 2. Traditional centralized database.
Applsci 14 04738 g002
Figure 3. An overview of project flow diagram [30].
Figure 3. An overview of project flow diagram [30].
Applsci 14 04738 g003
Figure 4. Relation map of functions of Products.sol.
Figure 4. Relation map of functions of Products.sol.
Applsci 14 04738 g004
Figure 5. UML diagram of Products.sol.
Figure 5. UML diagram of Products.sol.
Applsci 14 04738 g005
Figure 6. Relation map of functions of Parties.sol.
Figure 6. Relation map of functions of Parties.sol.
Applsci 14 04738 g006
Figure 7. UML diagram of Parties.sol.
Figure 7. UML diagram of Parties.sol.
Applsci 14 04738 g007
Figure 8. Relation Map of functions of Handler.sol.
Figure 8. Relation Map of functions of Handler.sol.
Applsci 14 04738 g008
Figure 9. UML diagram of Handler.sol.
Figure 9. UML diagram of Handler.sol.
Applsci 14 04738 g009
Figure 10. Flow of handling of the sensor data.
Figure 10. Flow of handling of the sensor data.
Applsci 14 04738 g010
Figure 11. Sequence diagram for transfer flow.
Figure 11. Sequence diagram for transfer flow.
Applsci 14 04738 g011
Figure 12. Sequence diagram for return transfer flow.
Figure 12. Sequence diagram for return transfer flow.
Applsci 14 04738 g012
Figure 13. Contract initiation gas fee.
Figure 13. Contract initiation gas fee.
Applsci 14 04738 g013
Figure 14. Flow tests pre-checking test gas fees.
Figure 14. Flow tests pre-checking test gas fees.
Applsci 14 04738 g014
Figure 15. Gas fee for AddProduct function.
Figure 15. Gas fee for AddProduct function.
Applsci 14 04738 g015
Figure 16. Gas fee for AddParty function.
Figure 16. Gas fee for AddParty function.
Applsci 14 04738 g016
Figure 17. Gas cost for product transfer.
Figure 17. Gas cost for product transfer.
Applsci 14 04738 g017
Figure 18. Gas cost for return transfer.
Figure 18. Gas cost for return transfer.
Applsci 14 04738 g018
Figure 19. Results for flow test cases.
Figure 19. Results for flow test cases.
Applsci 14 04738 g019
Figure 20. Results for edge case tests.
Figure 20. Results for edge case tests.
Applsci 14 04738 g020
Figure 21. Truffle config.
Figure 21. Truffle config.
Applsci 14 04738 g021
Figure 22. Contract testnet deployment.
Figure 22. Contract testnet deployment.
Applsci 14 04738 g022
Table 1. Party details struct.
Table 1. Party details struct.
Data TypeVariable Name
PartyRolerole
addressid_
stringname
stringemail
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yigit, E.; Dag, T. Improving Supply Chain Management Processes Using Smart Contracts in the Ethereum Network Written in Solidity. Appl. Sci. 2024, 14, 4738. https://doi.org/10.3390/app14114738

AMA Style

Yigit E, Dag T. Improving Supply Chain Management Processes Using Smart Contracts in the Ethereum Network Written in Solidity. Applied Sciences. 2024; 14(11):4738. https://doi.org/10.3390/app14114738

Chicago/Turabian Style

Yigit, Eren, and Tamer Dag. 2024. "Improving Supply Chain Management Processes Using Smart Contracts in the Ethereum Network Written in Solidity" Applied Sciences 14, no. 11: 4738. https://doi.org/10.3390/app14114738

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop