<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Heemin Kim</title>
    <description>The latest articles on DEV Community by Heemin Kim (@h33min).</description>
    <link>https://dev.to/h33min</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3868792%2F38fe00c2-ccb6-4892-9d19-b5d53e4611eb.jpeg</url>
      <title>DEV Community: Heemin Kim</title>
      <link>https://dev.to/h33min</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/h33min"/>
    <language>en</language>
    <item>
      <title>Business Logic Flaws: The Silent Killer of DeFi Security in 2026</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Tue, 14 Apr 2026 13:23:28 +0000</pubDate>
      <link>https://dev.to/h33min/business-logic-flaws-the-silent-killer-of-defi-security-in-2026-4efo</link>
      <guid>https://dev.to/h33min/business-logic-flaws-the-silent-killer-of-defi-security-in-2026-4efo</guid>
      <description>&lt;p&gt;In the first quarter of 2026, the DeFi ecosystem continues to thrive, but it also faces a chilling reality. An analysis of major hacking incidents over the past three months reveals an interesting shift. While past hacks primarily focused on typical code defects like 'Reentrancy' or 'Integer Overflow,' this year, &lt;strong&gt;'Business Logic Flaws'&lt;/strong&gt; have emerged as the most lethal threat.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Quiet Raider of 2026: Business Logic Errors
&lt;/h2&gt;

&lt;p&gt;According to recently collected data (Risk Feed), a significant number of large-scale asset drain incidents earlier this year exploited logical design flaws in smart contracts.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. AlkemiEarn — 43.45 ETH Drained (March 2026)
&lt;/h3&gt;

&lt;p&gt;The AlkemiEarn case was a classic business logic error. There was a logical flaw in how collateral value was calculated within the protocol's lending logic. Attackers exploited this to borrow significantly more assets than their actual collateral and vanished. The code operated "normally," but the "logic" itself was the problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. SynapLogic — Business Logic Flaw (January 2026)
&lt;/h3&gt;

&lt;p&gt;SynapLogic was also victimized by a business logic vulnerability. A logical path was discovered where permission checks could be bypassed under certain conditions, allowing attackers to access core system settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Static Analysis Alone Isn't Enough
&lt;/h2&gt;

&lt;p&gt;Excellent static analysis tools like Slither or Semgrep are great at looking at the "shape of the code." However, they struggle to answer questions like, "Is it business-logically correct for this variable to change this way after this function is called?"&lt;/p&gt;

&lt;p&gt;Business logic flaws are difficult to detect for the following reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context Dependency&lt;/strong&gt;: General pattern matching is difficult because unique rules vary by protocol.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complexity of State Changes&lt;/strong&gt;: It requires tracking state changes that occur through a complex interplay of multiple functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ambiguity in Permission Management&lt;/strong&gt;: The more complex the logic of who can do what and when, the easier it is for gaps to appear.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ContractScan's Multi-Defense Strategy
&lt;/h2&gt;

&lt;p&gt;ContractScan takes an approach beyond simple scanning to identify these 'invisible threats.'&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mythril (Symbolic Execution)&lt;/strong&gt;: Mathematically explores all possible execution paths of the code to find logical paths that can lead to abnormal states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI (LLM-based Code Reasoning)&lt;/strong&gt;: Goes beyond simple pattern matching to understand the 'intent' of the code. AI can point out logical contradictions by understanding interactions between functions and the business context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-world Case Mapping (Case-based Detection)&lt;/strong&gt;: We index over 680 real-world hacking cases. If code with a logical structure similar to cases like AlkemiEarn or SynapLogic is found, an immediate alert is sent.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Auditor's Advice
&lt;/h2&gt;

&lt;p&gt;To minimize business logic flaws as a smart contract developer, you must adhere to the following principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principle of Least Privilege&lt;/strong&gt;: Set clear access controls for every function and do not grant more permissions than necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Define Invariants&lt;/strong&gt;: Define core rules that the system must always maintain (e.g., "Total supply must always be less than total collateral") and include logic to verify them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify with Diverse Engines&lt;/strong&gt;: Do not rely on a single tool. Combine static analysis, symbolic execution, and AI-based reviews.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🛡️ Scan Your Contract Now
&lt;/h3&gt;

&lt;p&gt;ContractScan uses Slither, Mythril, Aderyn, Semgrep, and AI engines to perform an in-depth analysis of your code in under 5 minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;Scan My Contract for Free&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Important Notes&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;The content of this post is for educational and informational purposes only and does not constitute financial or legal advice. ContractScan is a tool to reduce security risks and does not guarantee the discovery of all vulnerabilities. It is strongly recommended to undergo a manual audit by a professional security firm before deploying high-value projects. We assume no legal liability for any losses incurred through the use of this service.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>defi</category>
      <category>security</category>
      <category>blockchain</category>
      <category>smartcontracts</category>
    </item>
    <item>
      <title>Beyond MythX: Smart Contract Security Roadmap for 2026</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:54:44 +0000</pubDate>
      <link>https://dev.to/h33min/beyond-mythx-smart-contract-security-roadmap-for-2026-j8j</link>
      <guid>https://dev.to/h33min/beyond-mythx-smart-contract-security-roadmap-for-2026-j8j</guid>
      <description>&lt;p&gt;MythX shut down on March 31. For many Solidity teams, that meant scrambling to replace CI pipelines, SDK integrations, and audit workflows overnight. Our &lt;a href="https://dev.to/blog/mythx-shutdown-migration-guide"&gt;migration guide&lt;/a&gt; covered the immediate fix.&lt;/p&gt;

&lt;p&gt;But the MythX shutdown is a symptom of a bigger shift. The smart contract security landscape is changing in ways that matter for every builder deploying code on-chain. This post covers where things are heading — and what we're building at ContractScan to stay ahead of it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Post-MythX Landscape
&lt;/h2&gt;

&lt;p&gt;MythX was one of the first commercial smart contract security services. It combined Mythril's symbolic execution with proprietary analysis layers behind a paid API. When it shut down, it left a gap — but also exposed a problem with the single-vendor model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson&lt;/strong&gt;: relying on a single security tool, behind a single company's API, is a single point of failure. When MythX went dark, teams that only used MythX had zero coverage overnight.&lt;/p&gt;

&lt;p&gt;The move toward open, multi-engine approaches isn't just a trend — it's a risk mitigation strategy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Trend 1: Multi-Engine Scanning Becomes the Default
&lt;/h2&gt;

&lt;p&gt;No single analysis engine catches every vulnerability class. This has been proven repeatedly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine Type&lt;/th&gt;
&lt;th&gt;Catches&lt;/th&gt;
&lt;th&gt;Misses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Static analysis&lt;/strong&gt; (Slither)&lt;/td&gt;
&lt;td&gt;Reentrancy, access control, state variable issues&lt;/td&gt;
&lt;td&gt;Complex cross-contract logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Symbolic execution&lt;/strong&gt; (Mythril)&lt;/td&gt;
&lt;td&gt;Path-dependent bugs, integer overflows&lt;/td&gt;
&lt;td&gt;Large contracts (timeout)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Pattern matching&lt;/strong&gt; (Semgrep)&lt;/td&gt;
&lt;td&gt;Known vulnerability patterns, custom rules&lt;/td&gt;
&lt;td&gt;Novel attack vectors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AI analysis&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Business logic flaws, context-dependent issues&lt;/td&gt;
&lt;td&gt;May miss low-level EVM edge cases&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Drift Protocol exploit ($285M, Q1 2026) involved governance key compromise — something no static tool would catch, though AI analysis of admin privilege patterns could have flagged the risk surface. Classic reentrancy bugs, by contrast, are textbook cases that static analysis flags instantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where this is going&lt;/strong&gt;: scanning with 2-3 engines is no longer "nice to have." It's the minimum for any contract holding real value. ContractScan already runs five engines in parallel (Slither, Mythril, Semgrep, Aderyn, and AI). The next step is smarter synthesis — not just merging results, but using cross-engine correlation to reduce false positives and elevate findings that multiple engines agree on.&lt;/p&gt;




&lt;h2&gt;
  
  
  Trend 2: AI Moves Beyond Pattern Matching
&lt;/h2&gt;

&lt;p&gt;Early AI integration in security tools was essentially "run GPT on the findings list." That's table stakes now. The real value of AI in security analysis is catching things that rule-based tools fundamentally cannot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Business logic violations&lt;/strong&gt;: a lending protocol that allows borrowing without sufficient collateral under specific state combinations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Economic attack paths&lt;/strong&gt;: flash loan sequences that manipulate price oracles across multiple pools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-function state issues&lt;/strong&gt;: where function A's side effects create an exploitable condition in function B&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ContractScan's AI engine currently uses Gemini by default (with BYOK support for Claude and GPT). But the model is less important than what you feed it. We're working on giving the AI engine richer context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Threat intelligence&lt;/strong&gt;: our database of 686 real DeFi hack incidents — sourced from &lt;a href="https://github.com/SunWeb3Sec/DeFiHackLabs" rel="noopener noreferrer"&gt;DeFiHackLabs&lt;/a&gt; and supplemented by a live feed collector — categorized across attack types, informs AI analysis. When the AI sees a pattern that resembles a known exploit, it cites the reference hack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-contract awareness&lt;/strong&gt;: analyzing not just the target contract, but its interactions with external protocols and oracles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Severity calibration&lt;/strong&gt;: training on real-world loss data to better distinguish "theoretically possible" from "practically exploitable."&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Trend 3: Security Shifts Left Into Developer Workflows
&lt;/h2&gt;

&lt;p&gt;The traditional audit model — write code, deploy to testnet, hire an auditor, wait weeks, get a PDF — is too slow for how DeFi teams actually ship. Security needs to be part of the development loop, not a gate at the end.&lt;/p&gt;

&lt;h3&gt;
  
  
  IDE Integration
&lt;/h3&gt;

