Skip to content

Base/EVM canonical: port Phases 5–7 (disputes/slashing/refunds) + fix Lane B F-1 #55

Description

@dirtybits

Tracking issue for the engineering work that has to land before Base/EVM can be called the canonical AgentVouch chain. Context: the gas-free UI + live x402 agent purchase (#53) settled the UX question, but the deployed AgentVouchEvm (Base Sepolia 0x5D90…913E) is Phases 0–4 only — the trust-enforcement half of the protocol does not exist in Solidity yet. Decision framing in docs/KORA_VS_BASE_X402.md (#54) and docs/BASE_POC_INTERIM.md.

This issue makes the "fund the bet" sequence actionable. It is gated on an explicit decision (item 0) — none of the build work below should start until the x402/agent-commerce distribution bet is committed.

0 · Decision gate (blocks everything below)

  • Founder commits the x402 distribution bet in writing: "AgentVouch is an agent-commerce protocol; native x402/EIP-3009 presence is worth a protocol re-implementation + second audit." Without this, ship Kora on Solana and keep Solana canonical (see .agents/plans/kora-usdc-fee-abstraction.plan.md).

1 · Port Phases 5–7 to the EVM contract (parity with Solana)

The Solana program has these; the EVM contract does not. Port by spec, not transpilation, matching the Solana semantics.

  • DisputesopenDispute / resolveDispute, dispute statuses (Open/Resolved/SlashingVouchers), and the bond/listing locks (the EVM contract already has DisputeLocked/BondExposureLocked errors + openDisputes counters wired as no-op guards — fill in the lifecycle that sets them).
  • Voucher slashing — liability scopes (AuthorBondOnly, AuthorBondThenVouchers), the VouchStatus.Slashed transition (Phase 5 residual rules referenced at AgentVouchEvm.sol vouch), and stake reduction accounting.
  • Refunds — buyer refund claims against slashed/disputed purchases, preserving the reward-index + proceeds accounting invariants.
  • Foundry test parity: replicate the Solana dispute/slash/refund test surface; reach green with the existing 66 tests still passing.
  • Adversarial re-audit pass (parity / insolvency / solidity-security) as was done for Phases 0–4.

2 · Fix Lane B F-1 (EIP-3009 fund-stranding)

The signed authorization names the contract as to, so it can be replayed straight to USDC — funds land in the contract with no purchase receipt, stranded (test_laneB_frontRunStrandsFundsNoReceipt). Re-surfaced in #53.

  • Adopt receiveWithAuthorization (binds msg.sender == to) or a documented reconciliation/sweep path. Note: a sweep tends to reintroduce some settlement-authority trust — weigh against Lane B's trust-minimization, the whole reason it exists.
  • Test the chosen fix closes the stranding edge; update the harness (agent-x402-demo.ts) + UI accordingly.

3 · Production hardening (before any hosted/mainnet surface)

  • Lock the CDP paymaster policy — the bundler URL is browser-exposed (VITE_CDP_RPC_URL in feat(base-poc): Base Sepolia gas-free UI + x402 agent purchase flow #53's UI); a hosted UI makes it a drainable sponsorship endpoint. Allowlist the contract + USDC approve/transfer calls and rate-limit.
  • Bring contracts/base-poc/ui + harness into CI typecheck (currently outside the repo's scoped typecheck — tsc --noEmit is a local-only claim).
  • Second external audit of the full EVM surface (Phases 0–7).
  • Live-USDC Base mainnet deploy + config init.

4 · Migration & operations

  • State-migration plan for existing Solana reputation / vouches / author bonds → Base.
  • Explicit decision: dual-chain operation vs. Solana sunset, with a cutover plan (see docs/DATABASE_CUTOVER.md for prior cutover shape).
  • Web/API/CLI adapter swap (web/lib/chains.ts already carries eip155:8453).

Parallel track (not blocked by item 0)

  • Ship the Kora fee-only spike on the Solana RC path (.agents/plans/kora-usdc-fee-abstraction.plan.md). Removes live "you need SOL" friction now, keeps Solana usable through any migration window, and is not wasted if Base wins.

Refs: #53 (UX + x402 POC), #54 (decision doc), docs/BASE_POC_INTERIM.md (Phase 4.5 gate).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions