- Volume 9 Issue 2
Recently the blockchain technology has been actively studied due to its great potentiality. The smart contract is a key mechanism of the blockchain system. Due to the short history of the smart contract, many issues have not been solved yet. One main issue is vulnerability and another main issue is cost optimization. While the vulnerability of smart contract has been actively studied, the cost optimization has been rarely studied. In this paper, we propose two cost optimization methods for smart contracts running on the blockchain system. Triggering a function in a smart contract program code may require costs and it is repeated continuously. So the minimization of costs required to trigger a function of smart contract while maintaining the performance equally is very important. The proposed two methods minimize the usage of expensive permanent variables deployed on the blockchain system. We apply the proposed two methods to three prevalent blockchain platforms: Ethereum, Klaytn and Tron. Evaluation experiments verify that the proposed scheme significantly reduces the costs of functions in the smart contract written with Solidity.
- Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, Cryptography Mailing list at https://metzdowd.com, 2009.
- Gavin Wood (2014) Ethereum: A secured decentralized generalized transaction ledger, Ethereum project yellow paper 151: 1-32.
- Ethereum Smart Contract Security Best Practices, https://consensys.github.io/smart-contract-best-practices/
- EOS Smart Contract Security Best Practices, https://github.com/slowmist/eos-smart-contract-security-bestpractices/blob/master/README_EN.md
- S. Kalra, S. Goel, M. Dhawan and S. Sharma, "ZEUS: Analyzing Safety of Smart Contracts," Annual Network and Distributed System Security Symposium, vol. 25, Feb. 2018, DOI: https://doi.org/10.14722/ndss.2018.23092
- Sunbeom So, Myungho Lee, Jisu Park, Heejo Lee and Hakjoo Oh, "VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contract," IEEE Symposium on Security and Privacy, vol. 41, May 2020.
- OpenZeppelin, https://openzeppelin.com/contracts/
- Ting Chen, Xiaoqi Li, Xiapu Luo, Xiaosong Zhang, "Under-optimized Smart Contracts Devour Your Money," IEEE International Conference on Software Analysis, Evolution and Reengineering, vol. 24, Feb 2017, DOI: https://doi.org/10.1109/SANER.2017.7884650
- Wan Yeon Lee and Yun-Seok Choi, "Vulnerability and Cost Analysis of Heterogeneous Smart Contract Programs in Blockchain Systems," Current Trends in Computer Sciences and Applications (Mar. 2020), vol. 2, no. 1, pp. 142-145, DOI: https://doi.org/10.32474/CTCSA.2020.02.000126
- Estimating Transaction Costs of Ethereum, http://ethdocs.org/en/latest/contracts-and-transactions/account-typesgas-and-transactions.html#estimating-transaction-costs
- Transaction Fees of Klaytn, https://docs.klaytn.com/klaytn/design/transaction-fees
- Step Estimation of ICON, https://www.icondev.io/docs/transaction-fees
- EOSIO Developer Portal, https://developers.eos.io/
- Hyperledger Fabric, https://www.hyperledger.org/projects/fabric