Cost Minimization of Solidity Smart Contracts on Blockchain Systems

  • Lee, Wan Yeon (Dept. of Computer Science, Dongduk Women's University)
  • Received : 2020.05.07
  • Accepted : 2020.05.15
  • Published : 2020.06.30


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.


  1. Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, Cryptography Mailing list at, 2009.
  2. Gavin Wood (2014) Ethereum: A secured decentralized generalized transaction ledger, Ethereum project yellow paper 151: 1-32.
  3. Ethereum Smart Contract Security Best Practices,
  4. EOS Smart Contract Security Best Practices,
  5. 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:
  6. 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.
  7. OpenZeppelin,
  8. 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:
  9. 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:
  10. Estimating Transaction Costs of Ethereum,
  11. Transaction Fees of Klaytn,
  12. Step Estimation of ICON,
  13. EOSIO Developer Portal,
  14. Hyperledger Fabric,