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
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.
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
Install Docker image and test sample.sol
docker build -t sguard .
docker run --rm -v ./contracts:/sGuard/contracts assert/sguard contracts/sample.sol