Professional Documents
Culture Documents
Supply Chain Management Serious Game Using Blockchain Smart Contract
Supply Chain Management Serious Game Using Blockchain Smart Contract
Supply Chain Management Serious Game Using Blockchain Smart Contract
This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
ABSTRACT Smart contracts and Blockchain are necessary for transactions in supply chain management. A smart contract
is an agreement in the form of a cryptographic code digitally signed by the actors. This technology holds the data transaction
transparently and securely between the actors. The actors may benefit without intermediaries involved in the transaction.
Supply chain management will be easily tracked by decentralized data sharing. Supply chain management involves
transactions in agricultural sectors such as farmers, Village Cooperatives units, distributors, and consumers. The Cooperative
is a party that buys goods from farmers and sells them to consumers. A smart contract is a digital signature that can access
the system in transactions. The system records log activities that show the origin of transactions. All actors can see the
transaction of agricultural products stored in the blockchain ledger in the Blockchain. This paper discusses blockchain-based
smart contracts scenario for supply chain management that is simulated and implemented in the Serious Game. The Game is
developed using Unity 3D Development Platform, programming language contract using Solidity, Moralis as Web3
Development Platform and dApp as backend blockchain, Network Environment Polygon Ethereum, and Database that is
Redis Enterprise, MongoDB Compass, and Mumbai Testnet.
INDEX TERMS Serious Game, Supply Chain Management, Scenario, Blockchain, Smart Contract
computers, networks, and others in the Blockchain. Village developments in games. One of them is a simulation-based
Cooperative Unit could monitor activities on supply chain serious game. With an overview of modelling simulations,
management [4]. input, output, and content, this serious Game may be used
The smart contract on supply chain management is not as a learning media to explore the learning environment. In
only applied to the agricultural industry but also can be this agricultural Game, players are visualized as having
applied to other industries. Many sectors can use smart their farmland. They can organize and manage it as if
contracts to run the business efficiently and transparently. selling goods [12]. The games can be used to plant land for
In the Logistics Sector, smart contracts are utilized to agricultural resources such as corn, wheat, cotton, and
automate and track product shipments. It helps to ensure straw. Then, these crops are sold via a delivery cart, which
better visibility, real-time monitoring, and automation of can also sell these items on the social market, as well as a
payment processes between parties involved in logistics [4]. reward feature, a ledger on the Blockchain [13], [14]. This
In the Finance Sector, Smart contracts can be applied in the Game could show the transparency of tracing data
financial industry as automatic processes such as payment transactions and has been simulated for farmers who take
processing, settlement contracts, or other financial hold of giant farms; however, only some agricultural games
agreements. It can increase efficiency, speed, and accuracy can make stable prices, meet consumer needs, and benefit
in financial transactions. In the Insurance Field, industrial farmers.
insurance may use Smart contracts to automate claims This research aims to simulate a serious game based on
processing and settlement. Smart contracts can validate blockchain smart contracts using supply chain management.
claims based on predefined parameters and arrange claim The simulation demonstrates the advantage of cutting
payments automatically without human intervention [5]. In supply chain distribution channels. Digital signatures
Property and Real Estate, property and real estate created by involved actors might provide data transparency
transactions may use Smart contracts to facilitate the and optimize prices applicable to market conditions. The
buying, selling, and contracting agreements. They might most agricultural sector in Indonesia uses the Unity 3D
increase the trust between the parties involved [6]. In Development Platform, a programming language contract
Global Commerce, International commerce can use Smart using Solidity, Moralis as the Web3 Development Platform
contracts to facilitate purchasing, shipping, and payment and dApp as the blockchain backend, Polygon Ethereum
processes. Cross-border transactions are simple, efficient, Network Environment, and Databases Redis Enterprise,
and secure using Smart contracts [7]. Smart contracts in any MongoDB Compass, and Mumbai Testnet.
industry require specific business needs and processes
within the industry. Appropriate usage of Smart contracts in
the industry has the same potency as in agriculture.
Sales transactions between Village Cooperative Units
and consumers require data transparency and responsibility
to ensure that transactions have value. We provide
blockchain-based smart contracts, namely smart bidding on
the Blockchain. Bargaining automatic transactions between
farmers and Village Cooperative Units can increase
farmers' profits based on the price of Cost of Goods Sold
and Agricultural Exchange Rates. Cost of Goods Sold is an
indicator in Indonesia that describes how farmers can
obtain products or services produced from the agricultural
sector as an optimal price achievement. [7]
Many applications in several B2B (business-to- Figure 1. The Research part of the Supply Chain
business) startup application platforms reach suppliers at Management Blockchain is based on Serious Game.
low prices between intermediaries, farmers and consumers;
they are AgroMall, Ula. However, these applications have NOVELTY AND CONTRIBUTION OF THE PAPER
drawbacks, including partnership dependence, which The novelty of this research is that a Blockchain smart
affects product availability, service quality, transaction data contract and Supply chain can manage distributed ledger
security, stock, and buyer preferences. A blockchain-based technology in a New Model Blockchain. It aims to provide
DApp application can remove intermediaries in the supply centralized data storage, maintain data privacy, and speed
chain to achieve price optimization, making Dapp on chains involving multiple storage (Private Database).
transactions straightforward and secure for the users [8] The data is integrated into each other (ledger) through
From several related studies [1], [2], [4]–[7], [9]–[11], distribution channels, it makes easy for farmers to
it can be inferred that research is needed to make solutions. maximize their agricultural products. New methods are
Developing a serious game-based simulation may support used to optimize new distribution channels simulated in the
operational supply chain management in making decisions. Serious Game: farmers, Village Unit Cooperative,
In recent years, there have been many technological distributors, and consumers.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This research contributes to analyzing and modelling full nodes which store the entire history of the blockchain
Blockchain technology in the supply chain to support and light nodes which only store part of the data.
farmers deciding to cut distribution channels with a Transactions are data added to blocks that record the
"Distributed Ledger". The research also demonstrates data transfer of crypto assets or other information in a
transactions transparently and optimizes prices using smart blockchain network. The transactions in this research are
contract-based blockchain smart bidding through a serious User Registration (UR), FarmerStock & FarmerShop
game. Serious games can also be applied as learning media (FSH), FarmerKUDTransaction (FK), KUDStock (KS) &
in agricultural production. Smart Bidding uses blockchain KUD Shop (KSH), KUDConsumerTransaction (KD),
smart contracts to optimize prices between farmers and FarmerAuction (FA), FarmerKUDBidding Transaction
village cooperatives in buying and selling products or (FBT) and ConsumerStock (CS).
services. So that automatic bargaining transactions can Smart Contracts are independent programs that run on
increase farmers' profits. the blockchain and can automate various functions and
agreements. Smart contracts work automatically when the
II. RELATED WORK contract is fulfilled.
The basic structure of blockchain technology used in
Blockchain is one of the innovations of current
cryptocurrency networks is Bitcoin and Ethereum, as well
technological developments. Blockchain might change the
as in any other applications outside of cryptocurrencies,
way we manage data and transactions. Blockchain is a
such as supply chains. Blockchain provides a secure and
digital ledger that is decentralized in recording transactions
decentralized basis to record and secure transaction data.
in the form of blocks connected so that a network of related
We present the research focused on blockchain in
actor nodes can verify each transaction [15]. A network of
Smart Contracts, which are formal digital agreements using
participating nodes verifies each transaction; once received,
ledger technology. Smart contract using DLT protocols,
it is encrypted and added to the Blockchain, resulting in a
Ethereum, EOSIO, and Hyperledger Fabric is currently
secure and immutable transaction chain that makes the
developing rapidly [16]. This research uses Ethereum smart
information stored impossible to be manipulated.
contracts.
The structure of blockchain includes Blocks that are the
basic unit of blockchain. Each block contains data like Supply chain management and Blockchain are
several transactions. Each block has two main components: transparent in every real-time tracking of every transaction
the Block Header and Transaction List. Block Header in the supply chain [17]. Blockchain can assist in
contains metadata, such as timestamp, a hash of the optimizing inventory management with real-time
previous block (except the genesis block), and a nonce (a information to determine product demand and supply
random number used in the proof of work searching process throughout the supply chain and can reduce the occurrence
commonly called proof of work. Transaction List is the part of the bullwhip effect. Blockchain also has data reliability
of the block that contains the included transactions in that to prevent data deviation or falsification. Blockchain can
block [3]. facilitate secure automatic payments in supply chains in
A blockchain is a tiered sequence of blocks connected. smart contracts. Blockchain is encrypted with cryptography
Each block refers to the previous block via the previous so that transaction security is guaranteed [18].
block hash. Its header creates a chain relationship. Genesis Blockchain and smart contracts are technologies that
Block is the first block in the blockchain. A genesis block enable improved supply chain management. This
has no preceded block to connect to and usually serves as technology system can be utilized in decision-making to
the starting point of the blockchain. coordinate contractual relationships between parties not
Hashing is the cryptographic process of data from a meeting each other connected in the blockchain ledger. The
block, including transaction data and block headers supply chain should guarantee agricultural products before
converted into a fixed-length numerical string known as a being delivered to consumers; in this case, a smart contract
hash. The hash from the previous block is put in the current is needed to evaluate food safety [3], [16]. Transaction
block header. The hash of the entire block is used to verify scenarios in smart contracts occur between the agreements
data integrity and inter-block relationships. from actors recorded on the node chain, deployed on the
The Proof of Work (PoW) consensus mechanism that Blockchain, and automatically verified by the system [15],
blockchains use requires miners to solve complex [17]. Smart contracts import the data transparently,
mathematical problems to add new blocks to the traceably, and efficiently into the supply chain. The
blockchain. The Proof of Stake consensus mechanism that Ethereum blockchain platform provides an interface for
blockchains use requires coin holders to put up a certain users to secure their privacy using the blockchain
amount of their coins as collateral and randomly select programming language contract "Solidity"[18].
valid actors to block. This process is how consensus on new FarmerChain on smart supply chain management
transactions is reached in a blockchain network. system automates digital agreements using blockchain
Nodes are computers or devices in a blockchain network without intermediaries to identify product authenticity,
that participate in validating transactions and running information and quantities [19]. The Ethereum-based
blockchain software. There are two main types of nodes:
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
blockchain model is a decentralized application network transactions on supply chain management. Serious Game as
(Dapp) to show real-time data transparently and securely a tool to increase awareness of Sustainable Supply Chain
since it runs on the blockchain network. The blockchain Management games based on observations [23].
system works without human interference to reduce errors Related research [3], [15]–[31] discussing supply chain
[20]. management, smart contracts, Blockchain, smart bidding
Farmers are still sending raw materials to consumers in and serious games integrated into this research is shown in
traditional ways, making the transactions a long process. Table 1. Perhaps they are used to facilitate tracking
The supply chain blockchain-based is used in the supply information in the blockchain ledger network. Research on
chain management network to provide product information, supply chain management connected to blockchain and
distribution prices, and price tracking in the security smart contracts is still a challenge; thence, we propose a
network since data security, authenticity, and time are game-based smartagriculture that collaborates with a new
managed appropriately[21], [22]. The supply chain can supply chain using smart contracts and
make orders and transactions easy and track and update
delivery information from farmers to consumers.
Serious games in supply chain management are also
used as a starting stage for planning agricultural products
and providing information on product quantities and prices.
Meanwhile, the simulation games as decision-makers
collaborate with the company with large orders [23],[24].
Serious games are also used to make strategic decisions in
the supply chain from the bullwhip effect [25].
The Serious Game supports supply chain resilience to
make decisions in transactions. When the transaction is not
through an intermediary, it might maximize profits for
actors [26]. Serious games as a medium to secure Figure 2. System Overview on Supply Chain Management
Table 1. Related Work on Serious Game, Supply chain management, Smart Contract and Blockchain
[26] Serious Game Supply chain resilience Strategy to produce and delivery
[32] Smart Bidding Agro Bidding Smart Dynamic System
[23] Game Sustainable Looper, Observation Single Player Serious Game
Supply Chain Management and questioner
[28] Supply Chain Gravity location Game RTS for
Management agent intelligent
Ours Serious Games + Blockchain HFSM + Smart Smart Agriculture
Contract + Smart Bidding +
Supply Chain Management
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
one transaction is agreed upon between the farmer TransactionFBT () is a transaction made by a
and the Cooperative Village Unit, even though the farmer who agrees to an auction offer for his crops
results obtained offer bidding from many and the highest price from one of the Cooperative
Cooperative Village Units. Village Units he chooses as the final selling price in
b. FarmerKUDBidding TransactionFBT () is smart smart bidding.
bidding on the KUD side. FarmerKUDBidding
Table 2. Example information of sales transactions from FS & FSH
Farmer ID Corps name Harvest Date Expired Date
hwsEvGYAgVKBmskU Sun Flowers 12/17/2022 12/27/2022
7FkzwsFPPi Tomato 02/08//2023 02/11//2023
3Dnqr66i35 Corn 04/10/2023 04/17/2023
... ... ... ...
Table 4. Smart contract of sale transaction from FK in Contract batch number TxnHash Transaction Sale in Table 3.
TxnHash Transaction Block From Village Unit Cooperative To Timestamp Value Transaction Fee
Sale
0x2855339.... 30772690 0x193d....780bb2f8 0xb8ad....78228e3d050 39 second (Jan- 0,2263809 0,000031500315
017876c6c5ee259 10-2023 08.24.37 Matic Matic
AM +UTC)
0x5021f2557958ff1b... 33537773 0xfed14b.....9fe719dce 0x51dc.....2385d6fe4e7 11 days 23 hrs 0.4780877 0.000081451144887
343ab8cfc05b44bc10beb2 ago (Mar-25- MATIC MATIC
2023 05:34:13
AM +UTC)
0x8417f0fa0b285... 34202143 0xef25b971f...a9568d 0x73b9....48fe8db18 14 hrs 53 mins 0.1593626 0.000031500000336
4ec29ed89b6d92 ago (Apr-10- MATIC MATIC
2023 01:44:31
PM +UTC)
... ... ... ... ... ... ...
Table 5 is the MongoDB Data Compass, which Consumer transactions are by displaying the Owner,
consists of an interactive tool for querying, optimizing, and Product Name, ETH From, and TxnHash. Table 7 shows
analyzing data on our MongoDB blockchain for sales the contract agreed upon between the consumer and the
transactions between Farmer and Village Unit Cooperative. Village Unit Cooperative, and then the result of a
These transactions are saved in Monggo DB, Unity3D, and blockchain game sales transaction stores the data that
the Redis Enterprise Database. Batch number of FK appears in Unity 3D. Table 8 contains detailed consumer
transaction, hash transactions stores queries from Farmer transactions and stock verified and recorded in a ledger on
Stock, Farmer Shop transactions containing Transaction ID, the blockchain game of the sales transactions from Village
Farmer Address, Village Unit Cooperative Address, Unit Cooperative and consumer. Tables 9 and 10
Amount In Matic transaction, RateMatic, IDR Transaction Transaction details of the smart bidding-based serious
Hash, Class Name. Table 6 Village Unit Cooperative stores Game of FarmerAuctionFA() and FarmerKUDBidding
stock from sales & Village Unit Cooperative opens sales at TransactionFBT () transaction is agreed upon between the
KD through a contract at Village Unit Cooperative. farmer and the Cooperative Village Unit
.
Table 5. MongoDB Compass for sale transaction from FK in Contract batch number Transaction Hash in Table 3.
Id TransactionID Farmer Address Village Unit AmountIn RateMatic Transaction Hash ClassName
Cooperative Address Matic IDR
5DlonRFelA 110202382435 0xb9aD9975... 0x193df....780bbb2f8 0.226380929 13252 0x28553... FarmerKUD
AM469 22be3d050 017876c5ee259 Transaction
7FkzwsFPPi 325202353410AM582 0x51dc845abec... 0xfed14b...89fe719dce 0.478087664 12550 0x5021f2557958... FarmerKUD
5d6fe4e7 d4..b44bc10beb2 Transaction
zVNRek6GO7 410202314431PM342 0x73b942459.... 0xef25b971f...a9568d 0.159362555 12550 0x8417f0fa0b28522f FarmerKUD
48fe8db18 1877ae...c29ed89b6d92 Transaction
... ... ... ... ... ... ... ...
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Table 10. Transaction detail of the smart bidding-based serious Game of FarmerKUDBidding TransactionFBT ()
Id Bidding Farmer KUDAddress Condition plant name Quantity HarvestDate Auction Accepted
Transaction Address Price BidTime
ID
5DlonRF 22020238243 0xb9aD9 0x193df....780b Good Sunflowers 1 quintal 06/20/2023 Rp 4.300.000 41 Second
elA 5BT469 975... bb2f8 (Juni-20-
22be3d05 2023)
0
7FkzwsF 220202382435 0x51dc84 0xfed14b...89fe Good Mid Tomato 5 quintal 06/15/2023 Rp 9.000.000 50 Second
PPi BT470 5abec... 719dce (Juni-15-
5d6fe4e7 2023)
zVNRek 220202382435 0x73b94 0xef25b971f...a Good Corn 8 quintal 06/20/2023 Rp 41 Second
6GO7 BT471 2459.... 9568d 13.600.000 (Juni-20-
48fe8db1 2023)
8
... ... ... ... ... ... ... ... ... ...
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
C. Smart Contract Transaction Architecture of Supply FarmerStockFS () and FarmerShopFSH (). The
Chain Management game-based accounts are used for Farmer Stock, Farmer Shop, and
As shown in Figure 7, the sequence of all transactions Farmer KUD.
from the supply chain management-based blockchain smart Sales purchase transactions in
contract game includes Contract Data and Contract FarmerKUDTransactionFK () between Farmers
Transactions from Product Registration, Sales, and and the Village Unit Cooperative. Transaction of the
purchase. Contract Transactions, Transfer Information, ContractAddress() function in the contract address
Distribution, and Traceability of the data in the agricultural added to the consensus in the network nodes of the
supply chain. We have explained in detail the information of the game blockchain system batch and
implementation of actors; they are farmer, Village Unit deploy Blockchain according to the address. Two smart
Cooperative, distributor, and customer. The steps through bidding mechanics in smart contract blockchain exist
which the actors involved are: FarmerAuctionFA() and FarmerKUDBidding
1. Farmers who pass the contract make transactions that
TransactionFBT (). The transaction is agreed upon
must go through the registration process via a QR Code
between the farmer and the cooperative village unit with
connected to the function UserRegistrationUR () smart bidding
via a metamask wallet account. The farmer contract 2. Village Unit Cooperative passing the co
address is automatically connected with the
ntract has a similar process to Farmers. Village Unit Distributors who make transactions must register via a
Cooperative, who make transactions, must register via a QR Code connected to the function
QR Code connected to the function UserRegistrationUR () via a metamask wallet
UserRegistrationUR () via a metamask wallet account.
account. The Village Unit Cooperatives carry out the 4. Consumers passing contract are the consumers who
registration process as (UVC/KUD) through User registered via UserRegistrationUR () to be able to
Registration and sell goods purchased from farmers make purchases and get information for harvest from
(FK), then is stored and re-sell to consumers through the the Village Unit Cooperative connected to the
function KUDStockKS() and KUDShopKSH() function KUDConsumerTransactionKD () and
and contract KSH from KD on the blockchain network ConsumerStockCS () that stores information on
from KD Transaction. consumers and be able to track transactions on
KUDConsumerTransactionKD () sale and previous harvest on the network system blockchain
purchase transactions of crops with consumers. games. Blockchain can track the information obtained
from each transaction bound through a digital
3. Distributors passing the contract are the distributor who signature contract in which each transaction is added
has the transaction process at the Village Unit to the consensus on the network node of the
Cooperative through the function blockchain games system.
KUDConsumerTransactionKD (). Consumers
received requests from the function The design uses UML Diagrams for the blockchain game
KUDConsumerTransactionKD () and changed smart contract integration system, namely the verification
delivery status at the function model and integration flow for UML activity diagrams
KUDConsumerTransactionKD () and and UML component diagrams. The class diagram is
ConsumerStockCS (). FarmerKUDBidding shown in Figure 7.:
Transaction (FBT) verifies delivery from farmer
auction transactions and Village Units Cooperative.
(a) (b)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
(c) (d)
Figure 7. The use case of Blockchain-based Smart Contract Transaction on Supply Chain Management Game (a) Smart
Contract Farming Mode (b) Smart Contract Village Unit Cooperative Mode (c) Smart Contract Distribution Mode (d) Smart
Contract Consumer Mode
Pada Figure 8. The case of transactions integration between User Registration (UR), Farmer Stock (FS), Farmer Shop (FSH),
Farmer KUD Transaction (FK), KUD Stock (KS), KUD Shop (KSH), FarmerAuction (FA), FarmerKUDBidding Transaction
(FBT) ), KUD Customer Transaction (KD) and Consumer Stock (CS) present the actors including farmers, Village Unit
Cooperative, distributors, and consumers in this supply chain management serious Game. Component diagrams describe the
interface flow required in communication between actors during transactions.
Figure 8. Component diagrams of UML Blockchain Smart Contract with Farming, Village Unit Cooperative, Distribution,
and Consumer.
Figure 9. The UML deployment diagram for Supply Chain Management Game-Based
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Deployment Diagram is a model diagram in UML that describes the relationships spread in the system. The diagram
involves software and actors depicting the application configuration done at run time. The application loads blockchain
nodes from Unity 3D Development Platform connected to Moralis, and Metamask will be connected via actors, Netrork
environment using polygon Ethereum and database using Mongo DB Compas and Redis Enterprise as seen in Figure 10.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
<<HTTPS>> Network protocol in a Table 14. Class diagram UML on Game Blockchain Smart
Contract with stereotypes
blockchain network used as
a data encryption Stereotype Description
communication protocol <<Transaction 1>> Describes the contents of the
attributes of the User
<<Web3Development Blockchain network based
web technology Registration Class and the link
Platform>>
of each related object
<<device/environment>> A device used to receive
<<Transaction 2>> Describes the contents of the
messages
Smart Contract attributes of the
<<networkenvironment>> Network Devices that can FarmerStock Class
interact and communicate
<<Transaction 3>> Describes the contents of the
with each other
Smart Contract attributes of the
<<monggodbcompass>> A graphical interface KUDStock Class
developed by MongoDB to
<<Transaction 4>> Describes the contents of the
make it easier for users to
Smart Contract attributes of the
visualize data by database
FarmerKUDTransaction Class
<<RedisEnterprise>> Platform to save open-
<<Transaction 5>> Describes the contents of the
source data
Smart Contract attributes of the
KUD Consumer Transaction
Stereotypes provide additional information about the Class
classes in the UML model. Stereotypes are the notation
<<Transaction 6>> Describes the contents of the
used in UML to add attributes or properties to elements in
Smart Contract attributes of the
the model [37]. In the context of a class diagram,
FarmerShop Class
stereotypes are used to provide specific information about
<<Transaction 7>> Describes the contents of the
the roles or characteristics of the class represented in the
Smart Contract attributes of the
system. As seen in Table 13.
KUDShop Class
Class Diagrams using stereotypes to provide additional
information about classes in the UML model. Table 14. <<Transaction 8>> Describes the contents of the
Smart Contract attributes of the
Table 13. UML class diagram with stereotypes Consumer Stock Class
Stereotype Description <<Transaction 9>> Describes the contents of the
<<User Class diagrams describe Smart Contract attributes of the
Registration(UR)>> the actors involved Class Farmer Auction
<<State>> Describes the state of the <<Transaction 10>> Describes the contents of the
object Smart Contract attributes of the
<Flow>> Flow that shows the FarmerKUDBiddingTransaction
workflow connecting to Class
diagram elements
<<Contract>> Blockchain code on digital The class diagram design uses UML stereotypes
agreement based on smart contracts involving the actors: farmers,
<<abstract>> A framework by derived Village Unit Cooperatives, distributors, and consumers. The
classes for blockchain transactions in the smart contract model involve
implementation FarmerKUDBidding Transaction,
<<VerificationRule>> Verification rules for the FarmerKUDTransaction(FK) and KUD
validity of transactions on CustomerTransaction(KD) identifying contracts or
a blockchain network agreements agreed by actors in blockchain network
transactions. Verification rules on transactions are also
<<FarmerKUDBidding The class diagram
must be met by actors. While the real status saved in the
Transaction>> describes the smart bidding
blockchain network demonstrates the sequence of actions
transaction link between
on the nodes to reach a consensus on the transactions.This
Farmer and VUC
smart contract design has flexible verification settings. The
<<FarmerKUDTransaction The class diagram
verify() method is applied to each transaction contract as a
(FK)>> describes the link between
valid function in the rule list. User Registration is used by
Farmer and VUC
scanning the wallet and filling in the ID card number and
transactions
role on FarmerKUDBidding for smart contract agreements
<<KUD The class diagram
between Farmers and Village Unit Cooperatives to carry
ConsumerTransaction describes the link between
out the auction process. FarmerKUDTransaction (FK) is a
(KD)>> VUC and Consumer
smart contract agreement between Farmers and Village
transactions
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Unit Cooperatives for buying and selling agricultural products between the Village Unit Cooperative,
products. KUD Customer Transaction (KD) is a smart distributors, and consumers. These can be seen in Figure
contract agreement for selling and purchasing agricultural 11.
Figure 11. UML class diagram for Game Blockchain Smart Contract design
D. Hierarchical Finite State Machine (HFSM) For decision-making to improve supply chain performance.
Scenario Smart Contract Blockchain-based with Cooperation in a supply chain management-based Serious
Supply Chain Management Game is also needed as a decision-making and market
Hierarchical Finite State Machine (HSFM) in strategy. [33] The actors involved must be registered in the
supply chain management is a scenario design for a digital game application by showing a digital wallet account as a
agreement control system using three working principles: personal identity verified by the user and the Village Unit
State, Event, and Action [38]. Actions in response to input Cooperative as the system manager.
of the transaction accompany changed status. The HFSM This study uses HFSM to design the sequence of game
model is very suitable as a real-time design in controlling scenarios using smart contracts in supply chain
software. This Game can be used to design scenarios due to management transactions. One of the advantages of using
deviations in the information obtained, which needs to be FSM is that it can describe the serious game flow.
more transparent between the actors involved. [39] Thus, Researchers use the smart contract method to hold the
we need a Blockchain-based Smart Contract on supply scenario flow based on the actors involved.
chain management that simulates Serious Game [33] as HFSM in Figure 12. shows four scenarios, namely
Automatic Scenario Control. Serious games in the supply Scenario 1 Farmer (S1), Scenario 2 Village Unit
chain are used to explore and simulate integrated games in
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Cooperative (S2), Scenario 3 Distributor (S3), and Scenario the wallet; if registered, it would automatically enter each
4 Consumer (S4). Each sub-scenario describes the rules of scenario account. If it is not registered, enter an email
supply chain transactions and the rules of playing the Game address and choose Farmer, Village Unit Cooperative,
generally. Started from playing the Game with the Wallet Distributor, or Consumer mode. At the same time, the
Login Transition on the digital wallet account and digital signature will connect to the game scenario based on
processing access to each account via Scan My QR Code to the scenario mode saved on the UR.
Figure 12. The Hierarchical Scenario-based Smart Contract on Serious Game Using Blockchain
As in Figure 13. Three states are sub-scenarios of Farmer, Village Unit Cooperative, Distributor, or Consumer mode.
Four scenarios have designs of story ideas from supply chain management games involving several actors in sales and
purchase transactions.
(a)
Figure 13a shows the FSM's design through how farmers seek the agricultural field, choose what crops to be planted, farm
the fields, wait for the harvest, and harvest the crops. There are two choices to manage the corps: stored in the farmer's
warehouse or sold to the Village Cooperative Unit by inputting the prices, smart bidding between the farmer and Village
Unit Cooperative, Distributor selecting a digital signature, then FK saved on the Blockchain.
(b)
Figure 13b Village Unit Cooperative mode scenario will check the purchasing farmer's harvest, which will be sold to the
consumer, checking the quality stock from the farmer whether the corps will be stored in the warehouse or sold to the
consumer, determining the selling price, smart bidding agreed upon between the farmer and the cooperative village unit,
even though the results obtained offer bidding from many cooperative village units signing a digital signature on smart
contract. Gas fee transaction data will be saved to KD.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
(c)
Figure 13c Design FSM distributor mode performs the process of sending goods; a list of required goods will appear from
the results of KD transactions. Whether the goods are sent to consumers or stored in the warehouse, it is connected to a
smart contract. Meanwhile, in Figure 13d, the consumer scenario mode has two choices. First, consumers purchase the
crops from the Village Unit Cooperative by signing a digital signature, then keep the stock. Second, the consumers see the
activity log like planting, fertilization, corps quality, farmer's name, plant expired date, harvest location, amount of stock,
and price saved on CS transactions.
(d)
Figure 13. Scenario actors (a)Farmer Mode, (b) Village Unit Cooperative, (c) Distributor or (d) Consumer Mode on
Scenario-based Serious Game using Blockchain
IV. SMART BIDDING METHOD FOR FARMER'S PRICE OFFER IN In Indonesian financial accounting, cost of goods
SERIOUS GAME sold obtained from the total costs incurred by a business
The process implementation serious game based in a certain period. the cost of goods sold includes raw
on supply chain management requires control in material costs, direct labour costs, overhead costs,
optimizing prices based on the product number, lead time, shipping costs for purchased goods, discounts, and
raw material costs, and purchasing and ordering costs in a product returns. The inventories and net purchases might
certain period. In this study, control product quality can affect the the cost of goods sold. The purpose of cost of
be seen from the expired date variable or the age of the goods sold is to determine how much the costs are
commodity. When the stock has expired, it will incurred from processing raw materials until finished
automatically expire in the store. When the products goods and services for sale.
expire in the consumer, they will expire at the consumer. An auction system on every Village Unit
Smart contracts run their functions automatically as Cooperative might automate the bidding process and
processing data verification, data validation, and payment increase farmers' profits based on Cost of Goods Sold and
calculations. In the smart contract between the farmer and Agricultural Exchange Rate. The Cost of Goods Sold is
the Village Unit Cooperative, there is a payment based on an indicator that describes how farmers can obtain
the quantity of product delivered. When agricultural products or services with results produced from the
products are sent to the Cooperative, it can provide data agricultural sector. [11]
on the amount of product received. The smart contract The following are ways of smart bidding implemented in
will automatically calculate the amount of payment to the serious Game:
farmers based on the price agreed beforehand. After the 1. Data Analysis: Simulation of Serious Game Supply
calculation is completed, the smart contract can trigger an Chain Management on the auction system applies the
automatic transfer from the Village Unit Cooperative variables of demand from farmers and offers from the
account to farmer accounts and shipment tracking. Thus, Village Unit Cooperative, current market price,
it may reduce human involvement and minimize the risk product quality audited by users in the application, and
of human error in the supply chain. other factors which affects the price. The base price is
The smart bidding-based serious Game determined by the farmer in the system. The price is
automatically uses smart contract games in the bidding set at auction based on a specific time. The maximum
transactions process between farmers and Village Unit price obtained by the farmer in the Smart bidding
Cooperatives. system for further bids.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Alghorithm 1 : UserRegistrationUR ()
Input: Contract registration and game transaction processing. Farmer Stock (FS) contains the identification of crop stocks carried out by
farmersBlockchain and Smart Contract Interactions with the Moralis Unity SDK.
Input : The data displayed on FSH that gives the contract address and Input : The sales transaction contract between the farmer and the
information from the function FarmerStockFS () for sale to the function Village Unit Cooperative from the function
FarmerShopFSH () FarmerKUDTransactionFK ()
1. Public static async UniTask<Dictionary<FarmerStock, 1. Public static async void KUDBuyItem(FarmerShop
PlantObject>> GetStocks(string _userAddress) { _shopItem, int _amount){
2. MoralisQuery<FarmerStock> farmer = await 2. var transaction = Moralis.Client.Create<KUDStock>();
Moralis.Query<FarmerStock>(); 3. var user = await Moralis.GetUserAsync();
3. farmer = farmer.WhereEqualTo("farmerAddress", 4. MoralisQuery<FarmerShop> itemQ = await
_userAddress); Moralis.Query<FarmerShop>();
4. IEnumerable<FarmerStock> result = await 5. itemQ = itemQ.WhereEqualTo("stockId",
farmer.FindAsync(); _shopItem.stockId);
5. var list = new Dictionary<FarmerStock, PlantObject>(); 6. FarmerShop item = await
6. foreach (FarmerStock stock in result) { itemQ.FirstOrDefaultAsync();
7. var plant = ScriptableUtils.GetPlant(stock.plantName); 7. item.quantity -= _amount;
8. list.Add(stock, plant); } 8. transaction.stockId = _shopItem.stockId;
9. return list; } 9. transaction.boughtTime =
10. Public static async UniTask<Dictionary<FarmerStock, DateTime.Now.ToUniversalTime();
PlantObject>> GetMyStocks() { 10. transaction.condition = _shopItem.condition;
11. UserModel user = await UserController.GetMyUser(); 11. transaction.expirationDate = _shopItem.expirationDate;
12. return await GetStocks(user.ethAddress); } 12. transaction.farmerAddress = _shopItem.farmerAddress;
13. Public static async void AddFarmerStock(FarmerStock 13. transaction.harvestedDate = _shopItem.harvestedDate;
_stock, int _amount) { 14. transaction.quantity = _amount;
14. MoralisQuery<FarmerStock> stockQ = await 15. transaction.plantPrice = _shopItem.price;
Moralis.Query<FarmerStock>(); 16. transaction.kudAddress = user.ethAddress;
15. IEnumerable<FarmerStock> result = await 17. transaction.plantName = _shopItem.plantName;
stockQ.FindAsync(); 18. await transaction.SaveAsync();
16. FarmerStock selectedStock = null; 19. if(item.quantity > 0){
17. foreach (FarmerStock stock in result) { 20. var successz = await item.SaveAsync();
18. if (stock.farmerAddress == _stock.farmerAddress && 21. if(successz){
stock.plantName == _stock.plantName) { 22. Debug.Log("FarmerShop has been decreased, updated
selectedStock = stock; }} to DB");
19. if (selectedStock != null && selectedStock.harvestedDate == 23. }else{
DateTime.Now.ToUniversalTime().Date) 24. Debug.Log("Failed to update to FarmerShop DB");
20. { selectedStock.totalHarvested += _amount; 25. }
21. Debug.Log("Total of " + selectedStock.plantName + " is 26. }else{
" + selectedStock.totalHarvested); 27. await item.DeleteAsync();
22. if (selectedStock.totalHarvested > 0) 28. Debug.Log("Shop item reached 0, deleted from
23. { var successz = await selectedStock.SaveAsync(); Database");
24. if (successz){ }}
25. Debug.Log("FarmerStock updated to DB"); }
26. else {
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
query = query.WhereEqualTo("customerAddress",
_userAddress);
IEnumerable<CustomerStock> result = await
query.FindAsync();
var list = new Dictionary<CustomerStock, PlantObject>();
(a) (b)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
(c)
Figure 14. Blockchain Network connected to Smart Contract node (a) Setting Moralis Cloud Server connected to Redis
Enterprise (b) Redis Enterprise connected to Terminal Migration Blockchain of Parse Smart Contract node (c).
The image above shows the Operating Windows Server OS connected to Moralis Cloud Server network, Redis Enterprise for
database connected to the Terminal Migration Blockchain of Parse Smart Contract Node to synchronize the smart contract
and data before running the game application in Unity 3D.
Table 15. Test Environment System
The table provides detailed information about the software used.
Development Platform Unity 3D 2021.3.18f1
Operating System Windows 10
Programming Language Contract Solidity
Editor Visual Studio Code
Front-End Interaction Moralis (Web3.js dan dApp)
Network Environment Polygon Ethreum
Database Redis Enterprise,
MongoDB Compass
Testnet Mumbai Testnet
(b)
(a)
Figure 15 Smart Contract Verification with Moralis and Metamask (a) connected to Wallet Metamask and Game (b) Digital
Signature of Game Blockchain Transactions.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Figure 16 (a) Smart contract connected to My Scan QR farmers and Village Unit Cooperative transaction
Code via wallet to connect to the agricultural Game using information. (i) and (j) each sale and purchase transaction
Blockchain-based on Serious Game. After being connected, from the Village Unit Cooperative and consumer appears
it passes based on registered accounts like farmers, Village request list of distribution section of the goods. The status
Units Cooperative, distributors, or consumers. (b) As a would be updated when the goods are delivered to the
farmer, farmers plant corn and tomatoes on the land in the consumer. (k) On FarmerStockFS(), there is an auction
Game by clicking on the plant options and planting them on button to go to smart bidding regarding the price between
the vacant land. (c) waiting for the plants to mature until the farmer and the Village Unit Cooperative in the
harvested. (d) input the prices of harvest. The price, harvest commodity auction using the system in smart bidding in the
date, and expiration date (e) a tab of the harvest stock list FarmerAuctionFA(). (l) The farmer will set the base
and price that will be sold to the Village Unit Cooperative price in the smart bidding system in the
saved in the FS, then selling the crops from farmers via FarmerStockFS() menu. (m) Farmers will then receive
FarmerShop (FSH) (f) choose which crops to be sold. (g) price offers from several Cooperative Village Units using
Sell the crops through the Village Unit Cooperative. the system in smart bidding in the FarmerKUDBidding
Consumer transaction displays the stock list of the owner
TransactionFBT (). Farmers can choose the desired
(farmer’s address), purchase amount, harvest date, expired
price by pressing the Accepted Bid button.
date, purchase date, condition, and purchase price. (h)
Consumer stock stores consumers purchasing data of
(e) (f)
(d)
(g)
(h) (i)
(j) (k)
(l)
(m)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
Figure 16. Smart Contract-based Supply Chain Management on Serious Game (a), (b), (c), (d), (e), (f), (g), (h), (i),
(j),(k),(l),(m)
VIII. TESTING
The result of testing smart contracts scenarios of Blockchain-based in serious games in supply chain management is proving
the suitability of data using MongoDB Compas, Polygon, and Unity by entering the transaction hash blockchain address in
each transaction shown in Figure 17(a) and Figure 17(b). They look the same as the transactions carried out by the actors
involved. As shown in Figure 17 (a), each transaction in supply chain management will save the data on blockchain node
chains, namely MongoDB Compas, Network Environment Polygon Testnet Ethereum, and Unity 3D. (a) The blockchain
game on FarmerKUDTransaction (FK) transactions stores Hash transactions that will be transferred to Monggo DB Compas
and can be viewed in detail in the Ethreum Polygon Testnet Network Environment. Transaction Hash:
0x2855339....017876c6c5ee259, Smart Contract Call: Aset/Script/Web3Utils/SmartContractCall:cs:99, Status: Success,
Block: 30772690, Timestamp: 38 Seconds ago (10-Jan-2023 08.2:37 +UTC) from the Village Unit Cooperative
0x193d....780bb2f8, for farmers 0xb8ad....78228e3d050, with a Value of 0.2263809 Matic, Transaction Fees:
0.000031500000315 Matic and connected to MonggoBD Compas.
(a)
(b)
As in Figure 17 (b) sale and purchase transactions involve Village Unit Cooperative and consumer in the KUD
game, ConsumerTransaction (KD) stores TxnHash: 0x877ed5dc6eec....2ce45530b40d, Smart Contract Call:
Asset/Script/Web3Utils/SmartContractCall:cs:99, Status: Success, Block: 30772817, Timestamp: 41 secs a
go(Jan-10-2023 08:29:07 AM_UTC) from Consumer: 0x9cdc46141ed...95910Ba9ae to Village Unit
Cooperative: 0x193df....780bbb2f8, Value: 0.2645303 Matic, Transaction Fee: 0.000031500000315 Matic are
connected then saved in MonggoBD Compass & CustomerStock (CS).
(a)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
(b)
Figure 18. Details sale and purchase transactions at Polygon, Unity (a) FarmerKUDTransaction(FK) Transactions (b)
KUDConsumerTransaction (KD) & ConsumerStock (CS).
We compare the traceability system designed in Blockchain in supply chain management has challenges
this paper by using a detailed comparison of each tracing with capacity and speed. A minimum standard specification
transaction. The details of the comparison results shown in is required to install Blockchain: Public blockchains like
Figure 18. are below: Bitcoin or Ethereum and private blockchains like
a. Traceability: We made a comparison of the tracing Hyperledger Fabric require a minimum processor with
system on the smart contract system in this Game; minimal Multi-Core Processors with speed for maximum
the result is that all transactions have traceability blockchain performance. The minimum RAM capacity on
by checking the results of transactions using the Bitcoin and Ethereum is 5 GB or more. Storage Capacity
blockchain address (Txn Hash) transactions using For example, Bitcoin requires a large amount of storage.
MongoDB Compas, Polygon, and Unity. The SSD is more recommended than HDD because it reads and
results for all transactions are correct. writes data faster. The Operating System on the Blockchain
b. Decentralized application (Dapps): The is vital when processing blockchain transactions.
transactions have not involved third parties, so Recommended devices include Linux, Windows, MacOS,
they are peer-to-peer. This technology is very and a stable Internet connection. These devices are essential
secure because no party can access data, control, in the blockchain network for network synchronization and
or change the information of transactions in supply interaction. Further, firewall and security have proper
chain management since the ledgers are all firewall and security configuration to protect the node from
connected in a blockchain network system. Thus, security threats.
it is very transparent and secure.
c. Accountability and Transparency: The actors DISCUSSION AND LIMITATIONS
involved in supply chain management can see The purpose of the Serious Game as a learning
every transaction recorded in this blockchain game medium is to simulate a supply chain from Farmers to
application. In some transactions, authority is Consumers. Serious Game is a collaboration of Supply
needed to resolve the problem; in this case, the Chain Management, Blockchain and smart contracts as a
Village Unit Cooperative is an official government data security medium. The transactions on the Blockchain
that can verify detailed information and is are saved in ledgers and databases stored privately. This
responsible for logging activity in the Blockchain; application is decentralized as a result of cutting
hence, the transaction is accountable. distribution channels.
d. User-friendliness: The smart contract application Blockchain smart contracts are used as a link
using a Blockchain-based scenario for Supply between products from farmers and consumers.
Chain Management on Serious Game is easy to Blockchain smart contracts facilitate contracts or
use; thus, it makes the transactions comfortable for agreements between one party without a third party
the actors with its interface. involved. The actors involved in the Blockchain are
e. System Scalability: Blockchain can manage supply farmers, Village Unit Cooperative, distributors, and
chain management. In large-scale transactions, it consumers. Blockchain facilitates media communication
will be a challenge to implement the Blockchain in between players in transactions to maximize farmer
the future; hence, the blockchain capacity and profits and increase actor knowledge. This application
speed can be increased. describes the simulation game modelling, input, output,
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
content and objectives. Solidity, Moralis as Web3 Development Platform and dApp
The application of Blockchain using smart as backend blockchain, Network Environment Polygon
contracts and smart bidding in automatic bidding Ethereum, and database that is Redis Enterprise, MongoDB
transactions between farmers and VUC. The aim is to Compass, and Mumbai Testnet.
increase farmers' profits based on the price of Cost of The testing results of blockchain smart contract show that
Goods Sold and Agricultural Exchange Rates. The Cost transaction data stored in node chains, namely MongoDB
of Goods Sold describes how farmers can obtain products Compas, Network Environment Polygon Testnet Ethereum,
or services produced from the agricultural sector to and Unity 3D have successfully connected to the data
achieve optimal prices based on data analysis, optimum obtained from the TxnHash transaction:
price, optimization of farm profits and prices, adjustment 0x877ed5dc6eec....2ce45530b40d saved successfully and
of demand and bidding, transaction efficiency, player stored in MongoDB Compas and displayed on Unity 3D
decision effects and performance evaluation. Smart Contract Call:
The limitation of this research is the application Asset/Script/Web3Utils/SmartContractCall:cs:99, Status:
of smart contracts using blockchain in serious games Success, Block: 30772817, Timestamp: 41 secs a go(Jan-10-
based on supply chain management in Indonesian case 2023 08:29:07 AM_UTC) from Consumer:
study. Farmers can directly sell their products to 0x9cdc46141ed...95910Ba9ae to Village Unit Cooperative:
manufacturers, distributors or consumers without 0x193df....780bbb2f8, Value: 0.2645303 Matic, Transaction
intermediaries, which also requires all the chains in the Fee: 0.000031500000315
Dynamic Supply Chain. Farmers benefit since they can The border of this research is that it has not applied the
sell products at stable prices on the market without latest technology other than that used in this paper. Future
intermediaries. Consumers also benefit because work can develop a combination of several other methods for
purchasing prices are lower through farmers. The results blockchain smart contracts using Artificial Intelligence, Deep
of cutting supply chain distribution channels using Learning and Machine learning to improve serious games. It
blockchain smart contracts are the goals of this game. may also develop the Game using Metaverse technology so
that the benefits of blockchain smart contracts have value.
CONCLUSION
This paper discussed the serious Game as a smart REFERENCES
agriculture simulation to support transactions on Supply [1] R. Rachmawati, “Smart Farming 4.0 Untuk
Chain Management. The transaction is done without Mewujudkan Pertanian Indonesia Maju, Mandiri,
involving third parties like intermediaries since blockchain Dan Modern,” vol. 38, no. 2 Forum penelitian Agro
technology has decentralized data sharing and a system for Ekonomi, 2020, Accessed: Mar. 20, 2023. [Online].
Available:
tracing sale and purchase transactions. The data transaction is http://repository.pertanian.go.id/handle/123456789/1
recorded in the ledger using a smart contract, and each 3300.
transaction involves actors like the farmer, Village Unit [2] S. Saberi, M. Kouhizadeh, J. Sarkis, and L. Shen,
Cooperative, distributor, and consumer. Smart contract of “Blockchain technology and its relationships to
User Registration (UR), FarmerStock & FarmerShop (FSH), sustainable supply chain management,”
FarmerKUDTransaction (FK), KUDStock (KS) & KUD https://doi.org/10.1080/00207543.2018.1533261,
Shop (KSH), KUDConsumerTransaction (KD), vol. 57, no. 7, pp. 2117–2135, Apr. 2018, doi:
FarmerAuction(FA), FarmerKUDBidding Transaction (FBT) 10.1080/00207543.2018.1533261.
and ConsumerStock (CS) can track and integrate all [3] P. Bottoni, N. Gessa, G. Massa, R. Pareschi, H.
Selim, and E. Arcuri, “Intelligent Smart Contracts for
transactions. Innovative Supply Chain Management,” Frontiers in
Smart contract scenario-based games are used to Blockchain, vol. 3, Nov. 2020, doi:
facilitate sale and purchase transactions and to trace data 10.3389/FBLOC.2020.535787/FULL.
transactions transparently. The scenario is then simulated for [4] H. Hasan, E. AlHadhrami, A. AlDhaheri, K. Salah,
farmers who manage large farms. Farmers can promote the and R. Jayaraman, “Smart contract-based approach
prices properly and can meet consumer needs. The smart for efficient shipment management,” Computers and
contract we designed responds to the relevant actor to verify Industrial Engineering, vol. 136, pp. 149–159, Oct.
the actor's identity in the transaction. Digital signatures 2019, doi: 10.1016/j.cie.2019.07.022.
determine data validity and are saved permanently in the [5] A. Borselli, “Smart Contracts in Insurance: A Law
and Futurology Perspective,” Milan, Italy, 2020. doi:
Blockchain that decentralizes on serious game applications. https://doi.org/10.1007/978-3-030-27386-6.
Smart bidding using blockchain smart contracts in [6] R. M. Garcia-Teruel, “Legal challenges and
agricultural price bidding may increase profits without opportunities of blockchain technology in the real
involving intermediaries, optimize the prices according to estate sector,” Journal of Property, Planning and
market conditions, increase efficiency, and provide better Environmental Law, vol. 12, no. 2, pp. 129–145, Jul.
access to market information in agricultural simulation 2020, doi: 10.1108/JPPEL-07-2019-0039.
games. We have also developed this Game using Unity 3D [7] Y. Chang, E. Iakovou, and W. Shi, “Blockchain in
Development Platform, programming language contract using global supply chains and cross border trade: a
critical synthesis of the state-of-the-art, challenges
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2023.3327581
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. For more information, see https://creativecommons.org/licenses/by-nc-nd/4