More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Solidity Smart Contract Security & Gas Auditor

    2

    Institutional-grade Solidity security and gas optimization skill for Cursor and Claude Code. Detects reentrancy, access control bypasses, unchecked calls, and storage gas waste with line-by-line remediation code.

    Free

    Security scanned
    Solidity Smart Contract Security & Gas Auditor

    Solidity Smart Contract Security & Gas Auditor

    Example session with this skill installed

    Please audit our VaultDeposit.sol contract for reentrancy vulnerabilities, access control bypasses, and storage gas optimizations before our upcoming testnet release.

    • Read your context and instructions
    • Compiled the solidity smart contract

    🛡️ Smart Contract Security & Gas Audit Report

    Contract Reviewed: VaultDeposit.sol
    Compiler Target: pragma solidity ^0.8.20;
    Audit Standard: SWC Registry & OpenZeppelin Best Practices


    1. Executive Summary

    SeverityCountStatus
    🔴 Critical1Immediate remediation required
    🟠 High1Action required before testnet
    🟡 Medium0None detected
    ⚡ Gas Optimization2~4,200 gas savings per deposit/withdraw

    2. Security Findings & Remediation

    [CRIT-01] Classic Reentrancy in withdrawBalance()

    • Severity: 🔴 Critical (SWC-107)
    • Location: VaultDeposit.sol#L44-L51

    Impact: The contract issues a low-level external call msg.sender.call{value: amount}("") before decrementing userBalances[msg.sender]. A malicious contract can re-enter withdrawBalance() recursively to drain all vault assets.

    • Vulnerable Code:
    function withdrawBalance(uint256 amount) external {
        require(userBalances[msg.sender] >= amount, "Insufficient balance");
        (bool sent, ) = msg.sender.call{value: amount}(""); // Interaction before effect
        require(sent, "Transfer failed");
        userBalances[msg.sender] -= amount;
    }
    
    • Remediation (Checks-Effects-Interactions Pattern):
    function withdrawBalance(uint256 amount) external nonReentrant {
        require(userBalances[msg.sender] >= amount, "Insufficient balance");
        userBalances[msg.sender] -= amount; // Effect first
        (bool sent, ) = msg.sender.call{value: amount}("");
        require(sent, "Transfer failed");
    }
    

    [HIGH-01] Phishing Vulnerability via tx.origin Authorization

    • Severity: 🟠 High (SWC-115)
    • Location: VaultDeposit.sol#L22

    Impact: Using require(tx.origin == owner) allows an attacker contract to trick the contract owner into authorizing privileged withdrawals.

    • Remediation: Replace with require(msg.sender == owner, "Unauthorized");.

    3. Gas Optimizations

    [GAS-01] Storage Slot Packing in Contract Layout

    • Estimated Savings: 2,100 gas on initial storage allocation.
    • Location: VaultDeposit.sol#L12-L16

    Optimization: Group uint128 minimumDeposit and address feeReceiver into a single 32-byte storage slot rather than allocating 2 separate 32-byte words.


    4. Next Steps

    1. Apply the Checks-Effects-Interactions diff to line 48.
    2. Inherit OpenZeppelin's ReentrancyGuard.sol.
    3. Run invariant fuzz tests with Foundry (forge test --fuzz-runs 10000).

    Connects securely to your tools. The creator never sees your data.

    About this skill

    🛡️ Solidity Smart Contract Security & Gas Auditor

    Transform your AI coding agent (Cursor, Claude Code, Codex CLI) into an institutional-grade EVM security researcher.

    Writing smart contracts without an audit is an existential risk. This skill equips your agent with a structured, battle-tested auditing methodology designed to catch critical vulnerabilities, logic flaws, and gas inefficiencies before your code reaches testnet or mainnet.


    🔍 What This Skill Detects:

    • Reentrancy Attacks (SWC-107): Identifies cross-function and read-only reentrancy vectors where external calls precede state modifications. Enforces Checks-Effects-Interactions (CEI).
    • Authorization Bypasses (SWC-115): Flags dangerous tx.origin authentication vulnerable to phishing attacks.
    • Unchecked External Calls (SWC-104): Detects silent low-level call failures and enforces SafeERC20 wrapper logic for non-compliant tokens (e.g., USDT).
    • Flash Loan & Oracle Vulnerabilities (SWC-135): Pinpoints spot-price manipulation risks and recommends TWAP / Chainlink oracle integrations.
    • DoS & Block Gas Limits (SWC-128): Identifies unbounded loops over dynamic state arrays that could freeze contract operations.
    • Storage Slot Packing: Optimizes 32-byte storage layout (packing uint128, address, bool) to save up to 2,100 gas per state read/write.

    📦 What's Inside:

    • Core SKILL.md Engine: Multi-phase auditing protocol that drives the AI to generate structured executive summaries, severity tables, and before/after diffs.
    • SWC Vulnerability Reference Catalog: In-depth exploit mechanics and remediation patterns.
    • Standalone Static Analysis Script (quick_audit.py): Fast local scanner to pre-check codebases for dangerous patterns.

    🚀 Compatible Agents:

    Works natively with Claude Code, Cursor, Codex CLI, Gemini CLI, VS Code Copilot, and any agent supporting the open SKILL.md standard.

    Performs deep static pattern analysis, vulnerability detection, and gas profiling. Does not perform mathematical formal verification (e.g., Certora) or dynamic symbolic execution. Cannot simulate multi-protocol flash-loan economic game theory or off-chain oracle latency. Intended as a pre-deployment security gate; mission-critical main net contracts should always include human peer review.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Permissions

    Read Files
    Write Files

    File Scopes

    **/*.sol
    **/*.md

    This skill operates entirely locally within your IDE/workspace. It requires read access only to Solidity source files (**/*.sol) to analyze code logic, storage layouts, and vulnerability patterns, and write access to generate your markdown audit report (**/*.md). Zero network access, zero third-party telemetry, and zero external API dependencies.

    Listed14 days ago

    What's inside

    Frequently Asked Questions

    This skill performs a comprehensive security scan for SWC-registry vulnerabilities like reentrancy and access control flaws, while simultaneously identifying gas-saving opportunities through storage optimization and opcode analysis.

    It is designed for any EVM-compatible Solidity project, specifically those built using frameworks like Hardhat or Foundry and leveraging OpenZeppelin standard libraries.

    The skill provides a detailed audit report featuring severity rankings (Critical to Low), impact descriptions, and specific remediation code snippets to fix the identified issues.

    While this skill follows institutional-grade methodology for vulnerability detection, it does not perform formal verification and should be used as a robust pre-audit tool rather than a total replacement for a final third-party manual audit.

    Yes, the skill includes a dedicated gas protocol that reviews storage slot packing, constant/immutable usage, and custom error implementations to lower end-user transaction costs.

    Updates are handled automatically through the marketplace to ensure the detection matrix stays current with the latest Solidity compiler versions and newly discovered EVM attack vectors.

    New in Web3 & Crypto