Skip to content

Commit 7faa3ab

Browse files
authored
API-1627 - Updated Submission Process Documentation (#1423)
* chore: copy images to new caip-19 folders * chore: remove non-erc20s * chore: updated docs * chore: updated documentation further * chore: update documentation * Update README.md
1 parent 6a1cf01 commit 7faa3ab

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
A mapping of checksummed Ethereum contract addresses to metadata, like names, and images of their logos.
44

55
All address keys follow the [EIP 55 address checksum format](https://github.com/ethereum/EIPs/issues/55).
6+
All file keys follow the [CAIP 19 asset id format](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md).
67

78
This repository is effectively frozen. We recommend that developers of new tokens use [EIP 747](https://docs.metamask.io/guide/registering-your-token.html) to ask the user's permission to display your tokens in their wallet. This reduces the dangers of airdrop-based phishing, and reduces administrative overhead from managing this list.
89

@@ -15,47 +16,52 @@ import contractMap from '@metamask/contract-metadata'
1516
import ethJSUtil from 'ethereumjs-util'
1617
const { toChecksumAddress } = ethJSUtil
1718

18-
function imageElFor (address) {
19-
const metadata = contractMap[toChecksumAddress(address)]
19+
function imageElForEVMToken (chainId, address) {
20+
const caip19Address = `eip155:${chainId}/erc20:${toChecksumAddress(address)}`
21+
const metadata = contractMap[caip19Address]
2022
if (metadata?.logo) {
2123
const fileName = metadata.logo
22-
const path = `${__dirname}/images/contract/${fileName}`
24+
const path = `${__dirname}/${metadata.logo}`
2325
const img = document.createElement('img')
2426
img.src = path
2527
img.style.width = '100%'
2628
return img
2729
}
2830
}
29-
30-
imageElFor ("0x06012c8cf97BEaD5deAe237070F9587f8E7A266d")
31+
// to get ethereum erc20 token img el
32+
const ethereumNetworkChainId = 1
33+
imageElForEVMToken (ethereumNetworkChainId, "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d")
3134
```
3235
3336
## Submission Process
3437
3538
Maintaining this list is a considerable chore, and it is not our highest priority. We do not guarantee inclusion in this list on any urgent timeline. We are actively looking for fair and safe ways to maintain a list like this in a decentralized way, because maintaining it is a large and security-delicate task.
3639
3740
1. Fork this repository.
38-
2. Add your logo image in a web-safe format to the `images` folder.
39-
3. Add an entry to the `contract-map.json` file with the specified address as the key, and the image file's name as the value.
41+
2. Add your logo image in `.svg` file format to the `icons/` folder.
42+
3. Add your asset metadata in a json format to a `metadata/${caip19AssetId}.json` file with the CAIP-19 Asset ID as the key inside of the `metadata/` folder.
4043
4144
Criteria:
4245
43-
- The icon should be small, square, but high resolution, ideally a vector/svg.
44-
- The address should be in checksum format or it will not be accepted.
45-
- Do not add your entry to the end of the JSON map, messing with the trailing comma. Your pull request should only be an addition of lines, and any line removals should be deliberate deprecations of those logos.
46+
- The icon should be small, square, but high resolution, and a vector/svg.
47+
- The address should be in checksum format or it will not be accepted. This is true of non-evm assets as well - since some network's addressing formats are case-sensitive.
4648
- PR should include link to official project website referencing the suggested address.
4749
- Project website should include explanation of project.
4850
- Project should have clear signs of activity, either traffic on the network, activity on GitHub, or community buzz.
4951
- Nice to have a verified source code on a block explorer like Etherscan.
50-
- Must have a ['NEUTRAL' reputation or 'OK' reputation](https://info.etherscan.com/etherscan-token-reputation) on Etherscan.
52+
- Must have a ['NEUTRAL' reputation or 'OK' reputation](https://info.etherscan.com/etherscan-token-reputation) on Etherscan if it is an Ethereum-network asset. Other EVM Networks will be verified as possible.
53+
- Assets must not be ERC-721s or ERC-1155s.
5154
5255
A sample submission:
5356
5457
```json
5558
{
56-
"0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef": {
59+
"eip:155/erc20:0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef": {
5760
"name": "ENS Registrar",
58-
"logo": "ens.svg"
61+
"decimals": 18,
62+
"symbol": "ENS",
63+
"erc20": true,
64+
"logo": "./icons/eip:155/erc20:0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef.svg"
5965
}
6066
}
6167
```

0 commit comments

Comments
 (0)