Skip to main content
Log in

An exploratory study of smart contracts in the Ethereum blockchain platform

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

Ethereum is a blockchain platform that supports smart contracts. Smart contracts are pieces of code that perform general-purpose computations. For instance, smart contracts have been used to implement crowdfunding initiatives that raised a total of US$6.2 billion from January to June of 2018. In this paper, we conduct an exploratory study of smart contracts. Differently from prior studies that focused on particular aspects of a subset of smart contracts, our goal is to have a broader understanding of all contracts that are currently deployed in Ethereum. In particular, we elucidate how frequently used the contracts are (activity level), what they do (category), and how complex they are (source code complexity). To conduct this study, we mined and cross-linked data from four sources: Ethereum dataset on the Google BigQuery platform, Etherscan, State of the DApps, and CoinMarketCap. Our study period runs from July 2015 (inception of Ethereum) until September 2018. With regards to activity level, we notice that it is concentrated on a very small subset of the contracts. More specifically, only 0.05% of the smart contracts are the target of 80% of the transactions that are sent to contracts. New solutions to cope with Ethereum’s limited scalability should take such an activity imbalance into consideration. With regards to categories, we highlight that the new and widely advertised rich programming model of smart contracts is currently being used to develop very simple applications that tend to be token-centric (e.g., ICOs, Crowdsales, etc). Finally, with regards to code complexity, we observe that the source code of high-activity verified contracts is small, with at most 211 instructions in 80% of the cases. These contracts also commonly include at least two subcontracts and libraries in their source code. The comment ratio of these contracts is also significantly higher than that of GitHub top-starred projects written in Java, C++, and C#. Hence, the source code of high-activity verified smart contracts exhibit particular complexity characteristics compared to other popular programming languages. Further studies are necessary to uncover the actual reasons behind such differences. Finally, based on our findings, we propose an open research agenda to drive and foster future studies in the area.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19

Similar content being viewed by others

