Eth2Vec is an analysis tool based on a neural network for natural language processing, and it outputs the existence and kind of vulnerabilities in a target smart contract code by only taking the code as input. Using Eth2Vec, you can analyze code of smart contracts quickly even without expert knowledge on smart contract vulnerabilities. The paper of Eth2Vec is published on https://arxiv.org/abs/2101.02377.
We implemented Eth2Vec by utilizing Kam1n0 version 2.0.0 (https://github.com/McGill-DMaS/Kam1n0-Community) and py-solc-x (https://pypi.org/project/py-solc-x/). You need to install Kam1n0 server before installing Eth2Vec.
- Create clone of Kam1n0 (https://github.com/McGill-DMaS/Kam1n0-Community) onto your local.
- Build Kam1n0 from the source code in
kam1n0
.
- Install py-solc-x (https://pypi.org/project/py-solc-x/).
- Create clone of Eth2Vec onto your local.
- Copy
app
of Eth2Vec tokam1n0/kam1n0-apps/src/main/java/ca/mcgill/sis/dmas/kam1n0
of Kam1n0. - Copy
bin
of Eth2Vec tokam1n0/kam1n0-resources
of Kam1n0. - Copy
DisassemblyFactoryIDA.java
incommons
of Eth2Vec tokam1n0/kam1n0-commons/src/main/java/ca/mcgill/sis/dmas/kam1n0/impl/disassembly
of Kam1n0. - Copy
WinUtils.java
incommons
of Eth2Vec tokam1n0/kam1n0-commons/src/main/java/ca/mcgill/sis/dmas/env
of Kam1n0. - Copy
js
of Eth2Vec tokam1n0/kam1n0-apps/target/classes/static
of Kam1n0. - Rebuild Kam1n0 with the copied files of Eth2Vec.
- Run a main method in
Kam1n0-Community/kam1n0/kam1n0-cli/src/main/java/ca/mcgill/sis/dmas/kam1n0/cli/Main.java
with an argment--start
.
This project is distributed under the Apache License Version 2.0. Please refer to LICENSE.txt for details.