Gas Gauge
Gas Gauge is designed to focus on gas-related vulnerabilities of Solidity Smart Contracts. This tool contains three major algorithms.
Source Code
You can view our source code, benchmark, and experimental results as well as our case study on our Github repository.
Installation and Setup for Ubuntu
Prerequisite
$ sudo apt-get update
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository -y ppa:ethereum/ethereum
$ sudo apt-get update
$ sudo apt-get install -y solc
$ sudo apt-get install libssl-dev
$ sudo apt-get install -y python3-pip=9.0.1-2 python3-dev
$ sudo ln -s /usr/bin/python3 /usr/local/bin/python
$ sudo apt-get install -y pandoc
$ sudo apt-get install -y git
$ sudo apt-get install nodejs
$ sudo apt-get install npm
$ sudo apt install python-pip
$ sudo apt install python3-pip
$ pip install numpy
$ pip3 install numpy
Helper Tools:
1. Slither :
(Recommneded Method) Clone our repository and navigate to the folder “Slither”
$ sudo python3 setup.py install
Method 2:
$ pip3 install slither-analyzer
2. Truffle :
$ npm install -g truffle
$ npm install -g ganache-cli
If the installation fails, it is most likely because Node.js is using an older version. Please update it to the newest version and try installing Truffle and Ganache again.
3. solc-select :
$ pip3 install solc-select
Then install all the solc versions you need for your contracts (refer to the solc-select website) For exaplme to install version 0.8.1:
$ solc-select install 0.8.1
To run the tool:
- Clone our repository
- Modify run.py as needed
- run run.py :
$ python3 run.py
- The tool will generate a report in the file specified as “REPORT_PATH” in run.py