2026-11-07 hackathon security round (NEAR x402 / SpendGuard). Focus areas
checked this round: scam_detection.rs dispute/circuit-breaker path, near
finality handling in the x402 gateway, policy/exposure edge-math, and
same-signer concurrent spend_to_seller calls.
No new exploitable bug found. The one genuinely new test added here proves
(not just reasons about) focus area 4: fired two real spend_to_seller
transactions from the SAME Function Call Access Key via tokio::join! (true
concurrency, not sequential awaits) against a reservation sized so only one
could legally succeed. First attempt (with a cold near-workspaces nonce
cache) revealed a client-harness-only artifact: concurrent first-use nonce
fetching can produce two byte-identical transactions that nearcore
collapses into one execution — not a contract bug, confirmed by reading
near-workspaces' own fetch_tx_nonce. After warming the nonce cache so both
transactions get genuinely distinct nonces, the real result holds: one
spend succeeds, the other is correctly rejected by the contract's own
require! check ("requested spend exceeds the agent's remaining reserved
credit line") — no double-spend, no lost update, confirmed live against a
real local nearcore sandbox node.
scam_detection.rs (dispute spike + emergency freeze), near_finality.ts's
optimistic-settle-then-reconcile design, and policy.rs's clamp/overflow
behavior were all read end-to-end and ruled out — see cred402 plan history
for the full writeup of what was checked in each area.
18/18 Rust unit tests still green, cargo clippy clean, both sandbox tests
green, 450/450 TS tests green, tsc clean — zero regressions.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>