Search code examples
ethereumpolygoncryptocurrencyerc20etherscan

How to add a logo to an ERC20 token?


I am new to blockchain. I really couldn't understand how to add logo to my erc20 crypto token on polygon before listing it on any coin market.

I want to add my own custom image to the circular portion

I want to add my own custom image to the circular portion. How can I change this current logo to something new and If I transfer the token to some other account, my custom logo will be displayed? Please help.


Solution

  • MetaMask implements the EIP-747 standard (currently unfinished in May 2022) and its wallet_watchAsset method to display custom token logo.

    Mind that this is not a centralized database of logos per token address, so each MetaMask instance can theoretically display a different logo for the same token. And that users need to explicitly add the logo either manually or by confirming a MetaMask popup opened by a snippet from your web app.

    Code example from MetaMask docs:

    const wasAdded = await ethereum.request({
        method: 'wallet_watchAsset',
        params: {
            type: 'ERC20', // Initially only supports ERC20, but eventually more!
            options: {
                address: tokenAddress, // The address that the token is at.
                symbol: tokenSymbol, // A ticker symbol or shorthand, up to 5 chars.
                decimals: tokenDecimals, // The number of decimals in the token
                image: tokenImage, // A string url of the token logo
            },
        },
    });