Notes

  1. The dollar amount reported considers the exchange rate during which the crowdfunding took place (Jul 22th 2014 until Sep 2nd 2014). We proceed analogously for all other crowdfunding amounts reported in this paper. More information is available at: https://cryptoslate.com/coins/ethereum/

  2. Market capitalization is the multiplication of a company’s shares by its current stock price. In the virtual coin world, a company’s share corresponds to the total coin supply. As of August 3rd 2018, Ethereum has a total ether supply of 101,104,524 with a market price of US$418.26 per ether, yielding an impressive market capitalization of US$42.3 billion. More information is available at https://coinmarketcap.com/currencies/ethereum/historical-data

  3. https://entethalliance.org

  4. https://icowatchlist.com/

  5. https://cryptokitties.co

  6. https://kittysales.herokuapp.com

  7. https://bigquery.cloud.google.com/dataset/bigquery-public-data:ethereum_blockchain

  8. https://etherscan.io

  9. https://www.stateofthedapps.com

  10. https://coinmarketcap.com

  11. https://bitcoin.org

  12. https://ethereum.org

  13. https://eos.io

  14. https://www.poa.network

  15. https://www.jelurida.com/nxt

  16. https://www.hyperledger.org/projects/fabric

  17. https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ

  18. https://solidity.readthedocs.io

  19. Example of a transaction that created a smart contract: https://etherscan.io/tx/0xebcbe706f9959c8b98a72bcd42fed545d3cf60fe3fa801186d5fef2249dac91ahttps://etherscan.io/tx/0xebcbe706f9959c8b98a72bcd42fed545d3cf60fe3fa801186d5fef2249dac91a

  20. https://etherscan.io/apis#contracts

  21. Examples include IDEX (https://idex.market), ForkDelta (https://forkdelta.app), and Bancor (https://www.bancor.network). IDEX is described in Appendix.

  22. https://etherscan.io/apis#contracts

  23. https://etherscan.io/source-code-usage-terms

  24. https://github.com/federicobond/solidity-parser-antlr

  25. https://cran.r-project.org/web/packages/classInt

  26. https://www.youtube.com/watch?v=u-i_mTwL-FI

  27. http://ftreporter.com/attention-please-fomo-games-are-clogging-ethereum/

  28. https://www.ethereum.org/token

  29. https://medium.com/cryptokitties/unexpected-kitty-fleas-91c565547b11

  30. https://www.reddit.com/r/EtherDelta/comments/6kdiyl/smart_contract_overview

  31. https://etherscan.io/address/0xe68b7aa92f5a71184bfcb42f2a5ec5711e16afe7#code

  32. https://etherscan.io/address/0x0777f76d195795268388789343068e4fcd286919#code

  33. Example tx: 0x1fc8cd67cbbf6e96d64c0dca84b5cb420b0837ff74bfe2f1c9547d45a58b aa0a

  34. https://etherscan.io/chart/etherprice

  35. Contract address: 0xc244d24a3293150709913ce8377dc2854a3ec4a1

  36. Contract address: 0xac9efefb9de2d2aa0e1bcaada95480fe29f23c42

  37. The addresses of these top-5 contracts are:

    0xcea2b9186ece677f9b8ff38dc8ff792e9a9e7f8a (325,000 ETH),

    0x69c6dcc8f83b196605fa1076897af0e7e2b6b044 (275,010 ETH),

    0xeca56d04546affcec0b3ce61971136f497866a3b (188,000 ETH),

    0x4b25b370aa62d408bc2c87598289b59d1140545f (124,424 ETH),

    0xeb2227d932aa85a0855613f870bb1b7fdc4b8af6 (104,145.1 ETH)

  38. https://consensys.github.io/smart-contract-best-practices

  39. https://github.com/dapphub/dappsys

  40. https://openzeppelin.com/contracts

  41. https://github.com/melonproject/oyente

  42. https://www.youtube.com/channel/UCpEUyenjL908MFMCO-J_yhw

  43. https://securify.ch

  44. https://coinmarketcap.com/currencies/eos

  45. https://developers.eos.io/eosio-nodeos/docs/docker-quickstart

  46. The genesis cat is displayed at https://www.cryptokitties.co/kitty/1. The purchase transaction can be seen at https://etherscan.io/tx/0xf365be10a326b894cc13ddd3edf55a2db6ec517e1af83741df61fb9b09b37118.

  47. https://tronscan.org

References

  • Bartoletti M, Pompianu L (2017) An empirical analysis of smart contracts: platforms, applications, and design patterns. In: Brenner M, Rohloff K, Bonneau J, Miller A, Ryan PY, Teague V, Bracciali A, Sala M, Pintore F, Jakobsson M (eds) Financial cryptography and data security. Springer International Publishing, Cham, pp 494–509

  • Bartoletti M, Carta S, Cimoli T, Saia R (2017) Dissecting ponzi schemes on Ethereum: identification, analysis, and impact. arXiv:1703.03779

  • BBC (2017) CryptoKitties craze slow down transactions on Ethereum. https://www.bbc.com/news/technology-42237162, [Online; accessed 26-August-2018]

  • Buterin V (2018) Layer 1 should be innovative in the short term but less in the long term. https://vitalik.ca/general/2018/08/26/layer_1.html, [Online (constantly evolving); accessed 10-August-2018]

  • Chen W, Zheng Z, Cui J, Ngai E, Zheng P, Zhou Y (2018) Detecting ponzi schemes on Ethereum: towards healthier blockchain technology. In: Proceedings of the 2018 world wide web conference, international world wide web conferences steering committee. Republic and Canton of Geneva, Switzerland, WWW ’18, pp 1409–1418. https://doi.org/10.1145/3178876.3186046

  • Economist T (2018) Blockchain technology may offer a way to re-decentralise the internet. https://www.economist.com/special-report/2018/06/30/blockchain-technology-may-offer-a-way-to-re-decentralise-the-internet, [Online; accessed 10-August-2018]

  • Evans JD (1995) Straightforward statistics for the behavioral sciences. Brooks/Cole Pub Co

  • Fröwis M, Böhme R (2017) In code we trust? In: Garcia-Alfaro J, Navarro-Arribas G, Hartenstein H, Herrera-Joancomartí J (eds) Data privacy management, cryptocurrencies and blockchain technology. Springer International Publishing, Cham, pp 357–372

  • Galea A (2017) Ethereum CryptoKitties: by the numbers. https://medium.com/@galea/crypto-kitties-by-the-numbers-6d3bbd791aac, [Online; accessed 26-August-2018]

  • Grech N, Brent L, Scholz B, Smaragdakis Y (2019) Gigahorse: thorough, declarative decompilation of smart contracts. In: Proceedings of the 41st international conference on software engineering, ICSE ’19. IEEE Press, Piscataway, pp 1176–1186, DOI https://doi.org/10.1109/ICSE.2019.00120

  • Grishchenko I, Maffei M, Schneidewind C (2018) Foundations and tools for the static analysis of Ethereum smart contracts. In: Chockler H, Weissenbacher G (eds) Computer aided verification. Springer International Publishing, Cham, pp 51–78

  • Gudgeon L, Moreno-Sanchez P, Roos S, McCorry P, Gervais A (2019) Sok: off the chain transactions. IACR Cryptology ePrint Archive 2019:360. https://eprint.iacr.org/2019/360

  • Jakobsson M, Juels A (1999) Proofs of work and bread pudding protocols. In: Proceedings of the IFIP TC6/TC11 joint working conference on secure information networks: communications and multimedia security, CMS ’99. http://dl.acm.org/citation.cfm?id=647800.757199. Kluwer, B.V., Deventer, pp 258–272

  • Jenks GF, Caspall FC (1971) Error on choroplethic maps: definition, measurement, reduction. Ann Assoc Am Geogr 61(2):217–244. https://doi.org/10.1111/j.1467-8306.1971.tb00779.x

    Article  Google Scholar 

  • Kalra S, Goel S, Dhawan M, Sharma S (2018) ZEUS: analyzing safety of smart contracts. In: 25th Annual network and distributed system security symposium, NDSS 2018. The Internet Society, NDSS ’18, San Diego

  • Kaminska I (2017) It’s not just a Ponzi, it’s a ‘smart’ Ponzi. https://ftalphaville.ft.com/2017/06/01/2189634/its-not-just-a-ponzi-its-a-smart-ponzi/, [Online; accessed 26-August-2018]

  • Luu L, Chu DH, Olickel H, Saxena P, Hobor A (2016) Making smart contracts smarter. In: Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, CCS ’16. ACM, New York, pp 254–269, DOI https://doi.org/10.1145/2976749.2978309

  • Marr B (2018) 35 Amazing real world examples of how blockchain is changing our world. https://www.forbes.com/sites/bernardmarr/2018/01/22/35-amazing-real-world-examples-of-how-blockchain-is-changing-our-world, [Online; accessed 26-August-2018]

  • McCabe TJ (1976) A complexity measure. IEEE Trans Softw Eng 2(4):308–320. https://doi.org/10.1109/TSE.1976.233837

    Article  MathSciNet  MATH  Google Scholar 

  • Munaiah N, Kroh S, Cabrey C, Nagappan M (2017) Curating github for engineered software projects. Empir Softw Eng 22(6):3219–3253. https://doi.org/10.1007/s10664-017-9512-6

    Article  Google Scholar 

  • Popper N (2017) Understanding Ethereum, Bitcoin’s virtual cousin. https://www.nytimes.com/2017/10/01/technology/what-is-Ethereum.html, [Online; accessed 10-August-2018]

  • Richmond F (2018) Exposing blockchain: an inside look at the technology behind smart contracts, cryptocurrency wallets, cryptocurrency mining, Bitcoin and other digital coins (Ethereum Litecoin, Ripple and More). Independently published

  • Romano J, Kromrey J, Coraggio J, Skowronek J (2006) Appropriate statistics for ordinal level data: should we really be using t-test and Cohen’sd for evaluating group differences on the NSSE and other surveys? In: Annual meeting of the Florida Association of Institutional Research, pp 1–3

  • Russell J (2017) The first ICO unicorns are here. https://techcrunch.com/2017/08/31/the-first-ico-unicorns-are-here/, [Online; accessed 26-August-2018]

  • Sorkin AR (2010) Too big to fail: the inside story of how wall street and washington fought to save the financial system–and themselves. Penguin Books

  • Swan M (2015) Blockchain: blueprint for a new economy, 1st edn. O’Reilly Media, Inc

  • Szabo N (1994) Smart contracts. http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html, [Online; accessed 26-August-2018]

  • Tikhomirov S, Voskresenskaya E, Ivanitskiy I, Takhaviev R, Marchenko E, Alexandrov Y (2018) Smartcheck: static analysis of Ethereum smart contracts. In: Proceedings of the 1st international workshop on emerging trends in software engineering for blockchain, WETSEB ’18. ACM, New York, pp 9–16, DOI https://doi.org/10.1145/3194113.3194115

  • Tonelli R, Destefanis G, Marchesi M, Ortu M (2018) Smart contracts software metrics: a first study. arXiv:1802.01517

  • Vilner Y (2018) 5 blockchain product use cases to follow this year. https://www.forbes.com/sites/yoavvilner/2018/06/27/5-blockchain-product-use-cases-to-follow-this-year, [Online; accessed 26-August-2018]

  • Wan Z, Lo D, Xia X, Cai L (2017) Bug characteristics in blockchain systems: a large-scale empirical study. In: Proceedings of the 14th international conference on mining software repositories, MSR ’17. IEEE Press, Piscataway, pp 413–424, DOI https://doi.org/10.1109/MSR.2017.59

  • Wood G (2017) Ethereum: a secure decentralised generalised transaction ledger - EIP-150 revision. http://yellowpaper.io/, [Online; accessed 10-August-2018]

  • Zheng P, Zheng Z, Luo X, Chen X, Liu X (2018) A detailed and real-time performance monitoring framework for blockchain systems. In: Proceedings of the 40th international conference on software engineering: software engineering in practice, ICSE-SEIP ’18. ACM, New York, pp 134–143, DOI https://doi.org/10.1145/3183519.3183546

Download references

Acknowledgements

This research has been supported by the Natural Sciences and Engineering Research Council (NSERC). This study leveraged the computational resources provided by the Microsoft Azure for Research program.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gustavo A. Oliva.

Additional information

Communicated by: Arie van Deursen

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix: The Top-10 Most Active Contracts on Ethereum

Appendix: The Top-10 Most Active Contracts on Ethereum

The top two contracts are part of decentralized currency exchange ÐApps. The webpage of IDEX is shown in Fig. 20. On the left-hand side, we can see the list of cryptocurrencies that are supported by IDEX. On the right-hand side, it shows the price chart and volume of exchanges for the cryptocurrency that we selected (AURA). Right below the price chart, we can see options for buying and selling aura (using Ether). We highlight that both etherdelta_2 and IDEX_1 contracts do not define a token of their own (check column “Own Token"). Instead, they operate on cryptocurrency tokens created by other contracts.

Fig. 20
figure 20

A screenshot of the IDEX currency exchange ÐApp

The third contract was an ICO for the EOS token. It was a crowdfunding initiative for the EOSIO project, whose goal is to build a new blockchain platform that can process millions of transactions per second. As of August 2018, the EOS token is one of the most valuable cryptocurrencies with a market capitalization of US$5 billion.Footnote 44 The EOSIO blockchain has been released as open source software and stable versions are already available. A convenient quickstart guide providing a Docker image is available at the EOSIO Developer portal.Footnote 45

The fourth contract is part of a game ÐApp called CryptoKitties. This contract deals with core aspects of the game and has a higher number of lines of code compared to the others in our list. CryptoKitties is considered the first game to achieve widespread success on the Ethereum platform. As described in their website, “CryptoKitties is a game centered around breedable, collectible, and oh-so-adorable creatures we call CryptoKitties! Each cat is one-of-a-kind and 100% owned by you; it cannot be replicated, taken away, or destroyed”. The game is clearly in the realm of digital collectibles, allowing people to buy, sell, and trade CryptoKitties (similarly to traditional collectibles like trading cards). While the vast majority of cryptokitties sell for less than US$100, a few rare kitties sell for far more money (Galea 2017). For instance, one of the rarest kitties is the very first one created by the developers. The token representing this kitty was sold on December 2nd 2017 for US$113,082.15.Footnote 46 Figure 21 shows kitties for sale and Fig. 22 shows the profile of the second kitty (id #1044853).

Fig. 21
figure 21

The CryptoKitties game. The image shows rare Generation 0 kitties (i.e., those created by the developers of the game) for sale. Below each kitty is its unique identifier. After a kitty breeds with another kitty, it will be temporarily unable to breed again. The “Fast” tag below these kitties indicates that this recovery time is short for them (1 minute)

Fig. 22
figure 22

The profile of the kitty with ID 1044853 (check Fig. 21). At the top of the page, we can see the kitty’s name and its owner. The owner defines the start and end prices (similarly to an auction). Bio is a simple biography of the kitty. Catttributes are the attributes of the kitty, which indicate its rarity and also influence the profile of its children once it breads with another kitty

The fifth contract is called TronToken. It defines and manages the Tronix (TRX) token. This token is the cryptocurrency that was sold in the ICO to bootstrap the Tron project, which advertises itself as “one of the largest blockchain-based operating systems in the world”. The project raised US$70 million in the ICO (all tokens were sold). Ultimately, TRON is a domain-specific blockchain platform. Tron aims to be a content distribution platform for the digital entertainment industry, in which creators have the power to freely publish, store, and own their content, interacting directly with consumers. The selling point of Tron is making entertainment content easier to sell and cheaper to consume by removing the man-in-the-middle. The Tron project is already operational and people use the token contract to operate on the tokens (e.g., transfer tokens between accounts). The Tron blockchain can be explored by means of the TronScan website,Footnote 47 which operates analogously to the Etherscan.io website (Ethereum blockchain explorer).

The sixth contract is not verified, so its name is not available. However, searching for its address on Etherscan revealed that such a contract is part of the Poloniex Exchange ÐApp.

The seventh and eighth contracts are part of the Bittrex ÐApp, which is yet another cryptocurrency exchange. Interestingly, the Controller contract is used internally by the Bittrex company, as it manages the creation of wallets and other managerial tasks.

The ninth contract is an attempt to have a Bitcoin-like token in Ethereum. The key difference compared to regular Ethereum tokens is that it is mintable. Instead of issuing a supply of coins via an ICO or similar mechanism, the contract offers a mine() function that delivers 1 BTCM per call. And that’s the only way to generate coins. The contract allows only 50 calls to mine() per 10 minutes (across the whole Ethereum platform, not per client). The maximum supply allowed by the contract is capped at 21,000,000 BTCM (same as Bitcoin). This supply is projected to be achieved (minted) in 132 years.

Finally, the last contract OMGToken is the token contract for the OMG token, which was sold in an ICO to crowdfund the OmiseGO ÐApp. OmigoGo is yet another cryptocurrency exchange. The advisors of OmiseGo include Vitalin Buterin and Gavin Wood, who are the co-founders of Ethereum. The OmiseGo (OMG) token was the first Ethereum cryptocurrency to surpass a market capitalization of US$1 billion (later on, other coins achieved similar status) (Russell 2017).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Oliva, G.A., Hassan, A.E. & Jiang, Z.M.(. An exploratory study of smart contracts in the Ethereum blockchain platform. Empir Software Eng 25, 1864–1904 (2020). https://doi.org/10.1007/s10664-019-09796-5

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-019-09796-5

Keywords

Navigation