{"x402Version":2,"resource":"https://preflight--preflight-api-api.us-east.modal.run","service":"Preflight","service_name":"Preflight","description":"Pay-per-call smart-contract & transaction pre-flight security API. Submit Solidity source or a transaction for simulation and receive a severity-scored, EIP-712-attested verdict, paid per call via x402 (HTTP 402 + USDC on Base mainnet).","version":"0.1.0","protocol":"x402","tags":["security","solidity","smart-contracts","simulation","audit"],"payment":{"scheme":"exact","network":"base","network_caip":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","asset_symbol":"USDC","asset_decimals":6,"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","pay_to":"0x5515f59a30fe2b9152cd5648a3a0d8c30c837d41","max_timeout_seconds":60},"pricing":{"POST /v1/scan":{"price":"$0.01","amount":"10000","description":"Smart-contract security scan (static + custom DeFi detectors)","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/sim":{"price":"$0.05","amount":"50000","description":"Transaction pre-flight simulation (RPC eth_call)","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/sim/deep":{"price":"$0.25","amount":"250000","description":"Deep transaction simulation (anvil fork: gas, balance deltas, traces)","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/scan/project":{"price":"$0.10","amount":"100000","description":"Multi-file project security scan","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/address-risk":{"price":"$0.005","amount":"5000","description":"Address risk heuristics","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/token-risk":{"price":"$0.02","amount":"20000","description":"Token risk by address: honeypot verdict, transfer tax, owner privileges","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"},"POST /v1/bundle":{"price":"$0.03","amount":"30000","description":"Bundle: token-risk + address-risk + (optional) source scan in one call","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact"}},"endpoints":{"GET /":"service info and price list (free)","GET /health":"health check (free)","GET /metrics":"revenue and usage metrics (free)","POST /v1/scan":"Smart-contract security scan (static + custom DeFi detectors) ($0.01)","POST /v1/sim":"Transaction pre-flight simulation (RPC eth_call) ($0.05)","POST /v1/sim/deep":"Deep transaction simulation (anvil fork: gas, balance deltas, traces) ($0.25)","POST /v1/scan/project":"Multi-file project security scan ($0.10)","POST /v1/address-risk":"Address risk heuristics ($0.005)","POST /v1/token-risk":"Token risk by address: honeypot verdict, transfer tax, owner privileges ($0.02)","POST /v1/bundle":"Bundle: token-risk + address-risk + (optional) source scan in one call ($0.03)","GET /llms.txt":"LLM-facing service description","GET /v1/verify":"attestation verification (free)","GET /.well-known/x402.json":"this file","EXTERNAL /v1/pair-check (Greenlight)":"Wallet×token×trade-size clearance — $0.03 via x402"},"related_services":[{"name":"Greenlight","description":"Pre-trade wallet×token clearance: can this wallet safely trade this token?","url":"https://preflight--greenlight-api-api.modal.run","pair_check":"https://preflight--greenlight-api-api.modal.run/v1/pair-check","price":"$0.03","relationship":"complementary — Preflight analyzes the contract, Greenlight clears the trade"}],"extensions":{"bazaar":{"POST /v1/scan":{"info":{"input":{"type":"http","bodyType":"json","body":{"source":"pragma solidity ^0.8.20; contract VulnerableVault { ... }","contract_name":"VulnerableVault"},"method":"POST"},"output":{"type":"json","example":{"verdict":"block","score":92.5,"findings":[{"id":"reentrancy-no-eth","title":"Reentrancy on withdraw()","severity":"critical","confidence":0.98,"description":"External call before state update","snippet":null,"detector":"slither","reference":null}],"contract_name":"VulnerableVault","solc_version":"0.8.20","scanner_versions":{"slither":"0.10.4","custom":"0.1.0"},"scanned_at":"2026-11-12T00:00:00Z","source_sha256":"0xabababababababababababababababababababababababababababababababab","attestation":null,"notes":[]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"source":{"type":"string","minLength":1},"contract_name":{"type":"string"},"solc_version":{"type":"string"}},"required":["source"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"POST /v1/scan/project":{"info":{"input":{"type":"http","bodyType":"json","body":{"files":{"Vault.sol":"pragma solidity ^0.8.20; contract Vault { ... }"},"contract_name":"Vault"},"method":"POST"},"output":{"type":"json","example":{"verdict":"block","score":92.5,"findings":[{"id":"reentrancy-no-eth","title":"Reentrancy on withdraw()","severity":"critical","confidence":0.98,"description":"External call before state update","snippet":null,"detector":"slither","reference":null}],"contract_name":"Vault","solc_version":"0.8.20","scanner_versions":{"slither":"0.10.4","custom":"0.1.0"},"scanned_at":"2026-11-12T00:00:00Z","source_sha256":"0xabababababababababababababababababababababababababababababababab","attestation":null,"notes":[]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"files":{"type":"object","additionalProperties":{"type":"string"}},"contract_name":{"type":"string"},"solc_version":{"type":"string"}},"required":["files"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"POST /v1/sim":{"info":{"input":{"type":"http","bodyType":"json","body":{"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0xa9059cbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001","value_wei":"0"},"method":"POST"},"output":{"type":"json","example":{"verdict":"block","score":85.0,"findings":[{"id":"sim:revert","title":"Simulated call reverts","severity":"high","confidence":1.0,"description":"ERC-20 transfer reverted: transfer amount exceeds balance","snippet":null,"detector":"heuristic:simulation","reference":null}],"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","from_address":"0x000000000000000000000000000000000000dEaD","value_wei":"0","reverted":true,"revert_reason":"ERC20: transfer amount exceeds balance","gas_used":"24312","simulated_at":"2026-11-12T00:00:00Z","simulator":"rpc-ethcall:v1","attestation":null,"notes":["demo: caller has no USDC, so transfer() reverts"]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"to":{"type":"string","minLength":42,"maxLength":42},"data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"value_wei":{"type":"string"},"from_address":{"type":"string"},"source":{"type":"string"}},"required":["to"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"POST /v1/sim/deep":{"info":{"input":{"type":"http","bodyType":"json","body":{"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0xa9059cbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001","value_wei":"0"},"method":"POST"},"output":{"type":"json","example":{"verdict":"block","score":85.0,"findings":[{"id":"sim:revert","title":"Simulated call reverts","severity":"high","confidence":1.0,"description":"ERC-20 transfer reverted: transfer amount exceeds balance","snippet":null,"detector":"heuristic:simulation","reference":null}],"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","from_address":"0x000000000000000000000000000000000000dEaD","value_wei":"0","reverted":true,"revert_reason":"ERC20: transfer amount exceeds balance","gas_used":"51234","simulated_at":"2026-11-12T00:00:00Z","simulator":"anvil-fork:v1","attestation":null,"notes":["demo: caller has no USDC, so transfer() reverts"],"balance_delta_wei":"-1000000000000000","internal_calls":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 → transfer(address,uint256) 0xa9059cbb","0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 → revert ERC20: transfer amount exceeds balance"]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"to":{"type":"string","minLength":42,"maxLength":42},"data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"value_wei":{"type":"string"},"from_address":{"type":"string"},"source":{"type":"string"}},"required":["to"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"POST /v1/address-risk":{"info":{"input":{"type":"http","bodyType":"json","body":{"address":"0x5515f59a30fe2b9152cd5648a3a0d8c30c837d41"},"method":"POST"},"output":{"type":"json","example":{"verdict":"looks_ok","address":"0x5515f59a30fe2b9152cd5648a3a0d8c30c837d41","findings":[],"checked_at":"2026-11-12T00:00:00Z","attestation":null}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"address":{"type":"string","minLength":42,"maxLength":42}},"required":["address"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"mcp":{"preflight_check":{"info":{"input":{"type":"mcp","toolName":"preflight_check","description":"Scan Solidity source and return a severity-scored security verdict ($0.01).","transport":"streamable-http","inputSchema":{"properties":{"source":{"type":"string"},"contract_name":{"type":"string"}},"required":["source"]},"example":{"source":"contract VulnerableVault { ... }","contract_name":"VulnerableVault"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"mcp"},"toolName":{"type":"string"},"inputSchema":{"type":"object"},"description":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","sse"]},"example":{"type":"object"}},"required":["type","toolName","inputSchema"],"additionalProperties":false}},"required":["input"]}},"preflight_sim":{"info":{"input":{"type":"mcp","toolName":"preflight_sim","description":"Simulate a transaction and return revert/gas/balance-delta/internal-call findings (quick $0.05, deep anvil fork $0.25).","transport":"streamable-http","inputSchema":{"properties":{"to":{"type":"string"},"data":{"type":"string"},"value_wei":{"type":"string"},"mode":{"type":"string","enum":["quick","deep"]}},"required":["to"]},"example":{"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0xa9059cbb...","value_wei":"0","mode":"deep"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"mcp"},"toolName":{"type":"string"},"inputSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["quick","deep"]}}},"description":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","sse"]},"example":{"type":"object"}},"required":["type","toolName","inputSchema"],"additionalProperties":false}},"required":["input"]}},"preflight_token_risk":{"info":{"input":{"type":"mcp","toolName":"preflight_token_risk","description":"Check a token before trading: honeypot, transfer tax, owner privileges ($0.02).","transport":"streamable-http","inputSchema":{"properties":{"address":{"type":"string"}},"required":["address"]},"example":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"mcp"},"toolName":{"type":"string"},"inputSchema":{"type":"object"},"description":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","sse"]},"example":{"type":"object"}},"required":["type","toolName","inputSchema"],"additionalProperties":false}},"required":["input"]}},"preflight_bundle":{"info":{"input":{"type":"mcp","toolName":"preflight_bundle","description":"Combined token-risk + address-risk + optional source scan ($0.03).","transport":"streamable-http","inputSchema":{"properties":{"address":{"type":"string"},"source":{"type":"string"}},"required":["address"]},"example":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"mcp"},"toolName":{"type":"string"},"inputSchema":{"type":"object"},"description":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","sse"]},"example":{"type":"object"}},"required":["type","toolName","inputSchema"],"additionalProperties":false}},"required":["input"]}},"preflight_verify":{"info":{"input":{"type":"mcp","toolName":"preflight_verify","description":"Verify a past attestation by source digest (free).","transport":"streamable-http","inputSchema":{"properties":{"digest":{"type":"string"},"attestation":{"type":"string"}},"required":["digest"]},"example":{"digest":"0xabababababababababababababababababababababababababababababababab"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"mcp"},"toolName":{"type":"string"},"inputSchema":{"type":"object"},"description":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","sse"]},"example":{"type":"object"}},"required":["type","toolName","inputSchema"],"additionalProperties":false}},"required":["input"]}}},"POST /v1/token-risk":{"info":{"input":{"type":"http","bodyType":"json","body":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"method":"POST"},"output":{"type":"json","example":{"verdict":"block","score":88.0,"findings":[{"id":"honeypot:transfer-restricted","severity":"high","title":"Transfer restricted (honeypot)"}]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"address":{"type":"string","description":"Token contract address"}},"required":["address"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}},"POST /v1/bundle":{"info":{"input":{"type":"http","bodyType":"json","body":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","source":"pragma solidity ^0.8.20; contract Token { ... }"},"method":"POST"},"output":{"type":"json","example":{"verdict":"review","score":50.0,"findings":[]}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"bodyType":{"type":"string","enum":["json","form-data","text"]},"body":{"properties":{"address":{"type":"string","description":"Token or contract address"},"source":{"type":"string","description":"Optional Solidity source"}},"required":["address"]}},"required":["type","method","bodyType","body"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object"}},"required":["type"]}},"required":["input"]}}}},"mcp":{"tools":{"preflight_check":"scan Solidity source ($0.01)","preflight_sim":"simulate a transaction (quick or deep)","preflight_token_risk":"check a token before trading ($0.02)","preflight_bundle":"combined token/address/source analysis ($0.03)","preflight_verify":"verify a past attestation (free)","preflight_pricing":"free price list"},"transport":"stdio | streamable-http"}}