Điểm qua MetaMask/contract-metadata: 583 sao trên GitHub, viết chủ yếu bằng JavaScript. A mapping of ethereum contract addresses to broadly accepted icons for those addresses.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A mapping of checksummed Ethereum contract addresses to metadata, like names, and images of their logos.
All address keys follow the EIP 55 address checksum format.
All file keys follow the CAIP 19 asset id format.
This repository is effectively frozen. We recommend that developers of new tokens use EIP 747 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.
Usage
You can install from npm with npm install @metamask/contract-metadata and use it in your code like this:
import contractMap from '@metamask/contract-metadata'
import ethJSUtil from 'ethereumjs-util'
const { toChecksumAddress } = ethJSUtil
function imageElForEVMToken (chainId, address) {
const caip19Address = `eip155:${chainId}/erc20:${toChecksumAddress(address)}`
const metadata = contractMap[caip19Address]
if (metadata?.logo) {
const fileName = metadata.logo
const path = `${__dirname}/${metadata.logo}`
const img = document.createElement('img')
img.src = path
img.style.width = '100%'
return img
}
}
// to get ethereum erc20 token img el
const ethereumNetworkChainId = 1
imageElForEVMToken (ethereumNetworkChainId, "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d")
CLI Tool for Managing Assets
This repository includes a CLI tool (cli-update-asset.js) to help manage contract metadata and icons following the CAIP-19 standard.
Available Commands
Add or Update an Asset
# Add a new asset
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Token Name" \
--symbol "SYMBOL" \
--decimals 18 \
--image ./path/to/logo.svg
# Update an existing asset
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Updated Token Name"
# Update labels
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--labels "stable_coin,blue_chip"
# Use an image URL
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Token Name" \
--symbol "SYMBOL" \
--decimals 18 \
--image "https://example.com/logo.png"
Verify an Asset
npm run asset:verify -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS"
List Assets
# List all assets in a namespace
npm run asset:list -- --namespace "eip155:1"
--decimals: Number of decimals (required for new assets)
--image: Path to image file or URL (required for new assets)
Supports: .svg, .png, .jpg, .jpeg
Can be a local file path or HTTP/HTTPS URL
--labels: Labels for the asset (optional)
Comma-separated values: stable_coin,blue_chip
Or JSON array: ["stable_coin","blue_chip"]
--erc20: Set to true or false (optional, auto-detected for erc20: prefix)
--spl: Set to true or false (optional, auto-detected for spl: prefix)
Workflow
Add or update an asset using npm run asset:set
Verify the changes using npm run asset:verify
Rebuild the contract-map.json: node buildindex.js
Review the changes in git
Commit and push your changes
The tool automatically:
Validates all inputs using Zod schemas
Renames icon files to match the asset ID
Removes old icons when updating with a new image
Auto-detects erc20 and spl fields based on the asset namespace
Downloads and saves images from URLs with the correct extension
Submission Process
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.
Fork this repository.
Add your logo image in .svg or .png file format to the icons folder.
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.
Criteria:
The icon should be small, square, but high resolution, and a vector/svg or a png. Please refer to the style guide for best practices.
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.
PR should include link to official project website referencing the suggested address.
Project website should include explanation of project.
Project should have clear signs of activity, either traffic on the network, activity on GitHub, or community buzz.
Nice to have a verified source code on a block explorer like Etherscan.
Must have a 'NEUTRAL' reputation or 'OK' reputation on Etherscan if it is an Ethereum-network asset. Other EVM Networks will be verified as possible.
Tokens should include a field "erc20": true, and can include additional fields:
symbol (a five-character or less ticker symbol)
decimals (precision of the tokens stored)
A full list of permitted fields can be found in the permitted-fields.json file.
Release & Publishing
The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions action-create-release-pr and action-publish-release are used to automate the release process; see those repositories for more information about how they work.
Choose a release version.
The release version should be chosen according to SemVer. Analyze the changes to see whether they include any breaking changes, new features, or deprecations, then choose the appropriate SemVer version. See the SemVer specification for more information.
If this release is backporting changes onto a previous release, then ensure there is a major version branch for that version (e.g. 1.x for a v1 backport release).
The major version branch should be set to the most recent release with that major version. For example, when backporting a v1.0.2 release, you'd want to ensure there was a 1.x branch that was set to the v1.0.1 tag.
Trigger the workflow_dispatch event manually for the Create Release Pull Request action to create the release PR.
For a backport release, the base branch should be the major version branch that you ensured existed in step 2. For a normal release, the base branch should be the main branch for that repository (which should be the default value).
This should trigger the action-create-release-pr workflow to create the release PR.
Update the changelog to move each change entry into the appropriate change category (See here for the full list of change categories, and the correct ordering), and edit them to be more easily understood by users of the package.
Generally any changes that don't affect consumers of the package (e.g. lockfile changes or development environment changes) are omitted. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
Try to explain each change in terms that users of the package would understand (e.g. avoid referencing internal variables/concepts).
Consolidate related changes into one change entry if it makes it easier to explain.
Run yarn auto-changelog validate --rc to check that the changelog is correctly formatted.
Review and QA the release.
If changes are made to the base branch, the release branch will need to be updated with these changes and review/QA will need to restart again. As such, it's probably best to avoid merging other PRs into the base branch while review is underway.
Squash & Merge the release.
This should trigger the action-publish-release workflow to tag the final release commit and publish the release on GitHub.
Publish the release on npm.
Wait for the publish-release GitHub Action workflow to finish. This should trigger a second job (publish-npm), which will wait for a run approval by the npm publishers team.
Approve the publish-npm job (or ask somebody on the npm publishers team to approve it for you).
Once the publish-npm job has finished, check npm to verify that it has been published.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/MetaMask/contract-metadata là nguồn chính thức.
MetaMask/contract-metadata có bao nhiêu sao?
MetaMask/contract-metadata có 583 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/MetaMask/contract-metadata. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
MetaMask/contract-metadata có phải mã nguồn mở không?
Có — MetaMask/contract-metadata phát hành theo license ISC, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/MetaMask/contract-metadata.
MetaMask/contract-metadata còn đang phát triển không?
Commit gần nhất trên MetaMask/contract-metadata là 12 ngày trước (theo timestamp GitHub). Repo có 1.5k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
MetaMask/contract-metadata là gì?
MetaMask/contract-metadata (MetaMask/contract-metadata) là dự án JavaScript trên GitHub. Theo mô tả gốc: A mapping of ethereum contract addresses to broadly accepted icons for those addresses.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về contract-metadata?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về contract-metadata.