With the increase of the adoption of blockchain technology in providing decentralized solutions to various problems, smart contracts have become more popular to the point that billions of US Dollars are currently exchanged every day through such technology. Meanwhile, various vulnerabilities in smart contracts have been exploited by attackers to steal cryptocurrencies worth millions of dollars. The automatic detection of smart contract vulnerabilities therefore is an essential research problem. Existing solutions to this problem particularly rely on human experts to define features or different rules to detect vulnerabilities. However, this often causes many vulnerabilities to be ignored, and they are inefficient in detecting new vulnerabilities. In this study, to overcome such challenges, we propose a framework to automatically detect vulnerabilities in smart contracts on the blockchain. More specifically, first, we utilize novel feature vector generation techniques from bytecode of smart contract since the source code of smart contracts are rarely available in public. Next, the collected vectors are fed into our novel metric learning-based deep neural network(DNN) to get the detection result. We conduct comprehensive experiments on large-scale benchmarks, and the quantitative results demonstrate the effectiveness and efficiency of our approach.
翻译:随着采用链式技术来提供分散解决各种问题的办法的增多,智能合同变得更加受欢迎,以至于目前每天通过这种技术交换数十亿美元;同时,攻击者利用智能合同中的各种弱点来窃取价值数百万美元的密码;因此,自动发现智能合同弱点是一个重要的研究问题;这一问题的现有解决办法特别依靠人类专家来界定特征或不同的规则来发现脆弱性;然而,这往往造成许多弱点被忽视,而且它们在发现新的弱点方面效率低下;为克服这种挑战,我们提议了一个框架,以自动发现智能合同中的弱点;更具体地说,我们利用智能合同的原始编码生成新特征矢量技术,因为智能合同的原始编码很少在公众中提供;其次是,收集的矢量被注入到我们新的基于学习的深神经网络(DNNN)中,以获得检测结果。我们进行了大规模基准的全面试验,量化结果显示了我们的方法的有效性和效率。