&lt;p&gt;Catching a reentrancy bug in your editor is cheaper than catching it in a $50K audit. The upcoming &lt;strong&gt;Hardhat plugin&lt;/strong&gt; will let you scan during development:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Coming soon&lt;/span&gt;
&lt;span class="c"&gt;# npm install --save-dev hardhat-contractscan&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;VS Code extension and MCP server integration are next on the roadmap — the goal is security feedback as fast as linting.&lt;/p&gt;

&lt;h3&gt;
  
  
  CI/CD as Security Gate
&lt;/h3&gt;

&lt;p&gt;Every PR that touches Solidity should trigger a scan. This isn't new advice, but the tooling is finally good enough to make it practical without drowning in false positives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# GitHub Actions — scan on every PR&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ContractScan Security Check&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;curl -X POST https://contract-scanner.raccoonworld.xyz/ci/scan \&lt;/span&gt;
      &lt;span class="s"&gt;-F "file=@contracts/MyContract.sol" \&lt;/span&gt;
      &lt;span class="s"&gt;-H "X-Api-Key: ${{ secrets.CONTRACTSCAN_API_KEY }}" \&lt;/span&gt;
      &lt;span class="s"&gt;--fail-with-body&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  MCP: AI Agents as Security Reviewers
&lt;/h3&gt;

&lt;p&gt;The newest development is Model Context Protocol (MCP) integration. The idea: AI coding assistants like Claude Code call a local ContractScan MCP server during development, getting structured scan results back inline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Scan this contract for vulnerabilities before I deploy."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We've built the ContractScan MCP server and it's installable today from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; contractscan_mcp/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PyPI publication and Smithery registry listing are in progress — not live yet. If you want to try it now, the &lt;a href="https://github.com/contractscan/contractscan" rel="noopener noreferrer"&gt;source install path&lt;/a&gt; works.&lt;/p&gt;




&lt;h2&gt;
  
  
  Trend 4: Multi-Chain Is No Longer Optional
&lt;/h2&gt;

&lt;p&gt;Solidity dominates, but the ecosystem is diversifying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rust/Near&lt;/strong&gt;: ContractScan already supports Rust smart contracts via AI-powered analysis. Static analysis tooling for Rust contracts is less mature than Solidity, making AI coverage especially valuable here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move (Sui/Aptos)&lt;/strong&gt;: growing ecosystem with distinct vulnerability patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stylus (Arbitrum)&lt;/strong&gt;: Rust-based smart contracts on Ethereum L2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The challenge is that each language has different vulnerability classes. Reentrancy looks different in Rust than in Solidity. Access control patterns vary by chain. Security tools need to understand these differences, not just apply Solidity rules to everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our approach&lt;/strong&gt;: Rust/Near AI analysis is live today. Expanding static analysis support for non-Solidity languages is on the roadmap, prioritized by ecosystem TVL and developer adoption.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We're Building Next
&lt;/h2&gt;

&lt;p&gt;Transparency about direction matters, especially after MythX showed what happens when a tool disappears without warning. Here's what's actively in progress at ContractScan:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Priority&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Now&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cross-engine finding correlation&lt;/td&gt;
&lt;td&gt;Reduce noise, elevate high-confidence findings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Now&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MCP server PyPI/Smithery listing&lt;/td&gt;
&lt;td&gt;Source install works today; registry publication in progress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Next&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VS Code extension&lt;/td&gt;
&lt;td&gt;Real-time security feedback in editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Next&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Enhanced threat intelligence&lt;/td&gt;
&lt;td&gt;Link findings to specific historical exploits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Later&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Move language support&lt;/td&gt;
&lt;td&gt;Follow ecosystem TVL growth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Later&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Foundry fuzz integration&lt;/td&gt;
&lt;td&gt;Combine static analysis with dynamic testing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We're a small team. That means we ship fast but have to be ruthless about priorities. If you're building on a chain or using a workflow we don't support yet, &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;tell us&lt;/a&gt; — real usage data drives the roadmap.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;The MythX era was about paying for a black-box API. The next era is about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Multi-engine by default&lt;/strong&gt; — no single tool is enough&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI as a first-class analysis layer&lt;/strong&gt; — not a summary bot, but a reasoning engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security in the development loop&lt;/strong&gt; — IDE, CI/CD, and AI assistant integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-chain readiness&lt;/strong&gt; — Solidity-only is a shrinking percentage of the market&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're migrating from MythX, start with a &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;free QuickScan&lt;/a&gt; to see how multi-engine scanning compares to what you had. If you're already using ContractScan, the features above are what's coming next.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;ContractScan is a multi-engine smart contract security scanner. QuickScan is free and unlimited — no sign-up required. &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;Try it now&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>web3</category>
    </item>
    <item>
      <title>MythX Shutdown: Migration Guide for Smart Contract Security Teams</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:54:38 +0000</pubDate>
      <link>https://dev.to/h33min/mythx-shutdown-migration-guide-for-smart-contract-security-teams-1phg</link>
      <guid>https://dev.to/h33min/mythx-shutdown-migration-guide-for-smart-contract-security-teams-1phg</guid>
      <description>&lt;p&gt;If you've been using MythX for smart contract security analysis, the deadline has passed: &lt;strong&gt;MythX (ConsenSys Diligence) officially shut down on March 31, 2026.&lt;/strong&gt; API access is offline, and existing scans no longer function.&lt;/p&gt;

&lt;p&gt;This post walks you through migrating to &lt;strong&gt;ContractScan&lt;/strong&gt; — a free alternative that combines Slither static analysis, Semgrep pattern matching, and AI-powered vulnerability detection in a single scan.&lt;/p&gt;




&lt;h2&gt;
  
  
  MythX Is Now Offline
&lt;/h2&gt;

&lt;p&gt;MythX was a cloud-based smart contract analysis platform by ConsenSys Diligence. As of April 1, 2026:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All MythX API endpoints are offline&lt;/li&gt;
&lt;li&gt;Existing CI/CD pipelines using &lt;code&gt;mythx-cli&lt;/code&gt; or the MythX SDK are failing&lt;/li&gt;
&lt;li&gt;Paid subscriptions are no longer active&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have active GitHub Actions or Hardhat plugins built around MythX, they need to be replaced immediately.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why ContractScan Is a Strong MythX Alternative
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;MythX&lt;/th&gt;
&lt;th&gt;ContractScan&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Static analysis&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ Slither&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Symbolic execution&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ Mythril (optional)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pattern-based detection&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅ Semgrep&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI-powered analysis&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅ Claude AI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free tier&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Unlimited QuickScan, no sign-up&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI/CD integration&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ (Pro plan)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;ContractScan runs &lt;strong&gt;multiple engines in parallel&lt;/strong&gt; and synthesizes results into a single report with a security score, issue severity breakdown, and AI-generated remediation suggestions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quickstart: Scan Your First Contract
&lt;/h2&gt;

&lt;p&gt;No account required. Visit &lt;strong&gt;&lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/strong&gt; and paste your Solidity code directly, or scan by contract address.&lt;/p&gt;

