1import{bj as N,j as e,aM as y,aQ as k,L as n,m as d,l as c,az as h,aA as x,aD as A,aE as F,aF as m,aG as p,h as a,an as s,ao as t,i,as as r,x as l,O as M,Z as C,B as j,ag as T}from"./index-DJZuVyTC.js";import{H as P}from"./HubLinksStrip-CYWUGvHy.js";import{T as o}from"./triangle-alert-CEWMGGTe.js";import{B as S}from"./book-open-Cr-t0wwZ.js";import{B as E}from"./bug-DA0Y84ob.js";function q(){const b={initial:{opacity:0,y:60},animate:{opacity:1,y:0},transition:{duration:.6}},u=[{question:"What is a flash loan attack in DeFi?",answer:"A flash loan attack uses uncollateralized loans (borrowed and repaid within a single transaction) to amplify an exploit. Attackers borrow millions, use them to manipulate prices, drain collateral, or exploit arithmetic bugs, then repay the loan â all in one atomic transaction. The protocol loses funds even though the loan is repaid."},{question:"How does a flash loan attack work step by step?",answer:"Step 1: Borrow a large amount from a flash loan provider (Aave, dYdX, Uniswap). Step 2: Use funds to manipulate a price oracle, liquidity pool, or exploit a contract vulnerability. Step 3: Extract profit from the exploited protocol. Step 4: Repay the flash loan plus fee. If any step fails, the entire transaction reverts â so it's risk-free for the attacker."},{question:"Can flash loans be used for legitimate purposes?",answer:"Yes â flash loans are widely used for arbitrage (equalizing prices across DEXes), collateral swaps (replacing one collateral type with another in a single transaction), and self-liquidations (closing underwater positions without needing upfront capital). The loan itself isn't malicious â it's the target protocol's vulnerability that enables the attack."},{question:"Which DeFi protocols have been hit by flash loan attacks?",answer:"Flash loan attacks are among the most damaging in DeFi: Euler Finance ($197M, 2023), Cream Finance ($130M, 2021), PancakeBunny ($45M, 2021), bZx ($8M, 2020), and Harvest Finance ($34M, 2020). Most exploited price oracle vulnerabilities or reentrancy bugs â the flash loan just provided the capital to make them profitable."},{question:"How can I protect my smart contract protocol against flash loan attacks?",answer:"Use TWAP oracles instead of spot prices, add reentrancy guards on all state-changing functions, implement per-block or per-transaction value limits, and use checks-effects-interactions everywhere. SmartContractAuditor.ai simulates flash loan attack vectors on your contract, identifying which functions could be exploited with borrowed capital."}],g={"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://smartcontractauditor.ai/vulnerabilities/flash-loan-attacks#article",headline:"Flash Loan Attacks: How They Work and How to Stop Them",description:"Flash loans let attackers borrow millions with no collateral, manipulate prices, drain protocols, and repay in a single transaction. Learn how Euler Finance lost $197M and how to protect against it.",author:{"@type":"Organization",name:"SmartContractAuditor.ai"},publisher:{"@type":"Organization",name:"SmartContractAuditor.ai"},datePublished:"2024-01-15",dateModified:"2024-01-15",mainEntityOfPage:{"@type":"WebPage","@id":"https://smartcontractauditor.ai/vulnerabilities/flash-loan-attacks"}},N(u)]};return e.jsxs("div",{className:"min-h-screen bg-[#080a12]",children:[e.jsx(y,{title:"Flash Loan Attacks Explained: How They Work & How to Protect Your DeFi Protocol",description:"Flash loans let attackers borrow millions with no collateral, manipulate prices, drain protocols, and repay in a single transaction. Learn how Euler Finance lost $197M and how to protect against it.",keywords:"flash loan attack, flash loan exploit, DeFi flash loan vulnerability, flash loan prevention, Euler Finance hack, Beanstalk flash loan, price oracle manipulation, TWAP oracle, flash loan smart contract",canonicalUrl:"https://smartcontractauditor.ai/vulnerabilities/flash-loan-attacks",structuredData:g}),e.jsxs("div",{className:"fixed inset-0 bg-[#080a12]",children:[e.jsx("div",{className:"absolute top-20 left-20 w-96 h-96 bg-electric-blue/20 rounded-full blur-[100px] animate-pulse"}),e.jsx("div",{className:"absolute bottom-20 right-20 w-96 h-96 bg-violet/20 rounded-full blur-[100px] animate-pulse"}),e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-cyan/10 rounded-full blur-[100px] animate-pulse"})]}),e.jsx(k,{}),e.jsx("div",{className:"relative z-10 bg-white/5 border-b border-white/10 py-4",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("nav",{className:"text-sm",children:[e.jsx(n,{href:"/",className:"text-slate-400 hover:text-white",children:"Home"}),e.jsx("span",{className:"mx-2 text-slate-600",children:"/"}),e.jsx("span",{className:"text-slate-400",children:"Vulnerabilities"}),e.jsx("span",{className:"mx-2 text-slate-600",children:"/"}),e.jsx("span",{className:"text-white font-medium",children:"Flash Loan Attacks"})]})})}),e.jsx("section",{className:"relative z-10 py-16 lg:py-24",children:e.jsx("div",{className:"container mx-auto px-4 max-w-4xl",children:e.jsxs(d.div,{className:"text-center mb-12",...b,children:[e.jsxs(c,{className:"mb-6 bg-red-500/20 text-red-400 hover:bg-red-500/30 border-red-500/30",children:[e.jsx(o,{className:"w-4 h-4 mr-1"}),"Critical Severity"]}),e.jsxs("h1",{className:"text-4xl md:text-6xl font-bold text-white mb-6 leading-tight",children:["Flash Loan Attacks",e.jsx("br",{}),e.jsx("span",{className:"text-red-500",children:"Single-Transaction, Zero-Collateral Exploits"})]}),e.jsx("p",{className:"text-xl text-slate-300 mb-8 leading-relaxed",children:"In March 2023, an attacker borrowed $200M in a flash loan, manipulated the Euler Finance protocol, and walked away with $197M in profit â all in one transaction, all on-chain, all c
1ompletely permissionless. Flash loan attacks are the most capital-efficient exploit in DeFi."}),e.jsxs(h,{className:"mb-8 border-red-500/30 bg-red-500/10 backdrop-blur-sm",children:[e.jsx(o,{className:"h-4 w-4 text-red-400"}),e.jsxs(x,{className:"text-red-300",children:[e.jsx("strong",{children:"Real Impact:"})," Euler Finance ($197M, 2023) ⢠Beanstalk ($182M, 2022) ⢠PancakeBunny ($45M, 2021) ⢠Cream Finance ($130M, 2021)"]})]})]})})}),e.jsx("section",{className:"relative z-10 py-16",children:e.jsx("div",{className:"container mx-auto px-4 max-w-4xl",children:e.jsxs(A,{defaultValue:"overview",className:"w-full",children:[e.jsxs(F,{className:"grid w-full grid-cols-4 mb-8",children:[e.jsx(m,{value:"overview","data-testid":"tab-overview",children:"Overview"}),e.jsx(m,{value:"examples","data-testid":"tab-examples",children:"Code Examples"}),e.jsx(m,{value:"prevention","data-testid":"tab-prevention",children:"Prevention"}),e.jsx(m,{value:"detection","data-testid":"tab-detection",children:"Detection"})]}),e.jsx(p,{value:"overview",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(a,{className:"glass-card",children:[e.jsx(s,{children:e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(S,{className:"w-6 h-6 text-electric-blue mr-3"}),"How Flash Loans Work"]})}),e.jsxs(i,{className:"prose prose-slate max-w-none",children:[e.jsx("p",{className:"text-lg text-slate-300 leading-relaxed",children:"A flash loan lender (like Aave or dYdX) lets you borrow any amount with zero collateral, as long as you repay it within the same transaction. If you don't repay, the entire transaction reverts â the lender has zero risk. This creates a window where an attacker can wield enormous capital to manipulate protocols."}),e.jsx("h3",{className:"text-xl font-semibold mt-6 mb-4 text-white",children:"The Attack Flow"}),e.jsx("div",{className:"bg-white/5 border border-white/10 p-6 rounded-lg",children:e.jsxs("ol",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(c,{className:"bg-electric-blue/20 text-electric-blue border-electric-blue/30 mt-1",children:"1"}),e.jsx("span",{className:"text-slate-300",children:"Borrow millions in a flash loan from Aave, dYdX, or similar"})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(c,{className:"bg-electric-blue/20 text-electric-blue border-electric-blue/30 mt-1",children:"2"}),e.jsx("span",{className:"text-slate-300",children:"Use the capital to push a price feed to an extreme value"})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(c,{className:"bg-electric-blue/20 text-electric-blue border-electric-blue/30 mt-1",children:"3"}),e.jsx("span",{className:"text-slate-300",children:"Exploit a protocol that trusts that manipulated price"})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(c,{className:"bg-electric-blue/20 text-electric-blue border-electric-blue/30 mt-1",children:"4"}),e.jsx("span",{className:"text-slate-300",children:"Pocket the profit from the manipulation"})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(c,{className:"bg-red-500/20 text-red-400 border-red-500/30 mt-1",children:"5"}),e.jsx("span",{className:"text-slate-300",children:"Repay the flash loan â all within a single transaction block"})]})]})})]})]}),e.jsxs(a,{className:"glass-card",children:[e.jsx(s,{children:e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(o,{className:"w-6 h-6 text-red-500 mr-3"}),"Why Protocols Are Vulnerable"]})}),e.jsxs(i,{children:[e.jsx("p",{className:"text-slate-300 leading-relaxed mb-6",children:"Most protocols that read spot prices from AMMs (like Uniswap V2/V3) can have their prices manipulated within a single transaction. If your protocol makes a lending decision, minting decision, or liquidation decision based on a spot price, it may be vulnerable."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-white",children:"Common Vulnerable Patterns"}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsx("li",{children:"⢠Spot price reads from Uniswap V2/V3 pools"}),e.jsx("li",{children:"⢠Collateral valuation based on AMM reserves"}),e.jsx("li",{children:"⢠Minting decisions tied to spot price"}),e.jsx("li",{children:"⢠Governance votes buyable in one block"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-white",children:"Notable Examples"}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsx("li",{children:"⢠Euler Finance â $197M (2023)"}),e.jsx("li",{children:"⢠Beanstalk â $182M governance flash loan (2022)"}),e.jsx("li",{children:"⢠Cream Finance â $130M, twice (2021)"}
1),e.jsx("li",{children:"⢠PancakeBunny â price manipulation (2021)"})]})]})]})]})]})]})}),e.jsx(p,{value:"examples",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(a,{className:"glass-card",children:[e.jsxs(s,{children:[e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(E,{className:"w-6 h-6 text-red-500 mr-3"}),"Vulnerable Code Example"]}),e.jsx(r,{className:"text-slate-400",children:"Lending logic that trusts an AMM spot price â exploitable in a single transaction"})]}),e.jsxs(i,{children:[e.jsx("div",{className:"bg-black/40 border border-white/10 p-6 rounded-lg",children:e.jsx("pre",{className:"bg-slate-900 p-4 rounded-lg text-sm overflow-x-auto",children:e.jsx("code",{className:"text-emerald-400",children:`// VULNERABLE: trusts spot price from AMM 2function calculateCollateral(address token, uint amount) public view returns (uint) { 3 // This price can be manipulated in a single transaction 4 (uint reserve0, uint reserve1,) = IUniswapV2Pair(pair).getReserves(); 5 uint spotPrice = reserve1 / reserve0; 6 return amount * spotPrice; 7} 8 9// VULNERABLE: takes action based on manipulated price 10function borrow(address token, uint collateral) external { 11 uint collateralValue = calculateCollateral(token, collateral); 12 // Attacker inflates collateralValue via flash loan, borrows more than deposited 13 require(collateralValue >= loanAmount * 150 / 100, "Undercollateralized"); 14 _sendLoan(msg.sender, loanAmount); 15}`})})}),e.jsxs(h,{className:"mt-4 border-red-500/30 bg-red-500/10 backdrop-blur-sm",children:[e.jsx(o,{className:"h-4 w-4 text-red-400"}),e.jsxs(x,{className:"text-red-300",children:[e.jsx("strong",{children:"Why this is vulnerable:"})," ",e.jsx("code",{children:"getReserves()"})," returns the current pool state, which an attacker can skew dramatically within the same transaction using a flash loan. A single large swap moves the reserve ratio, making worthless collateral appear valuable."]})]})]})]}),e.jsxs(a,{className:"glass-card",children:[e.jsxs(s,{children:[e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(l,{className:"w-6 h-6 text-emerald-500 mr-3"}),"Fixed: Chainlink Oracle + TWAP"]}),e.jsx(r,{className:"text-slate-400",children:"Use a manipulation-resistant price source instead of an AMM spot price"})]}),e.jsxs(i,{children:[e.jsx("div",{className:"bg-black/40 border border-white/10 p-6 rounded-lg",children:e.jsx("pre",{className:"bg-slate-900 p-4 rounded-lg text-sm overflow-x-auto",children:e.jsx("code",{className:"text-emerald-400",children:`// FIXED: use Chainlink price feed (manipulation-resistant) 16import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; 17 18AggregatorV3Interface internal priceFeed; 19 20function getPrice() public view returns (int) { 21 ( 22 uint80 roundID, 23 int price, 24 uint startedAt, 25 uint timeStamp, 26 uint80 answeredInRound 27 ) = priceFeed.latestRoundData(); 28 require(timeStamp > 0, "Stale price"); 29 require(block.timestamp - timeStamp < 3600, "Price too old"); 30 return price; 31} 32 33// ALTERNATIVE: use TWAP (time-weighted average price) 34function getTWAP(address pair, uint period) internal view returns (uint) { 35 // Reads the average price over \`period\` seconds 36 // Cannot be manipulated in a single block 37 return IUniswapV3Pool(pair).observe(uint32(period)); 38}`})})}),e.jsxs(h,{className:"mt-4 border-emerald-500/30 bg-emerald-500/10 backdrop-blur-sm",children:[e.jsx(l,{className:"h-4 w-4 text-emerald-400"}),e.jsxs(x,{className:"text-emerald-300",children:[e.jsx("strong",{children:"Why this works:"})," Chainlink aggregates prices from many sources and updates on a heartbeat, not on individual trades. A TWAP averages price over many blocks â moving it requires sustained capital over time, not a single flash loan."]})]})]})]})]})}),e.jsx(p,{value:"prevention",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(a,{className:"glass-card",children:[e.jsxs(s,{children:[e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(l,{className:"w-6 h-6 text-emerald-500 mr-3"}),"Flash Loan Attack Prevention Checklist"]}),e.jsx(r,{className:"text-slate-400",children:"Fixes to implement before deploying any price-sensitive logic"})]}),e.jsx(i,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"Use Chainlink or Pyth price oracles instead of AMM spot prices for any lending, minting, or liquidation logic"})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"If you must use AMM prices, require a TWAP window of at least 15 minutes â a flash loan cannot span multiple blocks"})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"Add slippage checks: reject transactions if price deviates more than 5% from an expected baseline"})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"For liquidations and minting: add a delay between price read and action execution so spot manipulation can't be atomic"})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"Test your protocol against flash loan attack scenarios using Foundry fork tests â simulate real mainnet state"})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx(l,{className:"w-5 h-5 text-emerald-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-slate-300",children:"Add reentrancy protection on all external
38calls â flash loans arrive as external calls and can trigger callbacks"})]})]})})]}),e.jsxs(a,{className:"glass-card",children:[e.jsx(s,{children:e.jsx(t,{className:"text-white",children:"Do vs. Don't"})}),e.jsx(i,{children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-emerald-400 mb-3 flex items-center",children:[e.jsx(l,{className:"w-5 h-5 mr-2"}),"Do This"]}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsx("li",{children:"⢠Use Chainlink / Pyth for price feeds"}),e.jsx("li",{children:"⢠Read TWAP over 15+ minutes"}),e.jsx("li",{children:"⢠Validate oracle freshness"}),e.jsx("li",{children:"⢠Fork-test with real liquidity"}),e.jsx("li",{children:"⢠Bound acceptable price ranges"})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-red-400 mb-3 flex items-center",children:[e.jsx(o,{className:"w-5 h-5 mr-2"}),"Avoid This"]}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsxs("li",{children:["⢠",e.jsx("code",{children:"getReserves()"})," for collateral pricing"]}),e.jsx("li",{children:"⢠Single-block price snapshots"}),e.jsx("li",{children:"⢠Governance with no time delay"}),e.jsx("li",{children:"⢠Trusting msg.sender during callbacks"}),e.jsx("li",{children:"⢠Skipping mainnet fork tests"})]})]})]})})]})]})}),e.jsx(p,{value:"detection",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(a,{className:"glass-card",children:[e.jsxs(s,{children:[e.jsxs(t,{className:"flex items-center text-white",children:[e.jsx(M,{className:"w-6 h-6 text-violet mr-3"}),"Automated Flash Loan Vulnerability Detection"]}),e.jsx(r,{className:"text-slate-400",children:"What our scanner looks for in your contract"})]}),e.jsxs(i,{children:[e.jsx("p",{className:"text-slate-300 leading-relaxed mb-6",children:"SmartContractAuditor.ai scans your contract for flash loan vulnerability patterns:"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-white",children:"Detection Patterns"}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsx("li",{children:"⢠Single-block AMM price reads used in lending/minting logic"}),e.jsx("li",{children:"⢠Missing TWAP or oracle freshness checks"}),e.jsx("li",{children:"⢠Price-sensitive operations without slippage bounds"}),e.jsx("li",{children:"⢠Functions callable atomically with large capital inflows"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-3 text-white",children:"Report Output"}),e.jsxs("ul",{className:"space-y-2 text-slate-300",children:[e.jsx("li",{children:"⢠Exact line numbers for each finding"}),e.jsx("li",{children:"⢠Severity classification per issue"}),e.jsx("li",{children:"⢠Specific fix recommendation"}),e.jsx("li",{children:"⢠Oracle replacement suggestions"})]})]})]}),e.jsxs(h,{className:"mt-6 border-violet/30 bg-violet/10 backdrop-blur-sm",children:[e.jsx(C,{className:"h-4 w-4 text-violet"}),e.jsxs(x,{className:"text-violet-300",children:[e.jsx("strong",{children:"Try it:"})," Upload your contract and the scanner will flag any of these patterns with line numbers and fix recommendations."]})]})]})]}),e.jsxs(a,{className:"glass-card",children:[e.jsx(s,{children:e.jsx(t,{className:"text-white",children:"Manual Review Checklist"})}),e.jsx(i,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsxs("span",{className:"text-slate-300",children:["Search for ",e.jsx("code",{children:"getReserves()"})," calls â trace how the return values are used downstream"]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-slate-300",children:"Check every price-sensitive function for a TWAP or oracle staleness guard"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-slate-300",children:"Verify governance proposals require a time delay before execution"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-slate-300",children:"Run a Foundry fork test that flash loans $10M and tries every entry point"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1"}),e.jsx("span",{className:"text-slate-300",children:"Confirm all external
38call paths have reentrancy guards"})]})]})})]})]})})]})})}),e.jsx("section",{className:"relative z-10 py-16",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-3xl",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-8",children:"Frequently Asked Questions"}),e.jsx("div",{className:"space-y-3",children:u.map(({question:f,answer:w},v)=>e.jsxs("details",{className:"border border-white/10 rounded-lg p-4 bg-white/5",children:[e.jsxs("summary",{className:"font-semibold text-white cursor-pointer list-none flex items-center justify-between",children:[f,e.jsx("span",{className:"text-slate-400 ml-4 flex-shrink-0",children:"+"})]}),e.jsx("p",{className:"text-slate-300 mt-3 leading-relaxed text-sm",children:w})]},v))})]})}),e.jsx("section",{className:"relative z-10 py-16 bg-white/5 border-t border-white/10",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-6xl",children:[e.jsx("h2",{className:"text-3xl font-bold text-center mb-12 text-white",children:"Related Smart Contract Vulnerabilities"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsx(n,{href:"/vulnerabilities/oracle-manipulation",children:e.jsx(a,{className:"glass-card cursor-pointer hover:bg-white/10 transition-all duration-300 border border-white/10 hover:border-electric-blue/50",children:e.jsxs(s,{children:[e.jsx(t,{className:"text-lg text-white",children:"Oracle Manipulation"}),e.jsx(r,{className:"text-slate-400",children:"Attacks on external data feeds and price oracles"})]})})}),e.jsx(n,{href:"/vulnerabilities/reentrancy-attacks",children:e.jsx(a,{className:"glass-card cursor-pointer hover:bg-white/10 transition-all duration-300 border border-white/10 hover:border-electric-blue/50",children:e.jsxs(s,{children:[e.jsx(t,{className:"text-lg text-white",children:"Reentrancy Attacks"}),e.jsx(r,{className:"text-slate-400",children:"Recursive calls that drain funds before state updates complete"})]})})}),e.jsx(n,{href:"/vulnerabilities/front-running",children:e.jsx(a,{className:"glass-card cursor-pointer hover:bg-white/10 transition-all duration-300 border border-white/10 hover:border-electric-blue/50",children:e.jsxs(s,{children:[e.jsx(t,{className:"text-lg text-white",children:"Front-Running"}),e.jsx(r,{className:"text-slate-400",children:"Mempool monitoring to execute transactions ahead of victims"})]})})})]})]})}),e.jsx(P,{}),e.jsx("section",{className:"relative z-10 py-20 bg-gradient-to-r from-emerald-600 to-slate-700",children:e.jsx("div",{className:"container mx-auto px-4 max-w-4xl text-center",children:e.jsxs(d.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},transition:{duration:.6},viewport:{once:!0},children:[e.jsx("h2",{className:"text-4xl md:text-5xl font-bold text-white mb-6",children:"Scan Your Contract for Flash Loan Vulnerabilities"}),e.jsx("p",{className:"text-xl text-emerald-100 mb-8 max-w-2xl mx-auto",children:"Our scanner checks for spot price reads, missing TWAP guards, and oracle staleness issues â the patterns that let flash loan attacks succeed."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsx(n,{href:"/signup",children:e.jsx(d.div,{whileHover:{scale:1.05,y:-2},whileTap:{scale:.95},transition:{type:"spring",stiffness:400},children:e.jsxs(j,{size:"lg",variant:"secondary",className:"bg-white text-emerald-700 hover:bg-emerald-50 text-lg px-8 py-4","data-testid":"button-scan-flash-loan",children:["Scan for Flash Loan Vulnerabilities",e.jsx(T,{className:"w-5 h-5 ml-2"})]})})}),e.jsx(n,{href:"/smart-contract-audit",children:e.jsx(d.div,{whileHover:{scale:1.05,y:-2},whileTap:{scale:.95},transition:{type:"spring",stiffness:400},children:e.jsx(j,{size:"lg",variant:"outline",className:"border-2 border-white text-white hover:bg-white hover:text-emerald-700 text-lg px-8 py-4","data-testid":"button-full-audit",children:"Get Full Security Audit"})})})]}),e.jsx("p",{className:"text-emerald-200 text-sm mt-6",children:"Free vulnerability scan ⢠Instant results ⢠Expert recommendations"})]})})})]})}export{q as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.