Skip to content

Add a standalone autonomous auditor (no Slither/Aderyn required) - #1

Merged
sharthak18 merged 7 commits into
mainfrom
arena/01a0350c-self-smart-contract-auditing-t
Aug 25, 2026
Merged

sharthak18 merged 7 commits into
mainfrom
arena/01a0350c-self-smart-contract-auditing-t

Conversation

@arena-ai-coding-agent

Copy link
Copy Markdown
Contributor

Summary

SELF becomes a project-wide autonomous auditor (self autonomous / self agent / self train) that can stand on its own. Default self TARGET stays offline and unchanged. Catalog stays at 161 detectors; RULE_VERSION stays 2.3.0.

  • Reasoner + brain. Ingest the whole repo, build protocol facts, retrieve trained playbooks (51 attack vectors, 24 incidents, 16 expert tactics), and emit exploit paths. No new catalog IDs.
  • C4-replay precision. Per-function facts for caller-supplied domain separators, oracle decimals, unbound Permit2 tokens, whitelist burns, and unmarked bad debt. Drop FPs on settings() getters, __gap, hardhat *, and sqrtPriceLimitX96.
  • Honor the brief. Walk up to the contest root; parse known issues, trusted roles, and in/out-of-scope files; skip accepted playbooks and OOS paths.
  • PDFs and links. Inventory README https links, audits/*.pdf, and prior-audit markdown. --online (opt-in) fetches those URLs with SSRF guards and queries OSV.dev for pinned npm/PyPI/crates versions.
  • Slither-class deep pass. Per-function facts/playbooks for arbitrary transferFrom / ETH send, msg.value in a loop, locked ether, abi.encodePacked collisions, unused low-level returns, mapping-delete, and balance ==. Negative cases (transferFrom(msg.sender), withdraw-to-sender, require(ok), receive+withdraw, static packed types) do not fire. Users do not need to run Slither or Aderyn for these classes.

Test plan

  • python -m unittest discover -s tests -q — 151 OK
  • Catalog 161 = review profiles 161; RULE_VERSION 2.3.0
  • Default scan does not import self_tool.autonomous
  • Deep-scan positives and negatives in tests/test_deep_scan.py
  • Contest-brief, PDF/link inventory, and --online SSRF/OSV coverage in tests/test_online_docs.py / tests/test_autonomous.py

sharthak18 and others added 7 commits August 24, 2026 19:32
Ship self autonomous / self agent / self train (v2.4.0) as a project-wide
reasoner that stays off the default offline scan path. Bundle a retrieval
brain of attack playbooks, math models, business-logic invariants, and
dependency advisories, then enrich it with public post-mortems and expert
tactics (Euler, KyberSwap, Prisma, Penpie, Cetus, Immunefi 2025, ToB,
Pashov, Spearbit, Sherlock/C4) without minting catalog detectors.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Run SELF v2.4.0 on the exact pre-audit 2024-05-bakerfi snapshot and
compare High/Med findings to the published C4 report. Hits are first-
depositor inflation, zero-slippage swaps, and flash-loan callback
hygiene; protocol-specific harvest/oracle-decimal bugs are misses.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Blind replays of BakerFi plus nine Code4rena snapshots showed the
reasoner was not hallucinating: it ORed facts across the repo, treated
comments and interfaces as implementation, and never asked what a
caller-supplied argument binds. Teach per-function facts for domain
separators, oracle decimals, Permit2 tokens, whitelist burns, and
unmarked bad debt; stop firing on settings() getters, __gap, hardhat *,
and sqrtPriceLimitX96. 117 tests green; RULE_VERSION stays 2.3.0.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The 10 C4 replays never put the sponsor README in front of the reasoner
(no_docs + .sol-only copies, and DocReader had no contest-brief parser).
Walk up to the contest root, parse known issues / trusted roles / scope,
skip accepted playbooks and OOS files, and keep those facts in the
briefing. 121 tests; RULE_VERSION stays 2.3.0.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Default scans stay offline. The reasoner now inventories README
https links, audits/*.pdf, and prior-audit markdown and keeps them
in the briefing. self autonomous --online fetches those links with
SSRF guards and queries OSV.dev for pinned npm/PyPI/crates versions.
Language reasoner tests cover Vyper, Huff, Move, and Rust. 136 tests;
RULE_VERSION stays 2.3.0.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Walk extracted function bodies for arbitrary transferFrom/ETH send,
msg.value-in-loop, locked ether, encodePacked collisions, unused
low-level returns, mapping-delete, and balance equality. Facts and
playbooks only — no catalog detectors, RULE_VERSION stays 2.3.0.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@sharthak18
sharthak18 merged commit 9b332df into main Aug 25, 2026
5 of 6 checks passed
@sharthak18
sharthak18 deleted the arena/01a0350c-self-smart-contract-auditing-t branch September 1, 2026 18:46
@sharthak18
sharthak18 restored the arena/01a0350c-self-smart-contract-auditing-t branch September 1, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant