solana-labs / token-list

The community maintained Solana token registry
Apache License 2.0
1.46k stars 12.94k forks source link

Automate token listing with a GitHub bot #852

Open secretshardul opened 2 years ago

secretshardul commented 2 years ago

Current way of manual approvals is a bottleneck, but PR reviews are necessary to ensure that others' data is not tampered with. A GitHub bot can automate this in a secure way:

  1. Use Google Forms to accept token listing data
  2. A webhook call is made to the GitHub bot when form is submitted. The bot has write permission to the repo. It writes adds a formatted object into solana.tokenlist.json. Since write format is fixed and the bot keys are hidden on a server, there's no scope of tampering.
    {
      "chainId": 101,
      "address": "CJR5HtmXzpCD8Ro28zyZyLjz1wtrCsu7bEwC4f8ZjRCD",
      "symbol": "GEKZ",
      "name": "Gekz Arena",
      "decimals": 9,
      "logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/CJR5HtmXzpCD8Ro28zyZyLjz1wtrCsu7bEwC4f8ZjRCD/logo.png",
      "tags": [],
      "extensions": {
        "website": "https://www.gekzarena.com/",
        "twitter": "https://twitter.com/gekzarena",
        "discord": "https://discord.gg/Mh29ZdQCGC"
      }
stevenpollack commented 2 years ago

+1

CEO-NextMindCoin commented 2 years ago

Cool idea

FUMoney801 commented 2 years ago

Solana is all about speed,,,,, Automation leads to innovation, come on solana i want you to kill ETH faster!

exogenesys commented 2 years ago

Hey, everyone!

As a coding challenge, I got the opportunity to try my hands at this issue!

Functionality is exactly same as @secretshardul proposed.

How it works

Relevant LInks

If you want to check it out (and give much appreciated feedback 💙 ) please go to the following links:

Currently If you go and fill the form and submit it, the bot will take 1-2 minute as the bot is hosted on a free tier on Heroku, and then add a new token to exogenesys/token-list (but not solana-labs/token-list, yet)

Here is one of the recent commit by the bot to add a token.

Problems yet to be tackled

FUMoney801 commented 2 years ago

Hey exogenesys, cool stuff thank you.. Just submitted with that bot / form method you have detailed above. Hopefully it works out for me.

exogenesys commented 2 years ago

Hey @SolGuy801, Two people have tried the bot since I posted – NCOIN and FUMoney. NCOIN was succesfully added, see commit by bot.

FUMoney failed, as the tags weren't wrapped by square brackets and extensions weren't wrapped by curly brackets. I took the liberty to try again with only this difference:

And this time, it did work! See bot commit here.

I have updated the form to say that –– curly brackers in the extensions field and square brackets in the tags field are important. If you think I should do anything differently, please let me know. Thanks a lot for testing the system out! :D

Thanks!

FUMoney801 commented 2 years ago

Cool, between you and solminter seems like this entire token process can be automated. Thank you! Question On each commit Error: Process completed with exit code 1. run yarn test it says fail on each of the tokens FUM and NCOIN. Are we now just waiting up to 2 weeks for approval or anything else need to be completed.

exogenesys commented 2 years ago

It fails because the bot has allowed duplicate entries -- so a few entries, in there, are duplicates.

Rejecting duplicate entries should be easy for the bot. I wanted to know if you think that's something the bot should handle, and then, I can add that feature.

@SolGuy801 @secretshardul

exogenesys commented 2 years ago

Somebody else tested the bot by adding a token $PNT, here is the commit by the bot. Sharing since it can take a few minutes to reflect!

Cl3v4 commented 2 years ago

Somebody else tested the bot by adding a token $PNT, here is the commit by the bot. Sharing since it can take a few minutes to reflect!

Any way you could help me add my coin

shikokusolanatoken commented 2 years ago

very helpful i hope my problem is solved

exogenesys commented 2 years ago

Hey @Cl3v4 @shikokusolanatoken This bot is not yet connected to the solana-labs/token-list repo -- so it won't help you