logic-errors

Analyze Solidity smart contracts for protocol logic bugs and invariant violations.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill logic-errors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logic-errors
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/vulnerability-patterns/logic-errors
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill logic-errors

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps identify and prevent critical logic errors in smart contracts, which are often the cause of significant financial losses in DeFi.

Core Features & Use Cases

  • Vulnerability Pattern Analysis: Detects common logic flaws like incorrect state machines, order of operations errors, and accounting mistakes.
  • Real-World Exploit Examples: Provides case studies of major hacks (Nomad, Compound) to illustrate the impact of logic bugs.
  • Detection Checklist & Heuristics: Offers a systematic approach to finding logic bugs through code review and invariant checking.
  • Use Case: A developer can use this Skill to proactively audit their new smart contract code, ensuring it adheres to secure coding practices and avoids common pitfalls that have led to past exploits.

Quick Start

Review the provided Solidity code for potential logic errors and state machine vulnerabilities.

Frequently Asked Questions about logic-errors

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

FAQPage Schema
How do I find logic errors in Solidity smart contracts?

To detect logic errors in Solidity smart contracts, review the code for incorrect state transitions, accounting errors, and precision loss using pattern matching against known exploit case studies. This systematic analysis identifies invariant violations and protocol bugs.

What are common smart contract logic bugs that lead to DeFi exploits?

Common smart contract logic bugs include incorrect state machines, order of operations errors, and accounting mistakes. These protocol logic flaws and invariant violations have caused significant financial losses in major DeFi hacks like Nomad and Compound.

How do I check my smart contract for state transition and accounting vulnerabilities?

Check smart contracts for state transition and accounting vulnerabilities by applying detection checklists and heuristics during code review. This involves systematically verifying invariants and matching code patterns against known exploit case studies to ensure secure development.

How do I fix precision loss and accounting errors in smart contracts?

Fix precision loss and accounting errors in smart contracts by applying remediation strategies derived from detection checklists. These strategies correct protocol logic flaws and invariant violations identified through systematic code review and pattern analysis.

Can I audit my Solidity code for invariant violations without external dependencies?

Yes, you can audit Solidity code for invariant violations without external dependencies by using pattern matching and exploit case studies. This approach provides detection checklists to find logic bugs and protocol errors through direct code review.