paper-with-me

홈 › Papers

Semantic Code Search for Smart Contracts

2021-11-28 · Chaochen Shi, Yong Xiang, Jiangshan Yu, Longxiang Gao

Semantic code search technology allows searching for existing code snippets through natural language, which can greatly improve programming efficiency. Smart contracts, programs that run on the blockchain, have a code reuse rate of more than 90%, which means developers have a great demand for semantic code search tools. However, the existing code search models still have a semantic gap between code and query, and perform poorly on specialized queries of smart contracts. In this paper, we propose a Multi-Modal Smart contract Code Search (MM-SCS) model. Specifically, we construct a Contract Elements Dependency Graph (CEDG) for MM-SCS as an additional modality to capture the data-flow and control-flow information of the code. To make the model more focused on the key contextual information, we use a multi-head attention network to generate embeddings for code features. In addition, we use a fine-tuned pretrained model to ensure the model's effectiveness when the training data is small. We compared MM-SCS with four state-of-the-art models on a dataset with 470K (code, docstring) pairs collected from Github and Etherscan. Experimental results show that MM-SCS achieves an MRR (Mean Reciprocal Rank) of 0.572, outperforming four state-of-the-art models UNIF, DeepCS, CARLCS-CNN, and TAB-CS by 34.2%, 59.3%, 36.8%, and 14.1%, respectively. Additionally, the search speed of MM-SCS is second only to UNIF, reaching 0.34s/query.

📄 PDF Abstract BibTeX arXiv:2111.14139

Code (0)

등록된 구현이 없습니다.

Tasks

Code Search

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
SPEED The monocular depth estimation (MDE) is the task of estimating depth from a single frame. This information is an essential knowledge in many computer vision tasks such as scene…

Similar Papers 제목 키워드 기반

Languages for Smart and Computable Contracts

2021-04-08 · Christopher D. Clack

Smart Contracts use computer technology to automate the performance of aspects of commercial agreements. Yet how can there be confidence that the computer code is faithful to the intentions of the parties? To understand …

A Bytecode-based Approach for Smart Contract Classification

2021-05-31 · Chaochen Shi, Yong Xiang, Robin Ram Mohan Doss, Jiangshan Yu 외

With the development of blockchain technologies, the number of smart contracts deployed on blockchain platforms is growing exponentially, which makes it difficult for users to find desired services by manual screening. T…

ClassificationEnsemble Learningfeature selection

Multi-Class classification of vulnerabilities in Smart Contracts using AWD-LSTM, with pre-trained encoder inspired from natural language processing

2020-03-21 · Ajay K. Gogineni, S. Swayamjyoti, Devadatta Sahoo, Kisor K. Sahu 외

Vulnerability detection and safety of smart contracts are of paramount importance because of their immutable nature. Symbolic tools like OYENTE and MAIAN are typically used for vulnerability prediction in smart contracts…

Binary ClassificationGeneral ClassificationMulti-class ClassificationVulnerability Detection

Deep Smart Contract Intent Detection

2022-11-19 · Youwei Huang, Sen Fang, Jianwen Li, Jiachun Tao 외

In recent years, research in software security has concentrated on identifying vulnerabilities in smart contracts to prevent significant losses of crypto assets on blockchains. Despite early successes in this area, detec…

Intent DetectionMulti-Label ClassificationMUlTI-LABEL-ClASSIFICATIONSentence+1

Semantic Interoperability on Blockchain by Generating Smart Contracts Based on Knowledge Graphs

2024-09-11 · William Van Woensel, Oshani Seneviratne

Background: Health 3.0 allows decision making to be based on longitudinal data from multiple institutions, from across the patient's healthcare journey. In such a distributed setting, blockchain smart contracts can act a…

Code GenerationDecision MakingKnowledge Graphs