There are three directories in the token wiki:
tags
token-list
token-metadata
.
├── tags
│ └──tags.json
│
├── token-list
│ └──tokenlist.json
│
│
├── token-metadata
│ └──<tokenAddress>
│ │ └──logo.png
│ │ └──metadata.json
| |
| |
│ └──<tokenAddress>
│ │ └──logo.png
│ │ └──metadata.json
│ │
│ └──<tokenAddress>
│ │ └──logo.png
│ │ └──metadata.json
...
The token-metadata
directory contains a folder for each token. The name of the token folders is the checksum address. In order to add a token, one adds a folder to the directory.
Each <tokenAddress>
folder can contain two files: logo.png
and metadata.json
.
The logo.png
file must meet the following requirements:
- File extension:
png
. UppercasePNG
is considered invalid. - File name:
logo.png
, all lowercase. - Dimension:
256 x 256 pixels
or512 x 512 pixels
. - Background: preferably transparent (should fit dark mode as well; deny logos need light border/background).
- File size: maximum 100kB. Tip: optimize image size, e.g. using simple drag-and-drop online service tinypng. (e.g., PNG format, max. pixel size of 512x512 and max. file size of 100kB). This logo will appear as the token icon inside the Dharma app and Uniswap.
The metadata.json
file has up to eight fields:
name
symbol
address
(checksummed)decimals
description
(an explainer on the token)dharmaVerificationStatus
(this indicates whether a token is the primary token for that symbol — can be eitherVERIFIED
,UNVERIFIED
, orBANNED
)socialLinks
(each has atype
field andvalue
field). The following are the permitted types:discord
twitter
telegram
website
tags
(ar array of relevant tags for the token, referenced by the corresponding key in thetags.json
file described below)
Example:
{
"name": "Compound",
"symbol": "COMP",
"address": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
"decimals": 18,
"dharmaVerificationStatus": "VERIFIED",
"description": "Compound is an algorithmic money market protocol on Ethereum that lets users earn interest or borrow assets against collateral. Anyone can supply assets to Compound's liquidity pool and immediately begin earning continuously-compounding interest. Rates adjust automatically based on supply and demand.",
"socialLinks": [
{
"type": "twitter",
"value": "https://twitter.com/compoundfinance"
},
{
"type": "website",
"value": "https://compound.finance"
},
{
"type": "discord",
"value": "https://discord.com/invite/cU7vmVW"
}
],
"tags": [
"defi",
"yield-farming",
"lending"
]
}
The tags
directory contains one file: tags.json
. This file contains a JSON object of tags with a mapping to it's name
and description
.
Example:
{
"stablecoin": {
"name": "Stablecoin",
"description": "Tokens that are fixed to an external asset, e.g. the US dollar"
},
"defi": {
"name": "DeFi",
"description": "Tokens that enable financial services using smart contracts"
},
"yield-farming": {
"name": "Yield Farming",
"description": "Tokens that earn rewards using permissionless liquidity protocols"
}
}
There are two ways to add a tag:
- Directly to the
tags.json
file - When a tag is added to the
tags
array in a token'smetadata.json
file, thetags.json
file is updated programmatically
When a tag is added to the wiki, it will appear in the list of tags at the top of the Search tab in the Dharma app, and can be referenced by third party applications as well.
There is no limit on the number of tags that can exist in the Dharma app, and we are excited about the possibility of thoroughly and comprehensively categorizing all of Ethereum's assets under relevant, high-signal tags.
The token-list
directory contains one file: tokenlist.json
. This file contains a JSON object that adheres to Uniswap's token list standard. See here for more information on the standard.
Important note - all updates to the tokenlist.json
file are done programmatically or by a Dharma admin.
There are three ways the tokenlist.json
file is updated:
- Any time a token's
metadata.json
file is created or updated, thetokenlist.json
file is updated programmatically - When a valid logo is uploaded as a
logo.png
file, thetokenlist.json
file is updated programmatically - Directly by a Dharma (e.g., adding a tag / keyword or bumping the major version number)
This token list is consumed by Uniswap so all added tokens will show up in the Uniswap interface under the Dharma list.