Skip to content

A proof-of-ownership Discord bot for SNIP-721 tokens on the Secret Network. Verified owners are given specified roles.

Notifications You must be signed in to change notification settings

kevin-kidd/SNIP-721-Proof-of-Ownership-Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SNIP-721 Proof-of-Ownership Discord Bot

A proof-of-ownership Discord bot for SNIP-721 tokens on the Secret Network. Verified owners are given specified roles. In addition, there is a cron script included which will continuously check ownership of all the holders and remove users that no longer hold any tokens.

Requirements

  1. MongoDB (recommend Atlas)
  2. Discord bot token
  3. Discord Server ID
  4. Discord Role ID

Back-end Instructions

  • Edit the .env file in the backend directory.
  • Fill in the details for your Discord server ID, role ID and token at the top.
  • Fill in the contract address and code hash for your SNIP-721 contract.
  • Create a new wallet, fund it with some SCRT for gas and input the mnemonic inside the .env file.
  • Enter your Mongo DB details at the bottom of the file.

Next, we will generate a viewing key. Open your terminal, head to the backend directory and enter:

yarn run --set-viewing-key

This will output a viewing key, save this to the .env file.

Next, we will generate an encryption key that will be used for encrypting the secret address and discord ID's saved in the database.

yarn run --create-encryption-key

Copy the encryption key from the output and save it in the .env file.

Now, you are ready to start the bot! Note: The bot will run on port 4000, you can change this in bot.js if you need.

Start the bot:

node bot.js

To start the cron job:

node cron.js

Note: The cron job is set to run every 1 minute. The purpose of a short duration is for testing. You can increase the duration in cron.js when you put in production.

Front-end Instructions

  • Edit the config.js file in the frontend directory
  • Fill in the details for your SNIP-721 contract
  • Fill in the Secret address for the new wallet you created to use with the backend
  • Finally, you will need to include the URL for the backend API running on port 4000

Now you are ready to deploy the website! Save the config file, build and deploy to your web server.

About

A proof-of-ownership Discord bot for SNIP-721 tokens on the Secret Network. Verified owners are given specified roles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published