# A Non-Fungible Token and Blockchain-Based Cotton Lint Traceability Solution
## 6 Discussion
### Cost Analysis  
In this study, we perform a cost-benefit analysis of the gas consumption required to implement and deploy Ethernet smart contracts for the proposed solution. The focus is on evaluating the amount of GAS required by the different algorithms involved in the scenario to execute transactions and run the code on the Ethernet blockchain. Gas serves as a metric to measure the amount of work required to perform any operation on the blockchain--not as real money but as a unit of cost that users must pay when executing a smart contract or making a transaction. Through the gas mechanism, the Ethereum network can accurately calculate and quantify the costs of various operations, ensuring that users pay for the network resources that they occupy, including the execution cost of directly executing an operation and the transaction cost of confirming a transaction. The value of the gas cost is closely related to the execution time complexity and space complexity of the algorithm in the Ethernet Virtual Machine (EVM). In order to accurately estimate the actual gas usage limit of the smart contract, we conduct a series of simulation experiments using the Remix IDE. By repeatedly simulating the execution of Ether transactions and accumulating the transaction costs and execution costs during each transaction, we obtain comprehensive gas consumption estimations. As of 19 January 2024, based on the ETH Gas Station (2024) data, the Gwei-priced gas fees on the Ether network were 20 Gwei for slow execution, 20 Gwei for average execution and 35 Gwei for fast execution. When converted at the then prevailing exchange rate of 1 ETH = USD 2483.33, the unit prices corresponding to these three types of execution speeds would be approximately USD 0.000597, USD 0.000597 and USD 0.000869. Table 2 summarises the execution and transaction costs of the various functions within our solution, with the highest costs mainly arising from the smart contract deployment phase. This cost input is justified because smart contracts are deployed in the system on a one-off basis. Among them, the function mintNFT has the highest relative cost charges among the corresponding smart contracts, which are USD 11.17, USD 10.26 and USD 13.05, respectively. This is because they need to process the string information input provided by the user, thus incurring higher execution costs, in line with expectations. In contrast, the auctionStart function, which is the least expensive to implement and whose primary function is to announce the start of the auction to the stakeholders, is relatively simple and therefore requires a smaller cost. When performing functions in an Ethereum blockchain environment, the gas costs are high and are associated with the high price volatility of Ethereum, which not only creates high cost pressures but also introduces the possibility of fee uncertainty and price instability. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Contract** & **Function** & **Cost (Gas)** & **Cost (ETH)** & **Cost (USD)** \\ \hline \multirow{4}{*}{SeedCottonNFT} & deployment & 523,440 & 0.0105 & 25.99 \\  & mintNFT & 224,971 & 0.0045 & 11.17 \\  & approvalTransfer & 51,829 & 0.0010 & 2.57 \\  & setBuyer & 53,751 & 0.0011 & 2.67 \\ \hline \multirow{4}{*}{LintNFT} & deployment & 638,757 & 0.0128 & 31.72 \\  & mintNFT & 206,481 & 0.0041 & 10.26 \\  & approvalTransfer & 54,925 & 0.0011 & 2.73 \\  & setBuyer & 51,668 & 0.0010 & 2.57 \\ \hline \multirow{4}{*}{Market} & deployment & 433,117 & 0.0087 & 21.51 \\  & auctionStart & 43,563 & 0.0009 & 2.16 \\ \cline{1-1}  & bidPlaced & 155,581 & 0.0031 & 7.73 \\ \cline{1-1}  & auctionEnded & 87,235 & 0.0017 & 4.32 \\ \cline{1-1}  & shipment & 64,920 & 0.0013 & 3.22 \\ \hline \multirow{4}{*}{InspectionNFT} & deployment & 412,005 & 0.0082 & 20.46 \\ \cline{1-1}  & bindCertificate & 54,364 & 0.0011 & 2.70 \\ \cline{1-1}  & minNFT & 262,847 & 0.0053 & 13.05 \\ \cline{1-1}  & approvalEnquiry & 112,582 & 0.0023 & 5.99 \\ \hline \hline \end{tabular}
\end{table}