Coder Social home page Coder Social logo

d0nluka / c4udit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from byterocket/c4udit

0.0 0.0 0.0 22 KB

Static analyzer for solidity contracts based on regexs specifically crafted for code4rena contests

License: GNU General Public License v3.0

Go 100.00%

c4udit's Introduction

c4udit

Introduction

c4udit is a static analyzer for solidity contracts based on regular expressions specifically crafted for Code4Rena contests.

It is capable of finding low risk issues and gas optimization documented in the c4-common-issues repository.

Note that c4udit uses c4-common-issues's issue identifiers.

Installation

First you need to have the Go toolchain installed. You can find instruction here.

Then install c4udit with:

$ go install github.com/byterocket/c4udit@latest

To just build the binary:

$ git clone https://github.com/byterocket/c4udit
$ cd c4udit/
$ go build .

Now you should be able to run c4udit with:

$ ./c4udit

Usage

Usage:
	c4udit [flags] [files...]

Flags:
	-h    Print help text.
	-s    Save report as file.

Example

Running c4udit against the examples directory:

$ ./c4udit examples/
Files analyzed:
- examples/Test.sol

Issues found:
 G001:
  examples/Test.sol::4 => uint256 a = 0;
  examples/Test.sol::12 => for (uint256 i = 0; i < array.length; i++) {

 G002:
  examples/Test.sol::12 => for (uint256 i = 0; i < array.length; i++) {

 G007:
  examples/Test.sol::6 => string b = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

 G008:
  examples/Test.sol::13 => i = i / 2;

 L001:
  examples/Test.sol::16 => token.transferFrom(msg.sender, address(this), 100);

 L003:
  examples/Test.sol::1 => pragma solidity ^0.8.0;

Using the -s flag, c4udit will create a report in markdown format. For an example check out the report in the examples directory here.

License

Note that this tool is licensed as free software!

c4udit's People

Contributors

pmerkleplant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.