Skip to content
forked from duytai/sGuard

SGUARD: Towards Fixing Vulnerable Smart Contracts Automatically

License

Notifications You must be signed in to change notification settings

ASSERT-KTH/sGuard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Getting started

Clone the project to project_folder/ and install dependencies

cd project_folder/
npm install

Install solc-select and select the corresponding compiler version:

pip install solc-select

2. Usage

First select the correcponding compiler version. Then run sGuard with the give file:

solc-select use SOLC_VERSION --always-install
npm run dev FILEPATH [CONTRACT_NAME]

CONTRACT_NAME is optional. If CONTRACT_NAME is not provided, sGuard assumes the last contract in the file as the main contract.

Example

Patch contracts/sample.sol:

solc-select use 0.4.26 --always-install
npm run dev contracts/sample.sol

The fixed file is contracts/sample.fixed.sol

3. Docker

Install Docker image and test sample.sol

docker build -t sguard .
docker run --rm -v ./contracts:/sGuard/contracts assert/sguard contracts/sample.sol

About

SGUARD: Towards Fixing Vulnerable Smart Contracts Automatically

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.8%
  • Other 1.2%