This repo is where token logos for all yearn assets and chains are stored for use in our web apps. There is an app to upload images into the repo as well as some legacy APIs that generally can be ignored.
There are multiple different apps and elements in this repo. Please read carefully below
- Source assets:
tokens/<chainId>/<address>/withlogo.svg,logo-32.png,logo-128.png. - Chain assets:
chains/<chainId>/ - Image Upload App:
app/image-tools/contains a repo where users can upload token logos to the repo. It is wholly unrelated to anything in the_config/folder and when working on this app, you should ignore the _config folder and its contents. - Deprecated APIs:
_config/,_config/nodeAPI, and_config/goAPIcontain legacy code for APIs to serve the token logos that we do not actively use but still support for legacy applications. Generally they should be ignored unless explicitly requested to work on them. - Automation:
scripts/(e.g.,ingestTokens.jsand image inputs underscripts/token-images-to-ingest/). - Root configs:
.editorconfig,.prettierrc,package.json.
- Format (root):
yarn formatornpm run format— applies Prettier to the repo. - Check format:
yarn format:check— verifies formatting without writing. - Next.js dev (API):
yarn --cwd _config/nodeAPI dev— starts the local API for previewing assets. - Next.js build:
yarn --cwd _config/nodeAPI build— type-checks and builds the API bundle. - Ingest assets:
node scripts/ingestTokens.js ./scripts/tokensToInjest.json— copies/renames prepared images intotokens/.
- Indentation: tabs, width 4 (
.editorconfig). - Prettier: single quotes, semicolons, 120 col width.
- Asset files per token:
logo.svg,logo-32.png,logo-128.png. - Addresses: lowercase for EVM chains.
- Directory names: numeric
chainId(orbtcm).
- No formal test suite. Validate by:
- Running
yarn --cwd _config/nodeAPI devand fetching/api/token/<chainId>/<address>/logo-32.png. - Ensuring both PNG sizes exist and load; prefer PNG for production.
- Running
yarn format:checkandyarn --cwd _config/nodeAPI lintwhen editing_config/nodeAPI.
- Running
- Commit style: conventional prefixes preferred (
chore:,fix:, etc.). - PRs must include: change summary, sample asset URL(s), and chain/address context.
- For new tokens, show the exact path created (e.g.,
tokens/1/0xabc.../). - Link related issues when applicable; add screenshots of rendered PNGs if helpful.
- Optimize SVGs (keep simple; large/complex SVGs hinder performance).
- Ensure PNGs are exactly 32×32 and 128×128.
- Do not commit secrets or binaries outside
tokens/and_config/build outputs.