Coder Social home page Coder Social logo

audit_helper's Introduction

audit_helper

Description

audit_helper is a Python3 helper script for Linux to automate some Foundry boilerplate set up in audit repositories.

Too many times have I found myself initialising Hardhat framework based audit repositories with my preferred audit framework Foundry.

Requirements

Python3

user@machine:~/ sudo apt install python3

Foundry

user@machine:~/ curl -L https://foundry.paradigm.xyz | bash

Installation

mkdir ~/audit_helper && cd ~/audit_helper
wget https://raw.githubusercontent.com/HardlyCodeMan/audit_helper/main/audit_helper
chmod u+x ~/audit_helper/audit_helper
echo 'export PATH="$PATH:~/audit_helper"' >> ~/.bashrc
source ~/.bashrc

Usage Example

user@machine:~/audit_repo$ audit_helper -c src/ -o test/ -p myTest_ -s -oz

The above bash command will:

  • initialise Foundry into the repository root (with -s)
  • remove the initial Counter.* files created automatically by foundry init
  • install the openzeppelin/openzeppelin-contracts (with -oz)
  • set the contract source in foundry.toml to src/ (with -c)
  • set the test source in foundry.toml to test/ (with -o)
  • create boilerplate test files
  • prefix the boilerplate test filenames with myTest_ (with -p)

Flags

--flag -flag Description
--help -h Display this menu
--version -v Print the version number
--contracts -c Location of contracts
--output -o Test output folder. (Default: test/)
--prefix -p Test file prefix (Default: "")
--setup -s Initialise Foundry project and edit foundry.toml accordingly
--openzeppelin -oz Requires -s flag. Initialize with OpenZeppelin-Contracts repository
--solmate -sm Requires -s flag. Initialize with Solate repository

Links

Issues and Improvements

Feel free to create issues to raise awareness of problems or feature implementation requests.

By all means please contribute fixes and features through pull requests.

audit_helper's People

Contributors

hardlycodeman avatar

Stargazers

 avatar Am0rfu5 avatar Trevor avatar  avatar Crystal_Alchemist avatar Eloi Manuel avatar Cathe avatar innertiaJP avatar  avatar Tadashi avatar Giuseppe Rodriguez avatar Phoenix avatar Bernd avatar Samater avatar natzuu avatar 0x0918 avatar BowTiedHeron avatar Tamjid avatar Camden avatar  avatar

Watchers

 avatar

audit_helper's Issues

Recursive folder checking

Some repositories have a nested contract folder structure.

Recursively checking the contract folder structure in locateSolidityFiles() will be a solution to this edge case.

Limit imports to the contract and Test.sol

To circumvent multiple edge cases and also redundant import cases, it is probably best to only import the base contract and Test.sol from Foundry.

Also limit function inclusion to only setUp() for now removing more edge cases.

Installation command issues

Need to cd into ~/audit_helper
wget command is incorrect, outputting wget stdout rather than the file
Path needs : not ;

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.