&lt;p&gt;For example, to scan the canonical reentrancy vulnerability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.8.0;
contract Vault {
    mapping(address =&amp;gt; uint) public balances;

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

    function withdraw() public {
        (bool ok,) = msg.sender.call{value: balances[msg.sender]}("");
        require(ok);
        balances[msg.sender] = 0; // state updated AFTER external call — reentrancy bug
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ContractScan will flag the reentrancy pattern, explain the exploit path, and suggest the Checks-Effects-Interactions fix — all in one report.&lt;/p&gt;




&lt;h2&gt;
  
  
  Replacing MythX in Your GitHub Actions CI/CD
&lt;/h2&gt;

&lt;p&gt;The fastest free replacement for MythX in CI is &lt;strong&gt;Slither&lt;/strong&gt; via the official GitHub Action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# FREE: Slither static analysis (replaces MythX static layer)&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Slither&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crytic/slither-action@v0.4.0&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contracts/'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Slither is the open-source static analyzer from Trail of Bits that MythX was partially built on. It catches most of the same vulnerability patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  ContractScan CI API (Paid Plans)
&lt;/h3&gt;

&lt;p&gt;For teams that want Slither + AI analysis + multi-engine scanning in CI, ContractScan offers a CI/CD API on paid plans:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ContractScan CI scan (requires Pro/Enterprise API key)&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run ContractScan&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;curl -X POST https://contract-scanner.raccoonworld.xyz/ci/scan \&lt;/span&gt;
      &lt;span class="s"&gt;-F "file=@contracts/MyContract.sol" \&lt;/span&gt;
      &lt;span class="s"&gt;-H "X-Api-Key: ${{ secrets.CONTRACTSCAN_API_KEY }}" \&lt;/span&gt;
      &lt;span class="s"&gt;--fail-with-body&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CI endpoint returns structured JSON with severity levels (&lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;critical&lt;/code&gt;), matching MythX's SWC-level severity model. Use the response to fail your pipeline on findings above your threshold.&lt;/p&gt;

&lt;p&gt;You can also scan contracts for free on the &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;web UI&lt;/a&gt; — unlimited QuickScans, no account needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Migrating from the MythX Python SDK
&lt;/h2&gt;

&lt;p&gt;If you used the MythX Python client directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# OLD: MythX SDK (deprecated)
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;mythx_cli.client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Client&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;analyze&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source_files&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Vault.sol&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ContractScan offers a Python-compatible MCP tool and a REST API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scan via REST API (no auth required for free tier)&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://contract-scanner.raccoonworld.xyz/api/scan &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"source": "pragma solidity ^0.8.0; contract Vault {...}"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use the &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan MCP server&lt;/a&gt; inside Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scan contracts/Vault.sol for security vulnerabilities using ContractScan.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What the ContractScan Report Looks Like
&lt;/h2&gt;

&lt;p&gt;A typical scan result includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security Score&lt;/strong&gt; (0–100): overall contract health&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Findings by severity&lt;/strong&gt;: Critical / High / Medium / Low / Informational&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-issue details&lt;/strong&gt;: affected lines, exploit description, SWC reference (compatible with MythX's taxonomy)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI remediation&lt;/strong&gt;: concrete code fix suggestions from Claude AI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF export&lt;/strong&gt;: audit-ready report for client delivery&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pricing
&lt;/h2&gt;

&lt;p&gt;ContractScan's free tier offers &lt;strong&gt;unlimited QuickScans&lt;/strong&gt; with no sign-up. For full multi-engine scans (Slither + Mythril + Semgrep + AI), upgrade to &lt;strong&gt;Pro at $59/mo&lt;/strong&gt; or use &lt;strong&gt;Pay-per-scan at $11.90/scan&lt;/strong&gt;. See the &lt;a href="https://contract-scanner.raccoonworld.xyz/pricing" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt; for details.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;MythX shutting down is disruptive, but migrating is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Immediately&lt;/strong&gt;: replace MythX GitHub Action with ContractScan's action&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;This week&lt;/strong&gt;: test your contracts at contract-scanner.raccoonworld.xyz (free, no account needed)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before March 31&lt;/strong&gt;: remove all &lt;code&gt;mythx-cli&lt;/code&gt; or MythX SDK references from your pipeline&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ContractScan combines the static analysis depth you relied on from MythX with AI-powered insights that catch logic-level vulnerabilities symbolic execution misses. And it's free to start today.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;ContractScan is a smart contract security scanner. Free tier: unlimited QuickScans, no sign-up. CI/CD API and VS Code extension coming soon.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>smartcontracts</category>
    </item>
    <item>
      <title>The $285M Drift Hack: Q1 2026 DeFi Security Review</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:49:16 +0000</pubDate>
      <link>https://dev.to/h33min/the-285m-drift-hack-q1-2026-defi-security-review-53bb</link>
      <guid>https://dev.to/h33min/the-285m-drift-hack-q1-2026-defi-security-review-53bb</guid>
      <description>&lt;p&gt;Q1 2026 has already seen over $450 million drained from crypto projects. Then April started with the Drift Protocol exploit — $285 million gone in under an hour. Here's what happened and what it means for builders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drift Protocol: $285M in 60 Minutes
&lt;/h2&gt;

&lt;p&gt;On April 1, 2026, attackers compromised Drift Protocol, a Solana-based perpetual futures exchange, draining approximately $285 million. Drift's TVL dropped from $550M to under $300M, and the DRIFT token fell 40%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it happened:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The attacker gained unauthorized access to Drift's Security Council admin keys through a durable nonce exploit&lt;/li&gt;
&lt;li&gt;With admin control, they manipulated oracle price feeds&lt;/li&gt;
&lt;li&gt;Leveraged positions were liquidated at artificial prices, draining the protocol&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This was not a smart contract code vulnerability. It was a governance and infrastructure attack — the kind that no static analysis tool catches. The lesson: even audited code is only as secure as the keys that control it.&lt;/p&gt;

&lt;p&gt;Blockchain analytics firms Elliptic and TRM Labs independently linked the attack to DPRK-affiliated actors. TRM's investigation revealed on-chain staging began on March 11 with a 10 ETH withdrawal from Tornado Cash, consistent with patterns seen in previous state-sponsored exploits.&lt;/p&gt;

&lt;h2&gt;
  
  
  March 2026: $52M Across 20 Incidents
&lt;/h2&gt;

&lt;p&gt;Before Drift, March was already brutal. PeckShield reported $52 million in losses from 20 separate incidents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solv Protocol — $2.7M (Reentrancy)
&lt;/h3&gt;

&lt;p&gt;A classic reentrancy vulnerability in ERC-3525 deposit handling. The &lt;code&gt;onERC721Received&lt;/code&gt; callback triggered a second mint during the initial deposit flow, allowing the attacker to double-mint tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is exactly the type of bug that automated scanners catch.&lt;/strong&gt; Slither flags reentrancy patterns, and AI-powered analysis can identify the cross-function variant used here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Venus Protocol — $2M Bad Debt (Price Manipulation)
&lt;/h3&gt;

&lt;p&gt;An attacker spent months building a position in the Thena (THE) token market, then directly transferred tokens to the smart contract to manipulate exchange rates. The protocol was left holding $2M in bad debt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolv Labs — $23M (Private Key Compromise)
&lt;/h3&gt;

&lt;p&gt;Another key management failure. A compromised private key gave the attacker direct access to protocol funds.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pattern
&lt;/h2&gt;

&lt;p&gt;Looking at Q1 2026 attacks, three categories emerge:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attack Type&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Preventable by Code Audit?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code-level bugs&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Solv Protocol reentrancy&lt;/td&gt;
&lt;td&gt;Yes — static analysis + AI detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Oracle/price manipulation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Venus Protocol, Drift&lt;/td&gt;
&lt;td&gt;Partially — oracle dependency checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Key/governance compromise&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Resolv Labs, Drift&lt;/td&gt;
&lt;td&gt;No — requires operational security&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Code-level vulnerabilities remain the most preventable category. Reentrancy, unchecked return values, integer overflow, and access control flaws can all be caught before deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Can Do
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scan before you deploy.&lt;/strong&gt; Run static analysis on every contract. Reentrancy and access control bugs have no excuse in 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use multiple engines.&lt;/strong&gt; No single tool catches everything. Combine Slither, Semgrep, and AI-powered detection for broader coverage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check your dependencies.&lt;/strong&gt; If your contract interacts with external price feeds or governance contracts, audit those trust boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review admin access.&lt;/strong&gt; Timelocks, multisig requirements, and key rotation policies are not optional.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;ContractScan runs Slither + AI vulnerability detection on your Solidity code in under 5 minutes. Paste your code or enter a deployed contract address — no CLI setup required.&lt;/p&gt;

&lt;p&gt;QuickScan is free and unlimited — no signup required. Paid plans unlock all 5 engines (Slither, Mythril, Semgrep, Aderyn, and AI) for deeper coverage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;Scan your contract now&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>defi</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Live Threat Intelligence for Smart Contracts: How to Stay Ahead of Exploits</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:49:10 +0000</pubDate>
      <link>https://dev.to/h33min/live-threat-intelligence-for-smart-contracts-how-to-stay-ahead-of-exploits-3g3m</link>
      <guid>https://dev.to/h33min/live-threat-intelligence-for-smart-contracts-how-to-stay-ahead-of-exploits-3g3m</guid>
      <description>&lt;h1&gt;
  
  
  How ContractScan Tracks the Latest DeFi Hacks
&lt;/h1&gt;

&lt;p&gt;The biggest problem with smart contract security tools is that &lt;strong&gt;they're frozen in time&lt;/strong&gt;. Most scanners check your code against the ruleset that shipped with the tool. But DeFi hacks happen every week with new patterns.&lt;/p&gt;

&lt;p&gt;ContractScan is different. &lt;strong&gt;Every week, we automatically collect new hack incidents and update our analysis database.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Automatic Threat Intelligence System
&lt;/h2&gt;

&lt;p&gt;ContractScan's Risk Feed Collector pulls from these public sources:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Rekt.news RSS
&lt;/h3&gt;

&lt;p&gt;The go-to media outlet for DeFi security incidents. Publishes technical analysis reports within days of each hack.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collection frequency:&lt;/strong&gt; Weekly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Incident name, loss amount, vulnerability type, reference links&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. DeFiHackLabs (SunWeb3Sec)
&lt;/h3&gt;

&lt;p&gt;An open-source GitHub project that maintains PoC (Proof of Concept) exploit code. Systematically archives DeFi hack incidents from 2020 to present.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collection frequency:&lt;/strong&gt; Weekly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Incident name, date, loss amount, vulnerability classification, transaction hashes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. SWC Registry
&lt;/h3&gt;

&lt;p&gt;Smart Contract Weakness Classification — the standard taxonomy for smart contract vulnerabilities. New categories are automatically incorporated as they're added.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Current coverage:&lt;/strong&gt; 37 SWC categories&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Collection → Classification → Integration Pipeline
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Public Sources]  →  [Collector]  →  [Auto-Classification]  →  [Scan DB Update]
Rekt.news            Weekly          SWC mapping               defi_hacks DB
DeFiHackLabs         cron job        Keyword-based             Shown in scan reports
SWC Registry                         Categorization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Collected incidents are automatically classified by keyword:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Keyword&lt;/th&gt;
&lt;th&gt;Classification&lt;/th&gt;
&lt;th&gt;Example Incident&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;reentrancy, re-entrancy&lt;/td&gt;
&lt;td&gt;SWC-107&lt;/td&gt;
&lt;td&gt;Euler Finance ($197M)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;access control, onlyowner&lt;/td&gt;
&lt;td&gt;SWC-105&lt;/td&gt;
&lt;td&gt;Poly Network ($611M)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;flash loan, oracle&lt;/td&gt;
&lt;td&gt;Oracle Manipulation&lt;/td&gt;
&lt;td&gt;Mango Markets ($116M)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bridge, cross-chain&lt;/td&gt;
&lt;td&gt;Bridge Exploit&lt;/td&gt;
&lt;td&gt;Wormhole ($320M)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;delegatecall&lt;/td&gt;
&lt;td&gt;SWC-112&lt;/td&gt;
&lt;td&gt;Parity Wallet ($150M)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Limitation of Static Rulesets
&lt;/h3&gt;

&lt;p&gt;Traditional security tools only apply rules from their release date. If a new attack pattern is discovered in March 2026, that pattern goes undetected until the tool ships an update.&lt;/p&gt;

&lt;h3&gt;
  
  
  ContractScan's Approach
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;New incident occurs&lt;/strong&gt; → Reported by public sources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekly collector runs&lt;/strong&gt; → Automatically updates the DB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Applied from next scan&lt;/strong&gt; → Enhanced detection of similar patterns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real incident references in reports&lt;/strong&gt; → "This code matches a pattern similar to incident X"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Users always receive &lt;strong&gt;scan results that reflect the latest threat intelligence&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transparency
&lt;/h2&gt;

&lt;p&gt;ContractScan doesn't hide what sources it uses for analysis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All data sources are publicly available&lt;/li&gt;
&lt;li&gt;Classification logic is transparent and documented in scan reports&lt;/li&gt;
&lt;li&gt;Scan reports include referenced incidents and source links&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This transparency is the foundation of trust. Not a black box — you can verify &lt;strong&gt;what evidence led to what conclusion&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current Collection Status
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static DB:&lt;/strong&gt; 15+ major incidents (The DAO, Cream Finance, Euler Finance, Ronin Bridge, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic collection:&lt;/strong&gt; Automatic weekly updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total coverage:&lt;/strong&gt; 37 SWC categories + DeFi-specific patterns (Oracle Manipulation, Bridge Exploit)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SlowMist Hacked database integration&lt;/li&gt;
&lt;li&gt;Automatic Semgrep rule generation pipeline for new incidents&lt;/li&gt;
&lt;li&gt;Email alerts for subscribers when new vulnerabilities are detected&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;ContractScan isn't a "set it and forget it" tool. It's a &lt;strong&gt;living security tool&lt;/strong&gt;. Every week it learns about new threats and applies them to your next scan.&lt;/p&gt;

&lt;p&gt;Start scanning your smart contracts at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>defi</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Automating Smart Contract Security in Your CI/CD Pipeline</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:43:47 +0000</pubDate>
      <link>https://dev.to/h33min/automating-smart-contract-security-in-your-cicd-pipeline-5efj</link>
      <guid>https://dev.to/h33min/automating-smart-contract-security-in-your-cicd-pipeline-5efj</guid>
      <description>&lt;h2&gt;
  
  
  "I'll Just Scan Before Deployment" — That Mindset Is the Problem
&lt;/h2&gt;

&lt;p&gt;Running security checks only right before deployment leads to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discovering vulnerabilities at the last minute — skyrocketing fix costs&lt;/li&gt;
&lt;li&gt;Relying on humans to catch security issues during code review&lt;/li&gt;
&lt;li&gt;Skipping security scans for "quick fixes"&lt;/li&gt;
&lt;li&gt;Vulnerabilities getting merged into the main branch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Integrating security scans into CI/CD &lt;strong&gt;automatically detects vulnerabilities on every PR&lt;/strong&gt; and blocks merges when critical issues are found.&lt;/p&gt;




&lt;h2&gt;
  
  
  Basic Setup: Slither on Every PR
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Assumed Folder Structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-defi-project/
├── contracts/
│   ├── Token.sol
│   └── Vault.sol
├── hardhat.config.js
└── .github/
    └── workflows/
        └── security.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic Workflow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/security.yml&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Smart Contract Security Scan&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contracts/**/*.sol'&lt;/span&gt;  &lt;span class="c1"&gt;# Only run when Solidity files change&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;slither&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Slither Analysis&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Slither&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crytic/slither-action@v0.4.0&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;slither&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;contracts/&lt;/span&gt;
          &lt;span class="na"&gt;slither-args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--filter-paths&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;node_modules'&lt;/span&gt;
          &lt;span class="na"&gt;fail-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;high&lt;/span&gt;  &lt;span class="c1"&gt;# Fail CI on high severity or above&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload SARIF&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always()&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github/codeql-action/upload-sarif@v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;sarif_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.slither.outputs.sarif }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runs automatically on every PR that changes files in &lt;code&gt;contracts/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Fails the check when HIGH severity or above vulnerabilities are found (can block merge)&lt;/li&gt;
&lt;li&gt;Automatically uploads results to the GitHub Security tab&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Advanced Setup: Multi-Engine + PR Comments
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ContractScan API Integration
&lt;/h3&gt;

&lt;p&gt;ContractScan provides a CI/CD scan API (&lt;code&gt;/ci/scan&lt;/code&gt;) that works with any pipeline — GitHub Actions, GitLab CI, CircleCI, etc. Here's an example using GitHub Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/security-full.yml&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Full Security Scan&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contracts/**'&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;security-scan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ContractScan CI Scan&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;  &lt;span class="c1"&gt;# Permission to post PR comments&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run ContractScan API&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;scan&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;RESULT=$(curl -s -X POST https://contract-scanner.raccoonworld.xyz/ci/scan \&lt;/span&gt;
            &lt;span class="s"&gt;-F "file=@contracts/MyContract.sol" \&lt;/span&gt;
            &lt;span class="s"&gt;-H "X-Api-Key: ${{ secrets.CONTRACTSCAN_API_KEY }}")&lt;/span&gt;
          &lt;span class="s"&gt;echo "$RESULT" &amp;gt; scan-result.json&lt;/span&gt;
          &lt;span class="s"&gt;CRITICAL=$(echo "$RESULT" | jq '.severity_summary.Critical // 0')&lt;/span&gt;
          &lt;span class="s"&gt;echo "critical-count=$CRITICAL" &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Security Gate&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;steps.scan.outputs.critical-count &amp;gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "❌ Critical vulnerabilities found. Blocking merge."&lt;/span&gt;
          &lt;span class="s"&gt;exit 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the &lt;a href="https://dev.to/docs/ci"&gt;CI/CD integration docs&lt;/a&gt; for full API reference and examples for other CI systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example automated PR comment:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## ContractScan Security Report&lt;/span&gt;

🔴 &lt;span class="gs"&gt;**1 Critical**&lt;/span&gt; | 🟠 &lt;span class="gs"&gt;**2 High**&lt;/span&gt; | 🟡 &lt;span class="gs"&gt;**3 Medium**&lt;/span&gt;

&lt;span class="gu"&gt;### Critical Issues&lt;/span&gt;

&lt;span class="gs"&gt;**[SWC-107] Reentrancy in Vault.withdraw()**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; File: &lt;span class="sb"&gt;`contracts/Vault.sol:45`&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; The contract state is changed after an external call.
&lt;span class="p"&gt;-&lt;/span&gt; Fix: Apply Checks-Effects-Interactions pattern
&lt;span class="p"&gt;
---&lt;/span&gt;
Full report: &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;View on ContractScan&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://contract-scanner.raccoonworld.xyz/report/...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Branch Protection Rules
&lt;/h2&gt;

&lt;p&gt;In GitHub Settings → Branches → Branch protection rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select &lt;code&gt;main&lt;/code&gt; / &lt;code&gt;master&lt;/code&gt; branch&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Require status checks to pass before merging&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;Slither Analysis&lt;/code&gt; or &lt;code&gt;ContractScan CI Scan&lt;/code&gt; check&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Require branches to be up to date&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now PRs cannot be merged unless the security scan passes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Practical Severity Policies
&lt;/h2&gt;

&lt;p&gt;Failing CI on every finding creates too many false positives and blocks development. Recommended policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Apply different thresholds per environment&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;security-scan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;branch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
            &lt;span class="na"&gt;fail-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;high&lt;/span&gt;      &lt;span class="c1"&gt;# main branch: block on high and above&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;branch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;develop&lt;/span&gt;
            &lt;span class="na"&gt;fail-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;critical&lt;/span&gt;  &lt;span class="c1"&gt;# develop: block on critical only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or allowlist specific issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Slither&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crytic/slither-action@v0.4.0&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;slither-args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="s"&gt;--exclude-informational&lt;/span&gt;
      &lt;span class="s"&gt;--exclude-low&lt;/span&gt;
      &lt;span class="s"&gt;--filter-paths "node_modules,test"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Hardhat / Foundry Project Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hardhat Projects
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20'&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Compile contracts&lt;/span&gt;
    &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx hardhat compile&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Slither&lt;/span&gt;
    &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crytic/slither-action@v0.4.0&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20'&lt;/span&gt;
      &lt;span class="na"&gt;hardhat&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Foundry Projects
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;submodules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;recursive&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install Foundry&lt;/span&gt;
    &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;foundry-rs/foundry-toolchain@v1&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
    &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;forge build&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Slither&lt;/span&gt;
    &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crytic/slither-action@v0.4.0&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;foundry&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Complete DevSecOps Pipeline
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer commit
     ↓
[PR opened]
     ↓
GitHub Actions triggered
     ├── Slither static analysis (30s)
     ├── Semgrep pattern check (20s)
     └── AI vulnerability analysis (60s)
     ↓
Results auto-posted as PR comment
     ↓
Severity gate evaluation
  CRITICAL/HIGH → ❌ Merge blocked
  MEDIUM/LOW   → ⚠️ Warning only
     ↓
[Code review + fixes]
     ↓
Security scan passes
     ↓
[Final pre-deployment review]
     ↓
Mainnet deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Cost: Start Completely Free
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt;: Free for public repos, 2,000 free minutes/month for private repos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slither&lt;/strong&gt;: Open-source, free&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ContractScan free tier&lt;/strong&gt;: Unlimited QuickScans, no signup required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consider paid plans as your team grows or scan volume increases. For now, you can build the entire pipeline at zero cost.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion: Automation Is the Answer to Security
&lt;/h2&gt;

&lt;p&gt;Summary of what this series has covered:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Introduction&lt;/strong&gt;: Why smart contract security matters — immutability, direct asset control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reentrancy&lt;/strong&gt;: From The DAO to Euler Finance, the CEI pattern and ReentrancyGuard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Top 5 Vulnerabilities&lt;/strong&gt;: Access control, overflow, oracle manipulation, flash loans, front-running&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Comparison&lt;/strong&gt;: Slither vs Mythril vs Semgrep — when to use what&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Automation&lt;/strong&gt;: This post — integrating security into your pipeline&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run a free scan at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt; before deploying a single line of code. Five minutes can save millions.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>devops</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Slither vs Mythril vs Semgrep: Which Smart Contract Scanner Should You Use?</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:43:41 +0000</pubDate>
      <link>https://dev.to/h33min/slither-vs-mythril-vs-semgrep-which-smart-contract-scanner-should-you-use-2ee7</link>
      <guid>https://dev.to/h33min/slither-vs-mythril-vs-semgrep-which-smart-contract-scanner-should-you-use-2ee7</guid>
      <description>&lt;h2&gt;
  
  
  Why You Need Multiple Tools
&lt;/h2&gt;

&lt;p&gt;Each tool uses a fundamentally different methodology:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Slither&lt;/strong&gt;: Source code static analysis — fast with low false positives&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mythril&lt;/strong&gt;: Symbolic execution — deep analysis, slower but finds complex vulnerabilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semgrep&lt;/strong&gt;: Pattern matching — highly customizable, ideal for CI/CD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No single tool catches every vulnerability. Even The DAO hack was missed by the tools available at the time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Slither — The Static Analysis Standard
&lt;/h2&gt;

&lt;p&gt;Developed by Trail of Bits, Slither is the de facto standard for Solidity security analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation and Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;slither-analyzer

&lt;span class="c"&gt;# Scan a single file&lt;/span&gt;
slither contracts/Vault.sol

&lt;span class="c"&gt;# Run specific detectors only&lt;/span&gt;
slither contracts/Vault.sol &lt;span class="nt"&gt;--detect&lt;/span&gt; reentrancy-eth,unprotected-ether-withdrawal

&lt;span class="c"&gt;# JSON output (for CI integration)&lt;/span&gt;
slither contracts/Vault.sol &lt;span class="nt"&gt;--json&lt;/span&gt; results.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INFO:Detectors:
Vault.withdraw() (contracts/Vault.sol#12-18) sends eth to arbitrary user
        Dangerous calls:
        - (success,None) = msg.sender.call{value: amount}() (contracts/Vault.sol#15)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#suicidal

Reentrancy in Vault.withdraw() (contracts/Vault.sol#12-18):
        External calls:
        - (success,None) = msg.sender.call{value: amount}() (contracts/Vault.sol#15)
        State variables written after the call(s):
        - balances[msg.sender] = 0 (contracts/Vault.sol#17)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Slither Strengths / Weaknesses
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criteria&lt;/th&gt;
&lt;th&gt;Rating&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;⚡ Fast (seconds)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reentrancy detection&lt;/td&gt;
&lt;td&gt;✅ Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access control&lt;/td&gt;
&lt;td&gt;✅ Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oracle manipulation&lt;/td&gt;
&lt;td&gt;⚠️ Limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;False positives&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning curve&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Over &lt;strong&gt;60 built-in detectors&lt;/strong&gt;, with support for writing custom detectors.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mythril — Symbolic Execution Engine
&lt;/h2&gt;

&lt;p&gt;Developed by ConsenSys, Mythril uses symbolic execution to explore all possible execution paths. (&lt;strong&gt;Note&lt;/strong&gt;: MythX ≠ Mythril. MythX was a cloud service that included Mythril but shut down on 2026-03-31. Mythril itself remains open-source and fully usable.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation and Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;mythril

&lt;span class="c"&gt;# Analyze a source file&lt;/span&gt;
myth analyze contracts/Vault.sol

&lt;span class="c"&gt;# Deeper analysis (takes longer)&lt;/span&gt;
myth analyze contracts/Vault.sol &lt;span class="nt"&gt;--execution-timeout&lt;/span&gt; 300

&lt;span class="c"&gt;# Analyze EVM bytecode directly&lt;/span&gt;
myth analyze &lt;span class="nt"&gt;--bin-runtime&lt;/span&gt; 0x608060...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;==== Reentrancy ====
SWC ID: 107
Severity: High
Contract: Vault
Function name: withdraw()
PC address: 148

The contract account state is changed after an external call.

Initial State:
  Account: [attacker], balance: 0x1, nonce:0, storage: {}

Transaction Sequence:
  Caller: [attacker], calldata: , value: 0x1
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Results are categorized according to the &lt;strong&gt;SWC (Smart Contract Weakness Classification)&lt;/strong&gt; standard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mythril Strengths / Weaknesses
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criteria&lt;/th&gt;
&lt;th&gt;Rating&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;🐢 Slow (minutes to tens of minutes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complex logic detection&lt;/td&gt;
&lt;td&gt;✅ Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bytecode analysis&lt;/td&gt;
&lt;td&gt;✅ Supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;False positives&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning curve&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Large contracts may hit timeouts. However, Mythril excels at finding vulnerabilities involving complex state transitions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Semgrep — Pattern Matching and Customization
&lt;/h2&gt;

&lt;p&gt;Semgrep is a general-purpose code security tool that supports Solidity rulesets. It is especially useful for defining team-specific vulnerability patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation and Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;semgrep

&lt;span class="c"&gt;# Use the public Solidity ruleset&lt;/span&gt;
semgrep &lt;span class="nt"&gt;--config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;p/solidity contracts/

&lt;span class="c"&gt;# Specific ruleset&lt;/span&gt;
semgrep &lt;span class="nt"&gt;--config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;p/smart-contracts contracts/Vault.sol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Custom Rule Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Custom rule: detect tx.origin usage&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tx-origin-auth&lt;/span&gt;
    &lt;span class="na"&gt;patterns&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;require(tx.origin == ...)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;if (tx.origin == ...)&lt;/span&gt;
    &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
      &lt;span class="s"&gt;Using tx.origin for authentication is vulnerable to phishing attacks.&lt;/span&gt;
      &lt;span class="s"&gt;Use msg.sender instead.&lt;/span&gt;
    &lt;span class="na"&gt;languages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;solidity&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WARNING&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Semgrep Strengths / Weaknesses
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criteria&lt;/th&gt;
&lt;th&gt;Rating&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;⚡ Fast&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customization&lt;/td&gt;
&lt;td&gt;✅ Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Known pattern detection&lt;/td&gt;
&lt;td&gt;✅ Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deep logic analysis&lt;/td&gt;
&lt;td&gt;❌ Not supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning curve&lt;/td&gt;
&lt;td&gt;Low (basic) / Medium (custom rules)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Comprehensive Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criteria&lt;/th&gt;
&lt;th&gt;Slither&lt;/th&gt;
&lt;th&gt;Mythril&lt;/th&gt;
&lt;th&gt;Semgrep&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Methodology&lt;/td&gt;
&lt;td&gt;Static analysis&lt;/td&gt;
&lt;td&gt;Symbolic execution&lt;/td&gt;
&lt;td&gt;Pattern matching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;Slow&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reentrancy&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access control&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oracle manipulation&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom rules&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI/CD suitability&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MythX replacement&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Practical Recommendations
&lt;/h2&gt;

&lt;p&gt;Solo developer (indie, fast deployment):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Slither → CI integration → Pre-deployment ContractScan unified scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Team development (enterprise, multisig management):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Slither + Semgrep (custom rules) → Automated PR checks → Pre-deployment Mythril deep analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;High-value protocols:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;All of the above + External audits (Certik, Trail of Bits, OpenZeppelin Audits)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Unified Scanning: One Command for All Engines
&lt;/h2&gt;

&lt;p&gt;If installing and managing multiple tools separately seems cumbersome, &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan&lt;/a&gt; wraps five independent engines (Slither, Mythril, Semgrep, Aderyn, and AI) into a single scan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ContractScan CI API — run all five engines simultaneously&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://contract-scanner.raccoonworld.xyz/ci/scan &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s2"&gt;"file=@contracts/MyContract.sol"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Api-Key: &lt;/span&gt;&lt;span class="nv"&gt;$CONTRACTSCAN_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or scan directly on the web: &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;https://contract-scanner.raccoonworld.xyz&lt;/a&gt; (no signup required)&lt;/p&gt;

&lt;p&gt;The AI analysis layer catches business logic issues that static tools miss.&lt;/p&gt;




&lt;p&gt;In the next post, we walk through &lt;strong&gt;integrating these tools into your CI/CD pipeline&lt;/strong&gt; step by step — from branch protection rules to automated PR comment generation, covering the complete workflow.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>smartcontracts</category>
    </item>
    <item>
      <title>Introduction to Smart Contract Security</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:37:37 +0000</pubDate>
      <link>https://dev.to/h33min/introduction-to-smart-contract-security-3i67</link>
      <guid>https://dev.to/h33min/introduction-to-smart-contract-security-3i67</guid>
      <description>&lt;h2&gt;
  
  
  Code Is Law — and Bugs Lose Money
&lt;/h2&gt;

&lt;p&gt;When a traditional web application has a bug, developers can take down the server and deploy a patch. Smart contracts are different.&lt;/p&gt;

&lt;p&gt;A contract deployed to Ethereum &lt;strong&gt;cannot be modified&lt;/strong&gt;. And it may hold tens of millions of dollars in assets.&lt;/p&gt;

&lt;p&gt;2016 The DAO hack: &lt;strong&gt;$60 million&lt;/strong&gt; stolen.&lt;br&gt;
2021 Poly Network: &lt;strong&gt;$611 million&lt;/strong&gt; stolen.&lt;br&gt;
2022 Ronin Network: &lt;strong&gt;$625 million&lt;/strong&gt; stolen.&lt;/p&gt;

&lt;p&gt;All of these incidents shared one common trait: they exploited &lt;strong&gt;known vulnerability patterns&lt;/strong&gt; that could have been detected with code review and automated scanning.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Smart Contracts Differ from Traditional Software
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Immutability
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This contract can never be changed after deployment
contract SimpleVault {
    mapping(address =&amp;gt; uint256) public balances;

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

    // Even if there's a bug, it can't be fixed after deployment
    function withdraw(uint256 amount) external {
        balances[msg.sender] -= amount;
        payable(msg.sender).transfer(amount);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a bug is found after deployment, you must deploy a new contract and migrate all existing users. An attack can happen in the interim.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Direct Control of Financial Assets
&lt;/h3&gt;

&lt;p&gt;Contracts directly hold ETH, ERC-20 tokens, and NFTs. While a SQL injection exposes data, a smart contract vulnerability &lt;strong&gt;immediately drains assets&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Public Code, 24/7 Attack Surface
&lt;/h3&gt;

&lt;p&gt;Anyone can view the source code on Etherscan. Attackers analyze the code as soon as it is deployed and look for vulnerabilities. "Security through obscurity" does not work on blockchain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Most Common Vulnerability Types
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Reentrancy
&lt;/h3&gt;

&lt;p&gt;Occurs when state is not updated before an external contract call. This caused The DAO hack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integer Overflow / Underflow
&lt;/h3&gt;

&lt;p&gt;Before Solidity 0.8.0, SafeMath had to be used manually to prevent arithmetic overflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access Control Vulnerabilities
&lt;/h3&gt;

&lt;p&gt;Missing &lt;code&gt;onlyOwner&lt;/code&gt; modifiers or incorrectly implemented permission schemes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flash Loan Attacks
&lt;/h3&gt;

&lt;p&gt;Large uncollateralized loans within a single transaction, used to manipulate DeFi protocol price oracles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Timestamp Dependence
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;block.timestamp&lt;/code&gt; as a random seed or for critical logic allows miner manipulation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Integrating Security into Your Development Process
&lt;/h2&gt;

&lt;p&gt;Security is not a checklist to add right before deployment. It must be considered from the very first line of code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 — During development&lt;/strong&gt;: Use battle-tested libraries from OpenZeppelin. Leverage proven patterns rather than rolling your own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 — Before code review&lt;/strong&gt;: Run an automated scan. Paste your source code into &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan&lt;/a&gt; for free Slither static analysis and AI vulnerability detection (no signup required).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3 — CI/CD&lt;/strong&gt;: Automate security scans in GitHub Actions. Catch vulnerabilities automatically on every PR.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4 — Before deployment&lt;/strong&gt;: Get a professional audit. High-value protocols should always undergo an external security audit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Getting Started: Your First Scan in 5 Minutes
&lt;/h2&gt;

&lt;p&gt;If you have code, check it for vulnerabilities right now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Paste your Solidity code or enter a contract address&lt;/li&gt;
&lt;li&gt;Run the scan — results appear within seconds&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Free unlimited QuickScans, no signup required.&lt;/p&gt;




&lt;p&gt;In this series, we will dive deep into each vulnerability type. The next post covers a &lt;strong&gt;complete anatomy of reentrancy attacks&lt;/strong&gt; — from The DAO to Euler Finance, with real exploit code and defense patterns.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>web3</category>
    </item>
    <item>
      <title>Smart Contract Security Audit Checklist</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:37:31 +0000</pubDate>
      <link>https://dev.to/h33min/smart-contract-security-audit-checklist-7gk</link>
      <guid>https://dev.to/h33min/smart-contract-security-audit-checklist-7gk</guid>
      <description>&lt;p&gt;Before deploying a smart contract to mainnet, run through this checklist. Catching one critical issue here can save millions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access Control
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] All privileged functions have &lt;code&gt;onlyOwner&lt;/code&gt; / role-based guards&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;tx.origin&lt;/code&gt; is never used for authorization (use &lt;code&gt;msg.sender&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;[ ] Initializer functions use &lt;code&gt;initializer&lt;/code&gt; modifier (upgradeable contracts)&lt;/li&gt;
&lt;li&gt;[ ] Admin key is a multi-sig, not an EOA&lt;/li&gt;
&lt;li&gt;[ ] Ownership transfer is a two-step process&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Arithmetic
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Using Solidity 0.8.x (built-in overflow checks) or &lt;code&gt;SafeMath&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] No division before multiplication (precision loss)&lt;/li&gt;
&lt;li&gt;[ ] No unchecked blocks around critical math&lt;/li&gt;
&lt;li&gt;[ ] Accounting for fee-on-transfer tokens where applicable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  External Calls &amp;amp; Reentrancy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] All external calls follow Checks-Effects-Interactions (CEI)&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;ReentrancyGuard&lt;/code&gt; on any function that sends ETH or makes external calls&lt;/li&gt;
&lt;li&gt;[ ] Return values from &lt;code&gt;call()&lt;/code&gt; / &lt;code&gt;delegatecall()&lt;/code&gt; are checked&lt;/li&gt;
&lt;li&gt;[ ] Cross-function and cross-contract reentrancy paths reviewed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Oracle &amp;amp; Price Safety
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Not using AMM spot prices for anything critical&lt;/li&gt;
&lt;li&gt;[ ] Using Chainlink or Uniswap TWAP for price feeds&lt;/li&gt;
&lt;li&gt;[ ] Staleness check on oracle answers (&lt;code&gt;updatedAt&lt;/code&gt; timestamp)&lt;/li&gt;
&lt;li&gt;[ ] Fallback oracle or circuit breaker for oracle downtime&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Flash Loan Vectors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] No single-block price manipulation possible&lt;/li&gt;
&lt;li&gt;[ ] Liquidity checks cannot be bypassed in one transaction&lt;/li&gt;
&lt;li&gt;[ ] Protocol-owned liquidity is not vulnerable to sandwich attacks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Upgradability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Storage layout is documented and collision-free across proxy/impl&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;_disableInitializers()&lt;/code&gt; called in implementation constructor&lt;/li&gt;
&lt;li&gt;[ ] Upgrade function is behind a timelock and multi-sig&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Token Interactions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] ERC-20 &lt;code&gt;transfer()&lt;/code&gt; / &lt;code&gt;transferFrom()&lt;/code&gt; return values checked&lt;/li&gt;
&lt;li&gt;[ ] Compatible with non-standard tokens (USDT, USDC with no-return)&lt;/li&gt;
&lt;li&gt;[ ] Deflationary / rebasing token edge cases considered&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gas &amp;amp; DoS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] No unbounded loops over user-controlled arrays&lt;/li&gt;
&lt;li&gt;[ ] No use of &lt;code&gt;block.gaslimit&lt;/code&gt; as a constant&lt;/li&gt;
&lt;li&gt;[ ] Pull-over-push pattern for ETH distributions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Events &amp;amp; Logging
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] All state-changing functions emit events&lt;/li&gt;
&lt;li&gt;[ ] Events include enough context to reconstruct state off-chain&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Unit tests cover happy path and edge cases&lt;/li&gt;
&lt;li&gt;[ ] Fuzz tests for arithmetic and state transitions&lt;/li&gt;
&lt;li&gt;[ ] Fork tests against mainnet state for DeFi integrations&lt;/li&gt;
&lt;li&gt;[ ] Code coverage &amp;gt; 95%&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Automated Pre-Check
&lt;/h2&gt;

&lt;p&gt;Many of the above items can be caught automatically. &lt;a href="https://dev.to/"&gt;ContractScan&lt;/a&gt; runs static analysis and AI-assisted review on your Solidity files — no setup required.&lt;/p&gt;

&lt;p&gt;An automated scan is not a substitute for a full professional audit, but it's an excellent first pass before you engage an audit firm.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>audit</category>
      <category>smartcontracts</category>
    </item>
    <item>
      <title>Proxy Pattern Vulnerabilities: UUPS, Transparent, and Diamond</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:31:42 +0000</pubDate>
      <link>https://dev.to/h33min/proxy-pattern-vulnerabilities-uups-transparent-and-diamond-pc7</link>
      <guid>https://dev.to/h33min/proxy-pattern-vulnerabilities-uups-transparent-and-diamond-pc7</guid>
      <description>&lt;p&gt;Upgradeability is one of the most requested features in smart contract development and one of the most dangerous to implement. The proxy pattern separates logic from storage, enabling contract upgrades — but the gap between proxy and implementation is where attackers find their foothold.&lt;/p&gt;

&lt;p&gt;This post breaks down real vulnerability classes across the three dominant proxy patterns: UUPS, Transparent Proxy, and Diamond (EIP-2535). Each pattern introduces different attack surfaces. Each has caused real losses.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Proxies Are Risky by Design
&lt;/h2&gt;

&lt;p&gt;A proxy contract stores state but delegates execution to an implementation contract via &lt;code&gt;delegatecall&lt;/code&gt;. The implementation runs in the proxy's storage context — meaning state variables, &lt;code&gt;msg.sender&lt;/code&gt;, and &lt;code&gt;msg.value&lt;/code&gt; all belong to the proxy, not the implementation.&lt;/p&gt;

&lt;p&gt;This creates an invariant that must hold: the storage layout of the implementation and the proxy must be compatible. Breaking that invariant is not a compile-time error. It's a silent, runtime catastrophe.&lt;/p&gt;




&lt;h2&gt;
  
  
  UUPS Proxies
&lt;/h2&gt;

&lt;p&gt;UUPS (Universal Upgradeable Proxy Standard, EIP-1822) moves upgrade logic into the implementation contract itself. The proxy is minimal — it just does the &lt;code&gt;delegatecall&lt;/code&gt;. Upgrades are triggered by calling &lt;code&gt;upgradeTo()&lt;/code&gt; on the implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 1: Uninitialized Implementation
&lt;/h3&gt;

&lt;p&gt;The most common UUPS bug. OpenZeppelin's &lt;code&gt;Initializable&lt;/code&gt; pattern replaces constructors for upgradeable contracts. If the implementation is deployed without calling &lt;code&gt;initialize()&lt;/code&gt;, anyone can call it and set themselves as owner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Vulnerable: no initializer protection
contract VaultV1 is UUPSUpgradeable, OwnableUpgradeable {
    function initialize(address owner) public {
        __Ownable_init(owner); // must be guarded
    }

    function _authorizeUpgrade(address) internal override onlyOwner {}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fix: use &lt;code&gt;initializer&lt;/code&gt; modifier from OpenZeppelin, and additionally call &lt;code&gt;_disableInitializers()&lt;/code&gt; in the constructor to lock the implementation contract itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor() {
    _disableInitializers(); // lock the bare implementation
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is now standard in OZ v4.9+, but countless deployed contracts predate this fix.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 2: Missing &lt;code&gt;_authorizeUpgrade&lt;/code&gt; Guard
&lt;/h3&gt;

&lt;p&gt;UUPS requires the implementation to define &lt;code&gt;_authorizeUpgrade&lt;/code&gt;. If it's empty or missing the access check, anyone can upgrade to a malicious implementation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Critical bug: missing access control
function _authorizeUpgrade(address newImplementation) internal override {
    // empty — any caller can upgrade
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An attacker calls &lt;code&gt;upgradeTo(maliciousImpl)&lt;/code&gt;, replaces logic, and drains funds. This has happened. Always gate &lt;code&gt;_authorizeUpgrade&lt;/code&gt; with &lt;code&gt;onlyOwner&lt;/code&gt; or a multisig role check.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 3: Implementation Self-Destruct
&lt;/h3&gt;

&lt;p&gt;If the unprotected implementation is called directly (not via proxy) and contains a &lt;code&gt;selfdestruct&lt;/code&gt; path, the implementation contract can be destroyed. The proxy still exists, but every &lt;code&gt;delegatecall&lt;/code&gt; now hits dead code — effectively bricking the proxy permanently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// If this implementation is called directly and selfdestructs...
function destroy() external onlyOwner {
    selfdestruct(payable(msg.sender));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mitigation: never call &lt;code&gt;selfdestruct&lt;/code&gt; in implementation contracts. The &lt;code&gt;_disableInitializers()&lt;/code&gt; pattern also helps prevent direct exploitation of the implementation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Transparent Proxy Pattern
&lt;/h2&gt;

&lt;p&gt;In the Transparent Proxy pattern (OpenZeppelin's classic approach), the proxy distinguishes callers: the admin gets proxy-management functions (like &lt;code&gt;upgradeTo&lt;/code&gt;), everyone else gets their call forwarded to the implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 4: Storage Collision
&lt;/h3&gt;

&lt;p&gt;The proxy stores admin state (admin address, implementation address) in specific storage slots. If an implementation's state variables land on the same slots, reads and writes corrupt each other.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Implementation
contract Token {
    address public owner; // slot 0
    uint256 public totalSupply; // slot 1
}

// If the proxy also uses slot 0 for admin address — collision
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OpenZeppelin solves this with pseudo-random storage slots derived from &lt;code&gt;keccak256&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bytes32 internal constant IMPLEMENTATION_SLOT =
    0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The risk is real when teams write custom proxies without following EIP-1967. Static analysis tools catch obvious pattern violations; storage layout diffs between upgrade versions need manual review.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 5: Admin Confusion / Selector Clash
&lt;/h3&gt;

&lt;p&gt;If the admin calls a function whose selector happens to match a proxy admin function, the transparent proxy intercepts it. If a regular user calls the same selector on the proxy, it's forwarded to the implementation. This asymmetry has caused operational confusion and, in some setups, enabled unexpected access escalation.&lt;/p&gt;

&lt;p&gt;Always verify selector collision between proxy admin functions and implementation functions before deploying.&lt;/p&gt;




&lt;h2&gt;
  
  
  Diamond Proxy (EIP-2535)
&lt;/h2&gt;

&lt;p&gt;The Diamond standard extends proxy upgrades to a facet-based architecture: multiple implementation contracts (facets), each handling different function selectors. A &lt;code&gt;DiamondCut&lt;/code&gt; operation adds, removes, or replaces facets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 6: Storage Collision Between Facets
&lt;/h3&gt;

&lt;p&gt;Each facet can define its own state variables. If two facets write to overlapping storage slots, reads from one facet corrupt state written by another.&lt;/p&gt;

&lt;p&gt;The mitigation is Diamond Storage: each facet uses a unique storage struct at a deterministic slot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;library LibVault {
    bytes32 constant STORAGE_SLOT =
        keccak256("diamond.vault.storage.v1");

    struct Storage {
        mapping(address =&amp;gt; uint256) balances;
        uint256 totalDeposits;
    }

    function get() internal pure returns (Storage storage s) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            s.slot := slot
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Facets that access shared state through their own &lt;code&gt;storage.slot&lt;/code&gt; variable instead of position-based slots avoid cross-facet collisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 7: Unsafe DiamondCut Access Control
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;DiamondCut&lt;/code&gt; is the most powerful function in the system — it can replace any facet logic. If &lt;code&gt;diamondCut&lt;/code&gt; is callable by more than a trusted owner or timelock, the entire contract is compromisable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Missing access control on diamondCut
function diamondCut(
    FacetCut[] calldata _diamondCut,
    address _init,
    bytes calldata _calldata
) external {
    // no onlyOwner or role check — anyone can replace facets
    LibDiamond.diamondCut(_diamondCut, _init, _calldata);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always lock &lt;code&gt;diamondCut&lt;/code&gt; behind a multisig or DAO timelock. Treat it with the same caution you'd apply to &lt;code&gt;upgradeTo&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vulnerability 8: Function Selector Clashes Across Facets
&lt;/h3&gt;

&lt;p&gt;The Diamond maps function selectors to facets. Adding a new facet with a selector that already exists silently overwrites the previous mapping — the old facet function is now unreachable without an explicit &lt;code&gt;diamondCut&lt;/code&gt; to restore it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Before: selector 0xabcd1234 → FacetA.withdraw()
// DiamondCut adds FacetB with 0xabcd1234 → FacetB.emergencyStop()
// Now: withdraw() is unreachable — replaced silently
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tooling helps here: the Diamond standard's reference implementation includes selector deduplication checks, but custom implementations may skip them. Always enumerate selectors before and after any cut.&lt;/p&gt;




&lt;h2&gt;
  
  
  Detection and Tooling
&lt;/h2&gt;

&lt;p&gt;Static analyzers catch several proxy bugs automatically:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bug Class&lt;/th&gt;
&lt;th&gt;Slither&lt;/th&gt;
&lt;th&gt;Semgrep&lt;/th&gt;
&lt;th&gt;Manual Review&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Uninitialized implementation&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Custom rules&lt;/td&gt;
&lt;td&gt;Essential&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Missing &lt;code&gt;_authorizeUpgrade&lt;/code&gt; guard&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage layout collision&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Essential&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DiamondCut access control&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Custom rules&lt;/td&gt;
&lt;td&gt;Essential&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Selector clash&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Essential&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Slither's &lt;code&gt;uninitialized-local&lt;/code&gt; and &lt;code&gt;suicidal&lt;/code&gt; detectors catch some of the UUPS issues. The storage layout checks require comparing layouts between versions — a diff that automated scanners can assist but not fully replace.&lt;/p&gt;

&lt;p&gt;When using ContractScan on an upgradeable contract, the AI engine is specifically prompted to check for proxy-related vulnerability patterns, including initialization gaps and access control on upgrade functions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Upgrade Checklist
&lt;/h2&gt;

&lt;p&gt;Before any proxy upgrade:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Storage layout diff — confirm no new variables inserted before existing ones&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;_authorizeUpgrade&lt;/code&gt; / &lt;code&gt;diamondCut&lt;/code&gt; locked to owner/multisig&lt;/li&gt;
&lt;li&gt;[ ] Implementation constructor calls &lt;code&gt;_disableInitializers()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] New initializer guarded with &lt;code&gt;reinitializer(N)&lt;/code&gt; not &lt;code&gt;initializer&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Selector collision check if using Diamond&lt;/li&gt;
&lt;li&gt;[ ] Upgrade script tested on a fork with production state&lt;/li&gt;
&lt;li&gt;[ ] Timelock delay enforced for non-emergency upgrades&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Proxy patterns trade immutability for flexibility, but that flexibility comes with a novel class of bugs that don't exist in non-upgradeable contracts. The storage layout invariant must hold across every upgrade. Access to upgrade functions must be strictly controlled. Initialization must be locked at both proxy and implementation level.&lt;/p&gt;

&lt;p&gt;None of these checks are optional for contracts holding real value. A missed &lt;code&gt;_authorizeUpgrade&lt;/code&gt; guard or an uninitialized implementation can hand full control of your contract to an attacker in a single transaction.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;ContractScan is a multi-engine smart contract security scanner. QuickScan is free and unlimited — no sign-up required. &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;Try it now&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>smartcontracts</category>
    </item>
    <item>
      <title>Flash Loan Attacks: A Complete Breakdown</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:28:07 +0000</pubDate>
      <link>https://dev.to/h33min/flash-loan-attacks-a-complete-breakdown-3cgm</link>
      <guid>https://dev.to/h33min/flash-loan-attacks-a-complete-breakdown-3cgm</guid>
      <description>&lt;h1&gt;
  
  
  Flash Loan Attacks: A Complete Breakdown
&lt;/h1&gt;

&lt;p&gt;Flash loans are both a DeFi innovation and the single largest attack vector. They allow borrowing millions of dollars without collateral, manipulating prices within a single transaction, extracting profit, and repaying the loan — all atomically. The attacker's upfront cost is just the gas fee.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is a Flash Loan?
&lt;/h2&gt;

&lt;p&gt;An uncollateralized loan that is borrowed and repaid within the same transaction. If not repaid, the entire transaction reverts. Available on Aave, dYdX, and Uniswap V2/V3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Aave V3 Flash Loan interface
function flashLoan(
    address receiverAddress,
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata interestRateModes,
    address onBehalfOf,
    bytes calldata params,
    uint16 referralCode
) external;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Attack Pattern: Price Oracle Manipulation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Borrow a large amount of Token A via flash loan
2. Dump Token A on a DEX → Token A price crashes
3. Target protocol uses the DEX spot price as its oracle
4. Set up collateral or trigger liquidation at the depressed price
5. Profit after price recovery
6. Repay the flash loan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Case 1: bZx (2020, ~$1M)
&lt;/h2&gt;

&lt;p&gt;The first major DeFi flash loan attack. sUSD price was manipulated on Uniswap to take out an overvalued collateral loan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attack flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flash loan 10,000 ETH from dYdX&lt;/li&gt;
&lt;li&gt;Deposit 5,500 ETH as collateral on Compound → borrow 112 WBTC&lt;/li&gt;
&lt;li&gt;Use remaining ETH to open a short position on Fulcrum&lt;/li&gt;
&lt;li&gt;Manipulate price on Uniswap/Kyber&lt;/li&gt;
&lt;li&gt;Realize profit from the short position&lt;/li&gt;
&lt;li&gt;Repay flash loan, keep the profit&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Case 2: PancakeBunny (2021, ~$45M)
&lt;/h2&gt;

&lt;p&gt;A BSC-based protocol. PancakeSwap's spot price was used as the oracle, allowing BUNNY token price manipulation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause&lt;/strong&gt;: The &lt;code&gt;priceCalculator&lt;/code&gt; relied on a single block's AMM spot price. A flash loan momentarily distorted the price, enabling excessive BUNNY minting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Case 3: Euler Finance (2023, ~$197M)
&lt;/h2&gt;

&lt;p&gt;Combined a flash loan with &lt;code&gt;donateToReserves()&lt;/code&gt;. Missing health factor validation allowed creation of an artificial liquidation state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attack flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flash loan DAI from Aave&lt;/li&gt;
&lt;li&gt;Deposit DAI into Euler → mint eDAI&lt;/li&gt;
&lt;li&gt;Borrow additional DAI against eDAI (leverage)&lt;/li&gt;
&lt;li&gt;Call &lt;code&gt;donateToReserves()&lt;/code&gt; to donate eDAI to reserve → create undercollateralized state&lt;/li&gt;
&lt;li&gt;Liquidate own position from a separate account → acquire collateral at a discount&lt;/li&gt;
&lt;li&gt;Repay flash loan, keep the profit&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Defense 1: TWAP Oracle
&lt;/h2&gt;

&lt;p&gt;Use a Time-Weighted Average Price instead of a single block's spot price.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Uniswap V3 TWAP Oracle
function consult(address pool, uint32 secondsAgo) external view returns (int24 arithmeticMeanTick) {
    uint32[] memory secondsAgos = new uint32[](2);
    secondsAgos[0] = secondsAgo;
    secondsAgos[1] = 0;

    (int56[] memory tickCumulatives, ) = IUniswapV3Pool(pool).observe(secondsAgos);

    arithmeticMeanTick = int24(
        (tickCumulatives[1] - tickCumulatives[0]) / int56(int32(secondsAgo))
    );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 2: Chainlink Oracle
&lt;/h2&gt;

&lt;p&gt;Use off-chain data feeds instead of on-chain DEX prices. Cannot be manipulated via flash loans.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

function getPrice() external view returns (uint256) {
    (, int256 price, , uint256 updatedAt, ) = priceFeed.latestRoundData();
    require(block.timestamp - updatedAt &amp;lt; 3600, "Stale price");
    return uint256(price);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 3: Single-Transaction Restriction
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mapping(address =&amp;gt; uint256) private _lastActionBlock;

modifier noSameBlockAction() {
    require(_lastActionBlock[msg.sender] != block.number, "Same block");
    _lastActionBlock[msg.sender] = block.number;
    _;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 4: Health Factor Validation
&lt;/h2&gt;

&lt;p&gt;Always re-validate the health factor after state-changing functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function donateToReserves(uint256 amount) external {
    // ... donate logic ...
    require(getHealthFactor(msg.sender) &amp;gt;= MIN_HEALTH_FACTOR, "Unhealthy");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Does the price oracle avoid relying on single-block spot prices?&lt;/li&gt;
&lt;li&gt;[ ] Is a manipulation-resistant oracle (TWAP or Chainlink) in use?&lt;/li&gt;
&lt;li&gt;[ ] Are price-dependent operations restricted within the same block?&lt;/li&gt;
&lt;li&gt;[ ] Is the health factor re-validated after state changes?&lt;/li&gt;
&lt;li&gt;[ ] Are there unintended state changes in flash loan callbacks?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detecting These Issues with ContractScan
&lt;/h2&gt;

&lt;p&gt;Semgrep's &lt;code&gt;single-transaction-price-manipulation&lt;/code&gt; and &lt;code&gt;unchecked-oracle-price&lt;/code&gt; rules, combined with AI analysis, detect flash loan vulnerability patterns.&lt;br&gt;
→ &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan Free Scan&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try ContractScan free at &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;contract-scanner.raccoonworld.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>defi</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>How Access Control Mistakes Led to $1.4B in Losses</title>
      <dc:creator>Heemin Kim</dc:creator>
      <pubDate>Fri, 10 Apr 2026 05:08:54 +0000</pubDate>
      <link>https://dev.to/h33min/how-access-control-mistakes-led-to-953m-in-losses-4kkg</link>
      <guid>https://dev.to/h33min/how-access-control-mistakes-led-to-953m-in-losses-4kkg</guid>
      <description>&lt;h1&gt;
  
  
  How Access Control Mistakes Led to $1.4B in Losses
&lt;/h1&gt;

&lt;p&gt;As of 2025, the #1 loss category in smart contract security incidents is &lt;strong&gt;access control&lt;/strong&gt; vulnerabilities. Three landmark cases alone — Poly Network, Ronin Bridge, and Nomad Bridge — account for over &lt;strong&gt;$1.4B in combined losses&lt;/strong&gt;. These are not complex mathematical exploits — they stem from simply failing to verify "who can call this function."&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is an Access Control Vulnerability?
&lt;/h2&gt;

&lt;p&gt;Admin-only functions (mint, pause, upgrade, transfer ownership, etc.) that lack proper access controls, allowing &lt;strong&gt;anyone&lt;/strong&gt; to call them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vulnerable Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contract VulnerableToken {
    address public owner;

    // ⚠️ No onlyOwner check — anyone can mint
    function mint(address to, uint256 amount) external {
        _mint(to, amount);
    }

    // ⚠️ Initializer is unprotected
    function initialize(address _owner) external {
        owner = _owner;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Case 1: Poly Network (2021, ~$611M)
&lt;/h2&gt;

&lt;p&gt;The cross-chain relay's keeper change function was insufficiently protected, allowing the attacker to register themselves as a keeper and withdraw funds from all chains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause&lt;/strong&gt;: &lt;code&gt;verifyHeaderAndExecuteTx()&lt;/code&gt; allowed arbitrary contract calls through cross-chain message validation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://rekt.news/polynetwork-rekt/" rel="noopener noreferrer"&gt;Rekt News — Poly Network&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Case 2: Ronin Bridge (2022, ~$625M)
&lt;/h2&gt;

&lt;p&gt;Five out of nine validator private keys for Axie Infinity's Ronin Bridge were compromised. This exceeded the multisig threshold, enabling bridge fund withdrawal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause&lt;/strong&gt;: Too few validators, some keys stored on shared infrastructure. Vulnerable to social engineering.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://rekt.news/ronin-rekt/" rel="noopener noreferrer"&gt;Rekt News — Ronin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Case 3: Nomad Bridge (2022, ~$190M)
&lt;/h2&gt;

&lt;p&gt;During an upgrade, the trusted root was initialized to &lt;code&gt;0x00&lt;/code&gt;. All messages were automatically treated as valid, allowing anyone to withdraw bridge funds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root cause&lt;/strong&gt;: Incorrect parameters in the &lt;code&gt;initialize()&lt;/code&gt; call set the Merkle root to zero.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://rekt.news/nomad-rekt/" rel="noopener noreferrer"&gt;Rekt News — Nomad&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Defense 1: Ownable Pattern
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@openzeppelin/contracts/access/Ownable.sol";

contract SafeToken is Ownable {
    function mint(address to, uint256 amount) external onlyOwner {
        _mint(to, amount);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 2: Role-Based Access Control (RBAC)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@openzeppelin/contracts/access/AccessControl.sol";

contract SafeToken is AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) {
        _mint(to, amount);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 3: Initializer Protection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract SafeProxy is Initializable {
    function initialize(address _owner) external initializer {
        // initializer modifier prevents re-calling
        _transferOwnership(_owner);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defense 4: Timelock
&lt;/h2&gt;

&lt;p&gt;Add a delay before admin function execution, giving the community time to detect and respond to malicious changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@openzeppelin/contracts/governance/TimelockController.sol";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Do all admin/owner functions have access control modifiers?&lt;/li&gt;
&lt;li&gt;[ ] Does &lt;code&gt;initialize()&lt;/code&gt; use the &lt;code&gt;initializer&lt;/code&gt; modifier?&lt;/li&gt;
&lt;li&gt;[ ] Is the upgrade function (&lt;code&gt;upgradeTo&lt;/code&gt;) protected?&lt;/li&gt;
&lt;li&gt;[ ] Is multi-sig or a timelock applied?&lt;/li&gt;
&lt;li&gt;[ ] Are private keys stored in a distributed manner?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detecting These Issues with ContractScan
&lt;/h2&gt;

&lt;p&gt;Slither's &lt;code&gt;unprotected-upgrade&lt;/code&gt; and Semgrep's &lt;code&gt;missing-access-control&lt;/code&gt; rules automatically detect missing access controls.&lt;br&gt;
→ &lt;a href="https://contract-scanner.raccoonworld.xyz" rel="noopener noreferrer"&gt;ContractScan Free Scan&lt;/a&gt;&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>ethereum</category>
      <category>smartcontracts</category>
    </item>
  </channel>
</rss>
