Skip to content

Add token asset upload flow#143

Open
rossgalloway wants to merge 5 commits into
codex/migrate-to-next-jsfrom
feat/add-token-asset-upload
Open

Add token asset upload flow#143
rossgalloway wants to merge 5 commits into
codex/migrate-to-next-jsfrom
feat/add-token-asset-upload

Conversation

@rossgalloway

Copy link
Copy Markdown
Collaborator

Summary

Move the tokenAssets image-upload tooling into the CMS so token editors can prepare and submit logos without leaving the metadata application. Add the token-logo download support from feat/add-token-logos, keep yearn/tokenAssets as the asset source of truth, and expose the new workflow from the tokens list and token detail pages.

This PR is stacked on #142 and should be reviewed after the Next.js migration.

How to review

Start with packages/app/src/routes/TokenAssetUpload.tsx and packages/app/src/lib/tokenAssetUpload.ts for the client workflow. Then review packages/app/src/server/tokenAssets and packages/app/app/api/token-assets for validation, ERC-20 name resolution, and fork-aware GitHub PR creation.

Happy path: open /tokens, select Add token logo, provide a chain/address and SVG, confirm both PNG previews, review the generated PR metadata, and submit with a GitHub-authenticated CMS session. Token detail pages should prefill the upload form.

Test plan

  • Automated: bun install --frozen-lockfile
  • Automated: bun run --cwd packages/app tslint
  • Automated: bun run lint
  • Automated: bun run build
  • Manual: verified tokens-list navigation and token detail URL prefilling
  • Manual: verified SVG upload, 32px/128px PNG generation, multiple assets, and IndexedDB draft restoration
  • Manual: verified ERC-20 name lookup against a live Ethereum token
  • Manual: verified unauthenticated and malformed upload requests return the expected 401/400 responses
  • Manual: create a real tokenAssets PR using a GitHub-authenticated production session

Risk / impact

The upload endpoint uses the signed-in user's GitHub token to create a branch and pull request in yearn/tokenAssets, falling back to the user's fork when direct writes are unavailable. It does not write to the tokenAssets default branch directly. Repository targets and RPC endpoints are configurable through server-only environment variables; rollback is a revert of this PR.

Move the tokenAssets image tooling into the CMS so token editors can
prepare logo files without leaving the app.

- Add token and chain asset forms with PNG generation and draft persistence
- Add ERC-20 name lookup and fork-aware GitHub PR route handlers
- Link the upload flow from token lists and token detail pages
- Document repository target and RPC configuration
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cms Ready Ready Preview, Comment Jul 23, 2026 7:51pm

Request Review

@rossgalloway
rossgalloway marked this pull request as ready for review July 23, 2026 19:58
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