Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

makerdao/MakerDAO-SourceCred-bot

Repository files navigation

MakerDAO SourceCred bot

Discord bot to automate SourceCred instance interactions

Available commands

Public commands

  • /info: information about available SourceCred commands
  • /fetch-cred [user]: fetches cred and grain information for specified Discourse username
  • /opt-in [discourse] [address]: allows users to opt in for SC distributions. Checks Discourse account ownership and pushes username and wallet address to Notion to be eventually synced to the SC instance
    • discourse: discourse username
    • address: wallet address
  • /opt-out [discourse]: allows users to opt out of SC distributions. Checks Discourse account ownership and pushes [discourse] username to Notion to be eventually deactivated on the SC instance
    • discourse: discourse username

Admin only commands

  • /admin-info: information about available SourceCred admin commands
  • /payments-csv [threshold]: generates SC payments CSV file filtering by users who have accumulated an amount greater than or equal to the threshold passed (generated CSV file is compatible with Gnosis Safe CSV Airdrop app)
  • /onboard-users: fetches user list from Notion, creates a new branch on GitHub repo, adds wallet addresses into users SC identities and activates user accounts in the SC instance. Returns the name of the new GitHub branch created
  • /burn-grain [branch-name]: transfers grain from SC instance users accounts to the burn grain account
    • branch-name: name of the GitHub branch created on the /onboard-users command

How to set up

  1. Copy the contents of the .env.sample file into a new .env file, changing the values to your own.
    • BOT_TOKEN: Discord bot token, check this guide to know how to create a Discord Bot and obtain a token
    • CLIENT_ID: Discord Bot ID
    • SOURCECRED_INSTANCE: Path to your SourceCred instance (e.g. sourcecred/makerdao-cred/gh-pages)
    • PINATA_AUTHORIZATION_TOKEN: Pinata API key in the form of a Bearer token. This application uses Pinata as the IPFS pinning service. Check Pinata docs for information on how to get the API key
    • SOURCECRED_ADMINS: Discord ID list of users with admin permissions to the SC instance in the formats '123456789' or '123456789, 987654321, 456789123, ...'
    • GITHUB_API_TOKEN: GitHub personal access token needed to create branches and copy the ledger from one branch to another in the SC instance's GitHub repo. Check GitHub docs for information on how to create one
    • GH_NAME: Name for GitHub commits
    • GH_EMAIL: Email for GitHub commits
  2. Change the variables in src/constants/index.ts to those that apply for you.
    • TOKEN_CONTRACT: Address of the token used for SourceCred grain payments
    • DAI_REDEMPTIONS_ACCOUNT_ID: ID of the SourceCred instance account set up to receive grain transfers
  3. Deploy the bot and invite it to your Discord server.

About

A Discord bot to handle SourceCred interactions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published