GithubHelp home page GithubHelp logo

isabella232 / contract-metadata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metamask/contract-metadata

0.0 0.0 0.0 6.61 MB

A mapping of ethereum contract addresses to broadly accepted icons for those addresses.

License: ISC License

JavaScript 100.00%

contract-metadata's Introduction

@metamask/contract-metadata

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.

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 imageElFor (address) {
  const metadata = contractMap[toChecksumAddress(address)]
  if (metadata?.logo) {
    const fileName = metadata.logo
    const path = `${__dirname}/images/contract/${fileName}`
    const img = document.createElement('img')
    img.src = path
    img.style.width = '100%'
    return img
  }
}

imageElFor ("0x06012c8cf97BEaD5deAe237070F9587f8E7A266d")

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.

  1. Fork this repository.
  2. Add your logo image in a web-safe format to the images folder.
  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.

Criteria:

  • The icon should be small, square, but high resolution, ideally a vector/svg.
  • 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.
  • 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.

A sample submission:

{
  "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef": {
    "name": "ENS Registrar",
    "logo": "ens.svg"
  }
}

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.

contract-metadata's People

Contributors

danfinlay avatar estebanmino avatar xrn avatar kumavis avatar flyswatter avatar rekmarks avatar daveappleton avatar cameronbedford avatar nukemandan avatar mintheredonethat avatar crowdstartcapital avatar lrgeoemtry avatar lukezhangstudio avatar rickycodes avatar joshfraser avatar markshw avatar jennypollack avatar jflatow avatar geogeo1 avatar frankiebee avatar canya-io avatar nhandler avatar epiqueras avatar ethereumdegen avatar rcai1 avatar msz89 avatar douglasb99 avatar brynbellomy avatar alexhidalgo avatar daytonmills avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.