solidity-security

Harden Solidity smart contracts against reentrancy, overflow, and access control vulnerabilities.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Jhabbig/Habbig --skill solidity-security-jhabbig
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solidity-security
Source: https://github.com/Jhabbig/Habbig/tree/main/.claude/plugins/wshobson/blockchain-web3/skills/solidity-security
Command: npx skills add https://github.com/Jhabbig/Habbig --skill solidity-security-jhabbig

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you prevent costly smart contract vulnerabilities by applying secure Solidity patterns before deployment or audit review.

Core Features & Use Cases

  • Reentrancy Defense: Identifies unsafe external-call flows and rewrites them with checks-effects-interactions or reentrancy guards.
  • Access Control Hardening: Protects critical functions with ownership, roles, and explicit validation so only authorized actors can execute sensitive actions.
  • Protocol Safety Review: Supports secure DeFi and on-chain application design by covering overflow protection, front-running mitigation, pull payments, and emergency stops.
  • Use Case: If you are preparing a token, vault, or trading contract for production, this Skill helps you spot common exploit paths and convert them into safer implementations.

Quick Start

Ask the assistant to review your Solidity contract for security flaws and rewrite the vulnerable functions using secure patterns and audit-ready documentation.

Frequently Asked Questions about solidity-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent reentrancy attacks in my Solidity smart contract?

To prevent reentrancy attacks in Solidity, apply the checks-effects-interactions pattern or integrate reentrancy guards to secure unsafe external-call flows. This ensures state changes execute before external calls, blocking malicious recursive withdrawals.

What is the best way to implement access control in DeFi protocols?

Implementing access control in DeFi protocols requires role-based authorization and explicit input validation. Protect critical functions with ownership roles and explicit validation so only authorized actors execute sensitive contract actions.

How do I secure a Solidity vault contract before an audit?

Secure a Solidity vault contract before an audit by applying secure patterns like SafeMath or Solidity 0.8 overflow checks, pull payments, and emergency pause mechanisms. This converts common exploit paths into safer implementations.

Does Solidity 0.8 automatically handle integer overflow protection?

Solidity 0.8 includes built-in overflow checks, replacing the need for SafeMath. However, securing smart contracts still requires mitigating front-running vulnerabilities, validating inputs, and implementing checks-effects-interactions for external calls.

Can I add an emergency stop to an Ethereum smart contract?

Yes, you can add an emergency stop to an Ethereum smart contract by implementing pause mechanisms. This protocol safety feature allows authorized actors to halt critical functions during an exploit or vulnerability discovery.

Why does my smart contract need pull payments to prevent front-running?

Pull payments prevent front-running and certain reentrancy exploits by forcing users to withdraw their assets independently rather than pushing funds automatically. This validates interactions and separates external calls from state changes.