简体   繁体   中英

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. 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.

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
        },
    },
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM