Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1007 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 1007 Bytes

Gas Guard v0.2

image

Gas Guard is a straightforward bash script that identifies susceptible gas leak-vulnerable code using grep regex within smart contracts.

Usage

For a single input, use the -i flag

./gasGuard.sh -i contract.sol

And for multiple inputs, use the -mi flag

./gasGuard.sh -mi contract.sol another-contract.sol

Gas Optimization Issues

gasGuard is able to find vulnerable code related to the list below

  1. DEFAULT INITIALIZATION ISSUE
  2. CACHE ARRAY LENGTH OUTSIDE OF LOOP
  3. GREATER THAN 0 COMPARISON
  4. USE CUSTOM ERROR FOR OUTPUT
  5. USE ++i AND --i INSTEAD OF OTHER INC/DEC
  6. USE SHIFT Right/Left INSTEAD OF DIVISION/MULTIPLICATION
  7. USE CALLDATA INSTEAD OF MEMORY FOR FUNCTIONS
  8. USE ASSEMBLY TO CHECK FOR ADDRESS(0)

More are coming soon..

Demo Output

image