A Discord bot written in Python that verifies whether a user holds a specific ERC-1155 NFT on the Monad Testnet and automatically assigns them a role in the server if eligible.
- Verifies wallet ownership by checking a self-transaction.
- Confirms ERC-1155 NFT balance.
- Automatically assigns a Discord role (e.g.,
early-holder) to verified users. - Secure and private interaction using ephemeral messages.
- Built-in time limit for verification to prevent abuse.
Install dependencies with:
pip install -r requirements.txtRequired Python packages include:
discord.py==2.3.2web3==6.11.1python-dotenv==1.0.1requests==2.31.0aiohttp==3.9.3
Create a .env file or copy from .env.example:
cp .env.example .envSet the following environment variables:
TOKEN_DISCORD=your_discord_bot_token
MONAD_RPC=https://testnet-rpc.monad.xyz
NFT_CONTRACT=0x... # Address of the ERC-1155 contract
TOKEN_ID=0 # Token ID of the NFT to check
ROLE_NAME=early-holder # Role to assign upon successful verification- A user clicks Link Wallet and submits their wallet address.
- They are asked to send a small amount of MON to themselves to verify ownership.
- They submit the transaction hash.
- If valid, the bot checks for NFT balance.
- If the user owns the NFT, they receive the specified role.
Run the bot with:
python checker.pyIn Discord, use the command:
!panel
This will post a verification panel with interactive buttons.
- Wallet addresses and transaction hashes are only temporarily stored during the verification window.
- All user messages are sent as ephemeral, visible only to the user.
MIT License. Feel free to use and modify this bot for your community.