Skip to content

feat: B20 Playground demo (/demos/b20) + explorer B20 decoding - #54

Open
montycheese wants to merge 1 commit into
mainfrom
b20-docs-vercel-preview
Open

feat: B20 Playground demo (/demos/b20) + explorer B20 decoding#54
montycheese wants to merge 1 commit into
mainfrom
b20-docs-vercel-preview

Conversation

@montycheese

@montycheese montycheese commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the B20 Playground interactive demo at /demos/b20 — a hands-on tour of Base-native B20 tokens on Vibenet — plus the explorer decoding needed to surface B20 events, and small shared UI primitives.

Note: this branch started as a Vercel preview fork of feat/add-b20-docs (that branch's original PR #45 is closed). It has since become the canonical, merge-ready branch: the preview-only no-op was removed and the code has been through audit, review, and a structural cleanup. It targets main.

What's included

B20 Playground demo (app/demos/b20/) — four modules behind a tab bar:

Policy Viewer — inspect any B20's policy scopes, resolve the Policy Registry, and check whether an address is authorized per scope.
Memos — attach an indexed bytes32 memo to transfers/mints/burns, with an on-chain memo history for the selected token.
Announcements — publish Asset-token disclosures and schedule UI-multiplier updates through the on-chain announcement bracket (operator-gated), with inline success confirmation.
Native Deployment — create Asset/Stablecoin B20 tokens through the singleton Factory precompile, with a deterministic-address preview and a post-deploy success view.
Structured as a thin B20Demo orchestrator (state + wallet/inspect/send wiring) that dispatches to per-module components, with shared lib/ (types, constants, viem client, protocol ABIs/helpers, glossary, prompts, samples) and reusable components/ primitives.

Explorer support (app/vibenet/)

library/explorer.ts — pure decoders for the B20 announcement bracket (Announcement / UIMultiplierUpdated / EndAnnouncement), bytes32 memo calldata/events, executeBatch, ERC-20 transfers, and EIP-8130 scope/type formatting.
explorer/tx/[hash]/page.tsx — renders those decoded B20 events in the transaction viewer.
Shared UI

components/ui/InfoTooltip.tsx — accessible tooltip used for inline concept help across the demo.
components/ui/icons.tsx — added icons.
components/ui/Modal.tsx — accessibility improvements (labelled dialog, focus move-in/restore).
Wiring & docs — demo catalogue entry, sitemap, globals.css animations, and regenerated llms.txt / AGENTS.md.

Testing

app/demos/b20/lib/protocol.test.ts — variant/address parsing, memo bytes32 round-trip + boundaries, deployment-param ABI encoding, amount validation, featureId, formatAmount.
app/demos/b20/lib/prompts.test.ts — prompt catalogue integrity.
app/vibenet/library/explorer.test.ts — all memo-call shapes, the announcement-bracket events, executeBatch offset decoding, the EIP-8130 scope bitmask, and number/type formatters (fixtures built with viem encoders so they match on-chain layout).
npm run typecheck, npm run lint, npm run build, and npm test (73 tests) all pass. The four modules were verified in-browser.

Notes for reviewers

The demo runs against Vibenet (raw EIP-1193 wallet + viem for reads); it carries the Vibenet maintenance banner and is unusable while the devnet is down.

Interactive B20 demo — Policy viewer, Memos, Announcements, Native Deployment,
and policy create/attach — plus the Vibenet explorer decoders that surface B20
announcement-bracket and bytes32 memo events, shared InfoTooltip + Modal a11y,
icons, and the changelog → demo link.

Rebuilt as a single clean change on top of the squashed main (the old
b20-docs-vercel-preview history was based on pre-squash main).
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
omni-ui Ready Ready Preview Aug 10, 2026 6:38pm

Request Review

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.

2 participants