Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum
The selfdestruct function is provided by Ethereum smart contracts to destroy a contract on the blockchain system. However, it is a double-edged sword for developers. On the one hand, using the selfdestruct function enables developers to remove smart contracts (SCs) from Ethereum and transfers Ethers...
Saved in:
Main Authors: | , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2022
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/7669 https://ink.library.smu.edu.sg/context/sis_research/article/8672/viewcontent/2005.07908.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-8672 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-86722023-01-10T03:40:35Z Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum CHEN, Jiachi XIA, Xin LO, David GRUNDY, John C. The selfdestruct function is provided by Ethereum smart contracts to destroy a contract on the blockchain system. However, it is a double-edged sword for developers. On the one hand, using the selfdestruct function enables developers to remove smart contracts (SCs) from Ethereum and transfers Ethers when emergency situations happen, e.g., being attacked. On the other hand, this function can increase the complexity for the development and open an attack vector for attackers. To better understand the reasons why SC developers include or exclude the selfdestruct function in their contracts, we conducted an online survey to collect feedback from them and summarize the key reasons. Their feedback shows that 66.67% of the developers will deploy an updated contract to the Ethereum after destructing the old contract. According to this information, we propose a method to find the self-destructed contracts (also called predecessor contracts) and their updated version (successor contracts) by computing the code similarity. By analyzing the difference between the predecessor contracts and their successor contracts, we found five reasons that led to the death of the contracts; two of them (i.e., Unmatched ERC20 Token and Limits of Permission) might affect the life span of contracts. We developed a tool named LIFESCOPE to detect these problems. LifeScope reports 0 false positives or negatives in detecting UNMATCHED ERC20 Token. In terms of Limits of Permission, LIFESCOPE achieves 77.89% of F-measure and 0.8673 of AUC in average. According to the feedback of developers who exclude selfdestruct functions, we propose suggestions to help developers use selfdestruct functions in Ethereum smart contracts better. 2022-01-01T08:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/7669 info:doi/10.1145/3488245 https://ink.library.smu.edu.sg/context/sis_research/article/8672/viewcontent/2005.07908.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Smart contract Ethereum selfdestruct function empirical study Databases and Information Systems Numerical Analysis and Scientific Computing |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Smart contract Ethereum selfdestruct function empirical study Databases and Information Systems Numerical Analysis and Scientific Computing |
spellingShingle |
Smart contract Ethereum selfdestruct function empirical study Databases and Information Systems Numerical Analysis and Scientific Computing CHEN, Jiachi XIA, Xin LO, David GRUNDY, John C. Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
description |
The selfdestruct function is provided by Ethereum smart contracts to destroy a contract on the blockchain system. However, it is a double-edged sword for developers. On the one hand, using the selfdestruct function enables developers to remove smart contracts (SCs) from Ethereum and transfers Ethers when emergency situations happen, e.g., being attacked. On the other hand, this function can increase the complexity for the development and open an attack vector for attackers. To better understand the reasons why SC developers include or exclude the selfdestruct function in their contracts, we conducted an online survey to collect feedback from them and summarize the key reasons. Their feedback shows that 66.67% of the developers will deploy an updated contract to the Ethereum after destructing the old contract. According to this information, we propose a method to find the self-destructed contracts (also called predecessor contracts) and their updated version (successor contracts) by computing the code similarity. By analyzing the difference between the predecessor contracts and their successor contracts, we found five reasons that led to the death of the contracts; two of them (i.e., Unmatched ERC20 Token and Limits of Permission) might affect the life span of contracts. We developed a tool named LIFESCOPE to detect these problems. LifeScope reports 0 false positives or negatives in detecting UNMATCHED ERC20 Token. In terms of Limits of Permission, LIFESCOPE achieves 77.89% of F-measure and 0.8673 of AUC in average. According to the feedback of developers who exclude selfdestruct functions, we propose suggestions to help developers use selfdestruct functions in Ethereum smart contracts better. |
format |
text |
author |
CHEN, Jiachi XIA, Xin LO, David GRUNDY, John C. |
author_facet |
CHEN, Jiachi XIA, Xin LO, David GRUNDY, John C. |
author_sort |
CHEN, Jiachi |
title |
Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
title_short |
Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
title_full |
Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
title_fullStr |
Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
title_full_unstemmed |
Why do smart contracts self-destruct? Investigating the selfdestruct function on Ethereum |
title_sort |
why do smart contracts self-destruct? investigating the selfdestruct function on ethereum |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2022 |
url |
https://ink.library.smu.edu.sg/sis_research/7669 https://ink.library.smu.edu.sg/context/sis_research/article/8672/viewcontent/2005.07908.pdf |
_version_ |
1770576411217625088 |