DAO-WARDEN
On-chain defense dossier · Arc Testnet

An AI guardian for the
DAO treasury.

Governance attacks drain treasuries through the voting mechanism itself — no code exploit, so no audit catches them. DAO-WARDEN watches, judges narrative against real calldata, and acts across two independent defense layers. Every claim below is proven on-chain.

Roadmap 0–7 complete chainId 5042002 Solidity + Foundry · 21/21 tests TypeScript + Viem · Claude Haiku ERC-8004 identity
The thesis — one attack, three outcomes

The same treasury-draining proposal, run three ways.

An attacker holding 5% of supply clears the 1% quorum alone and proposes to withdraw the entire 1,000,000 mUSD treasury to itself. What changes between columns is only who is defending.

Baseline · Stage 2 · no guardian

The treasury is drained

Honest holders stay passive. Nobody objects.
Treasury aftermUSD
0
EXECUTED — 1,000,000 → 0
Vote defense · Stage 5

Defeated during the vote

Agent votes NO with delegated power (100k).
Treasury aftermUSD
1,000,000
DEFEATED — For 50k < Against 100k
Timelock defense · Stage 7

Cancelled after it won

Attack wins the vote; agent cancels in the window.
Treasury aftermUSD
1,000,000
CANCELED — execute rejected

Why two layers. The vote defends during voting and needs delegated power. The timelock defends after a won vote — it saves the case even when the attacker holds a real majority. The timelock buys time; the guardian uses it. Together they cover both.

The problem — the BONK attack class

Three legitimate settings, combined into a weapon.

Reference case: the July 2026 BONK DAO attack. A few million dollars of tokens, extremely low turnout, a self-voted proposal — and a drained treasury. No contract was hacked. We reproduce this vulnerability class on EVM as a proving ground.

quorum 1%
Low quorum. A tiny fraction of tokens is enough to pass a proposal — a 5% holder alone clears it five times over.
threshold 0
Zero proposal threshold. Anyone can submit any proposal, with no tokens staked to do so.
no timelock
No defense window. Once voting ends, funds leave in the same transaction. The honest community gets no time to react.
Detection — how the guardian judges

Deterministic rules catch the mechanics. The LLM catches the intent.

The core is deterministic and auditable, built before the AI layer and running without it. Claude Haiku adds one thing rules can't: judging whether the human-facing narrative honestly matches the calldata. Here is the agent's real readout of the WGIP-1 attack.

proposal WGIP-1 · "Operational grant for ecosystem growth" CRITICAL · 100/100
+30TREASURY_SPEND — moves funds out of the vault
+40TREASURY_FRACTION — drains 100% of the asset balance
+15SELF_DEALING — payout recipient == proposer
+15PROPOSER_MEETS_QUORUM — proposer's power alone clears quorum
Claude Haiku · narrative vs. action · MAJOR_MISMATCH 95/100
"An 'operational grant' description masks a transfer of 100% of the treasury to the proposer's own address — a BONK-signature attack."
01 · listen

ProposalCreated

Watches the Governor for every new proposal, live.

→
02 · decode

Calldata → intent

Recognizes Treasury.withdraw by selector 0xd9caed12.

→
03 · score

Four hard rules

Evaluated at the proposal's creation block, not after.

→
04 · decide

VOTE_NO / cancel

Core ≥ 45 or LLM major mismatch triggers a reaction.

Defense — the two layers, in detail

One guardian, two ways to stop the drain.

Layer 1 · Stage 5

Vote with the apathetic majority's power

Honest holders delegate their vote to the always-on guardian. Above the risk threshold it casts NO with that delegated power. In the live run: For 50k versus Against 100k → the proposal is defeated and the treasury is untouched.

acts DURING the voting period
Layer 2 · Stage 7

Cancel in the timelock window

The mitigated DAO routes execution through a TimelockController — exactly one variable changed, quorum and threshold left deliberately weak. Holding CANCELLER_ROLE, the agent cancels the queued drain during the minDelay window. Even after a won vote: state Canceled, execute rejected.

acts AFTER the vote succeeds
Accountability — ERC-8004 Trustless Agents

The guardian has a portable identity and a tamper-evident record.

The agent registered itself as an ERC-721 identity with an AgentCard on IPFS. Every decision is committed on-chain and independently scored — so a delegate you entrust with real voting power is itself auditable.

Audit trail

Decisions are cryptographic commitments

For each evaluated proposal the agent files a validationRequest whose requestHash is the keccak256 of the canonical decision record. Verified to the byte: the stored record's hash equals the on-chain hash, and its CID equals the on-chain requestURI. A decision cannot be silently changed later.

Reputation

An independent validator scores the call

A separate validator wallet answers with a 0–100 score aggregated into the agent's reputation. On the real WGIP-1 defense the validator confirmed the decision 100/100 → reputation: 1 review, average 100.

Proofs — deployed & independently verified with cast

On-chain evidence.

Vulnerable DAO — baselineGovernor 0x0CbCaa61344Efef42916a7461e1bF2B673Fc4a21
Baseline attack tx0x0381784133e786bbbeccd67da354ae0f07b7b50e9f17c4f1eb93eb4ce5cbdd21 · status 1 · treasury 1,000,000 → 0
TimelockController0x5fB14e2398E53d15E044b770B8aCB67FDa04337f · minDelay 120s
Timelocked Governor0x641181a13c3114392e40fB4dc0785ACE279E9c1E · Treasury owner = timelock
Stage 7 cancel tx0x0b4265cd43… · state Canceled · treasury intact · execute rejected
IdentityRegistry0x103D690aAc91D88adc01701431dB7e65a9b915fd · agentId 1
ValidationRegistry0x15E965CE0eDa0668464E41D88bca31212b96D33F · reputation 100/100
Global agent ideip155:5042002:0x103D…915fd:1