import requests, json, time, re # ── Config ─────────────────────────────────────────────────────────────────── ETHERSCAN_KEY = "YOUR_ETHERSCAN_API_KEY" # ── Vuln type alias map ────────────────────────────────────────────────────── VULN_TYPE_ALIASES = { "flash_loan_oracle": ["flash_loan_oracle", "price manipulation", "oracle manipulation", "flash loan oracle"], "flash_loan_governance": ["flash_loan_governance", "flash loan governance", "governance attack"], "reentrancy": ["reentrancy", "re-entrancy", "recursive call"], "price_manipulation": ["price_manipulation", "price manipulation", "oracle manipulation"], "improper_initialization":["improper_initialization", "improper initialization", "zero hash", "uninitialized", "merkle root"], "uninitialized_proxy": ["uninitialized_proxy", "uninitialized proxy", "uninitialized wallet", "selfdestruct", "self-destruct", "kill"], "donation_attack": ["donation_attack", "donation attack", "violates", "health check", "edonation", "bad debt"], "read_only_reentrancy": ["read_only_reentrancy", "read-only reentrancy", "read only reentrancy", "view reentrancy"], "access_control": ["access_control", "access control", "unauthorized", "missing modifier", "privilege escalation", "permit", "permit signature", "signature re-use", "signature reuse"], } TARGETS = { "DAO (Reentrancy - $60M 2016)": {"address": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413", "expected_type": "reentrancy", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.8}, "Beanstalk (Governance Flash Loan - $182M 2022)": {"address": "0xC1E088fC1323b20BCBee9bd1B9fC9546db5624C5", "expected_type": "flash_loan_governance", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.7}, "Harvest USDC Vault (Oracle Manipulation - $34M 2020)": {"address": "0x3461B89F2c334aE37e0C3c1bD4d9c027d939fBc9", "expected_type": "flash_loan_oracle", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.6}, "Compound cETH (Flash Loan Attack Surface - $150M 2021)":{"address": "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5", "expected_type": "price_manipulation", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.6}, "Uniswap V1 imBTC Pool (Reentrancy ERC777 - $300K 2020)":{"address": "0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667", "expected_type": "reentrancy", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.5}, "Nomad Bridge (Improper Initialization - $190M 2022)": {"address": "0x88A69B4E698A4B090DF6CF5Bd7B2D47325Ad30A3", "expected_type": "improper_initialization", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.7}, "Parity Multisig (Uninitialized Proxy - $150M 2017)": {"address": "0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4", "expected_type": "uninitialized_proxy", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.7}, "Euler Finance (Donation Attack - $197M 2023)": {"address": "0x27182842E098f60e3D576794A5bFFb0777E025d3", "expected_type": "donation_attack", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.8}, "Cream Finance (Read-Only Reentrancy - $130M 2021)": {"address": "0x797AAB1ce7c01eB727ab980762bA88e7133d2157", "expected_type": "read_only_reentrancy", "expected_severity": "HIGH", "expected_lyapunov_min": 0.5}, "Multichain (Access Control - $126M 2023)": {"address": "0xC10Ef9F491C9B59f936957026020C321651ac078", "expected_type": "access_control", "expected_severity": "CRITICAL", "expected_lyapunov_min": 0.6}, } # Full LOCAL_SOURCE and audit logic: see zkaedi_audit.py in this repo