Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
evm-audit-helpers — Collection of Solidity snippets and Foundry scripts for smart contract security audits | Kitploit
Tools/GitLabGitLab/dannydoodlesstory/evm-audit-helpers
Static AnalysisVulnerability AnalysisCode AnalysisDevSecOpsLearning & EducationCurated Resources
GitLabdannydoodlesstory/evm-audit-helpers

evm-audit-helpers

Collection of Solidity snippets and Foundry scripts for smart contract security audits

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
View Repository
2h 48m agoNot yet reviewed
Share

evm-audit-helpers

GitHub license
GitHub stars
Foundry version
Build Status


Overview

evm-audit-helpers is a curated collection of Solidity snippets, Foundry scripts, and test templates designed to accelerate EVM smart‑contract security audits. The repository bundles reusable building blocks for common audit concerns such as reentrancy, storage layout mismatches, and gas‑optimisation pitfalls, allowing auditors and developers to focus on logic rather than boiler‑plate.

Key goals:

  • Speed up audit preparation with ready‑made checks and patterns.
  • Ensure consistency across audit reports by providing standard test suites.
  • Facilitate learning through well‑documented examples and best‑practice guidelines.

Features

CategoryDescriptionPrimary Files
Reentrancy CheckersHelper modifiers, nonReentrant patterns, and runtime detection scripts.src/helpers/Reentrancy.sol, scripts/reentrancy_check.sol
Storage Layout AnalyzerUtilities to compare storage slots, generate layout diagrams, and detect unsafe upgrades.src/helpers/StorageLayout.sol, scripts/storage_analyzer.sol
Foundry Test TemplatesBoilerplate test suites covering common vulnerabilities (access control, arithmetic, delegatecall, etc.).test/templates/*
Gas & Opcode AuditsScripts to profile gas usage and flag expensive opcodes.scripts/gas_profiler.sol
Reporting HelpersJSON/Markdown reporters that can be piped into CI dashboards.scripts/report_generator.sol
CI IntegrationExample GitHub Actions workflow for automated audit runs..github/workflows/ci.yml

All helpers are written for Solidity ^0.8.20 and are compatible with Foundry (forge, cast).


Quickstart

root@kitploit:~
# 1️⃣ Clone the repository
git clone https://github.com/your-org/evm-audit-helpers.git
cd evm-audit-helpers

# 2️⃣ Install Foundry (if not already installed)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# 3️⃣ Install dependencies
forge install

# 4️⃣ Run the default test suite (includes reentrancy, storage, and gas checks)
forge test

Tip: Add export FOUNDRY_PROFILE=ci to your shell to use the CI‑optimised compiler settings.


Usage

1. Reentrancy Checks

root@kitploit:~
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "evm-audit-helpers/src/helpers/Reentrancy.sol";

contract MyVault is ReentrancyGuard {
    mapping(address => uint256) private balances;

    function deposit() external payable nonReentrant {
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint256 amount) external nonReentrant {
        require(balances[msg.sender] >= amount, "Insufficient");
        balances[msg.sender] -= amount;
        (bool ok,) = msg.sender.call{value: amount}("");
        require(ok, "Transfer failed");
    }
}

Run the runtime detector on a compiled contract:

root@kitploit:~
forge script scripts/reentrancy_check.sol:ReentrancyChecker --rpc-url $RPC_URL --broadcast

2. Storage Layout Analysis

root@kitploit:~
# Generate a JSON description of a compiled contract's storage layout
cast abi-storage --contract MyUpgradeable.sol:MyUpgradeable > storage.json

# Compare against a reference layout (e.g., from a previous version)
forge script scripts/storage_analyzer.sol:StorageComparator \
    --sig "compare(string memory, string memory)" storage.json reference.json

The script will output mismatched slots, potential shadowing, and suggestions for @custom:oz-upgrades-unsafe-allow annotations.

3. Foundry Test Templates

Copy a template into your audit repo:

root@kitploit:~
cp -r test/templates/reentrancy/ my-audit/tests/

Edit MyContract.t.sol to import the contract under audit and run:

root@kitploit:~
forge test --match-contract MyContract

4. CI Integration

Add the provided workflow to your repository:

root@kitploit:~
# .github/workflows/audit.yml
name: EVM Audit

on:
  push:
    branches: [main]
  pull_request:

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Foundry
        run: curl -L https://foundry.paradigm.xyz | bash && foundryup
      - name: Run Audit Suite
        run: |
          forge install
          forge test -vv
          forge script scripts/reentrancy_check.sol:ReentrancyChecker --rpc-url ${{ secrets.RPC_URL }}
          forge script scripts/storage_analyzer.sol:StorageComparator --sig "compare(string,string)" storage.json reference.json

The workflow will automatically flag failures and publish a markdown report as a PR comment.


Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository and create a feature branch (git checkout -b feat/<name>).
  2. Write tests for any new helper or bug‑fix. All new code must have 100 % coverage (forge coverage).
  3. Run the linting suite (npm run lint – uses solhint and prettier).
  4. Submit a Pull Request with a clear description, reference to an issue (if applicable), and a brief audit‑use‑case example.

Code Style

  • Solidity: pragma solidity ^0.8.20;
  • Use snake_case for internal functions, camelCase for public/external.
  • Document every public contract/interface with NatSpec (///).

Development Environment

root@kitploit:~
# Install linting tools
npm install

# Run solhint
npx solhint 'src/**/*.sol' 'test/**/*.sol'

# Auto‑format
npx prettier --write '**/*.sol'

License

evm-audit-helpers is licensed under the MIT License. See the LICENSE file for details.


Happy auditing!

Download Tool