A Discord bot that monitors new token deployments on Base through both Clanker and Larry contracts, sending notifications to specified Discord channels with role tagging.
- π Monitors new token deployments in real-time through:
- Clanker Factory
- Larry Factory
- Clank.fun deployments
- π Provides detailed token information including:
- Token name and symbol
- Contract address with organized links:
- First line: Basescan, Dexscreener, GeckoTerminal
- Second line: Photon, Uniswap, Clank.fun
- Deployer address with blockchain explorer links
- Farcaster ID (FID) with profile link and follower count (for Farcaster deployments)
- Supply details
- LP NFT ID with Uniswap position link
- Launch cast link (for Farcaster deployments)
- Token images (configurable)
- π Larry Features:
- Monitors new crowdfund/party creations
- Tracks contributions in real-time*
- Updates original messages with contribution info*
- Shows progress and deadlines
Note: * Contribution tracking and progress updates are currently under development and may not be fully functional.
- π·οΈ Role pinging system:
- Clank.fun deployment notifications
- Low FID notifications (configurable threshold)
- High follower count notifications
- Multiple threshold levels for fine-grained alerts
- πΎ Persistent Storage:
- Redis-based message tracking
- Thread ID persistence
- Contribution history
- Duplicate transaction prevention
- π Reliability Features:
- Automatic WebSocket reconnection with exponential backoff
- Resilient error handling and logging
- Graceful shutdown handling
- Service health monitoring (checks every minute, logs every 15 minutes)
- π§ Smart Filtering:
- Distinguishes between Farcaster and Clank.fun deployments
- Avoids notifications for Clankers deployed by 0-follower accounts
- Configurable thresholds for notifications
- π¨ Visual Indicators:
- Orange embeds for Clank.fun deployments
- Green embeds for low FID deployments
- Purple embeds for high follower deployments
- Blue embeds for standard deployments
- Node.js v18 or higher
- npm or yarn
- Redis (local development)
- Discord bot token
- Discord channel ID
- Alchemy API key for Base network
clank/
βββ src/
β βββ config/
β β βββ index.js
β β βββ settings.js
β βββ contracts/
β β βββ abis/
β β β βββ clanker/
β β β β βββ Factory.json
β β β βββ larry/
β β β β βββ CrowdfundFactoryImpl.json
β β β β βββ ERC20CreatorV3Impl.json
β β β β βββ ERC20LaunchCrowdfundImpl.json
β β β β βββ PartyFactory.json
β β β β βββ PartyImpl.json
β β β βββ token/
β β β β βββ Token.json
β β β βββ uniswap/
β β β βββ Factory.json
β β βββ helpers/
β β β βββ ClankerContractHelper.js
β β β βββ LarryContractHelper.js
β β βββ addresses.json
β β βββ utils.js
β βββ handlers/
β β βββ clankerTokenHandler.js
β β βββ errorHandler.js
β β βββ larryContributedHandler.js
β β βββ larryPartyCreatedHandler.js
β β βββ larryPresaleEventHandler.js
β β βββ larryTokenHandler.js
β βββ services/
β β βββ warpcastResolver.js
β βββ utils/
β β βββ discordMessenger.js
β β βββ larryCrowdfundStore.js
β β βββ logger.js
β βββ bot.js
βββ .env
βββ .env.example
βββ .gitignore
βββ package-lock.json
βββ package.json
βββ README.md
The bot's configuration is split into multiple files:
src/config/settings.js
: Core application settings including:- FID Thresholds for role notifications
- Follower Thresholds for role notifications
- Features toggles (e.g.,
displayImages
) - Larry configuration options
src/contracts/addresses.json
: Contract addresses for:- Clanker Factory
- Larry Factory
- Larry Crowdfund Implementation
- Uniswap V3 Factory
- Redis for persistent storage:
- Discord message IDs
- Thread IDs
- Contribution tracking
- Transaction history
- Message update history
src/utils/discordMessenger.js
: Discord message formatting for:- Clanker token deployments
- Larry Crowdfund/Party creations
- Contribution updates
- Embedded message layouts
The bot requires several environment variables to be set:
ALCHEMY_API_KEY
: Alchemy API key for Base networkDISCORD_TOKEN
: Your Discord bot tokenDISCORD_CLANKER_CHANNEL_ID
: Channel ID for Clanker notificationsDISCORD_LARRY_CHANNEL_ID
: Channel ID for Larry notificationsREDIS_URL
: Redis connection URL (defaults to localhost for development)
FID_BELOW_1000_ROLE
: Role ID for FIDs under 1,000FID_BELOW_5000_ROLE
: Role ID for FIDs under 5,000FID_BELOW_10000_ROLE
: Role ID for FIDs under 10,000
FOLLOWERS_OVER_5000_ROLE
: Role ID for accounts with 5,000+ followersFOLLOWERS_OVER_10000_ROLE
: Role ID for accounts with 10,000+ followersFOLLOWERS_OVER_20000_ROLE
: Role ID for accounts with 20,000+ followersFOLLOWERS_OVER_50000_ROLE
: Role ID for accounts with 50,000+ followersFOLLOWERS_OVER_100000_ROLE
: Role ID for accounts with 100,000+ followersFOLLOWERS_OVER_200000_ROLE
: Role ID for accounts with 200,000+ followers
CLANKFUN_DEPLOYER_ROLE
: Role ID for clank.fun deployments π€
Copy .env.example
to .env
and fill in your values.
- Clone the repository:
git clone https://github.com/benbodhi/clank.git
cd clank
- Install dependencies:
npm install
- Install Redis (for local development):
# Mac
brew install redis
brew services start redis
# Linux
sudo apt-get install redis-server
sudo systemctl start redis
-
Set up your environment variables in
.env
-
Start the bot:
npm start
The bot includes comprehensive error handling:
- Automatic WebSocket reconnection
- Redis connection retry logic
- Graceful shutdown on process termination
- Detailed error logging with timestamps
- Service health monitoring
The bot can be deployed on platforms like Railway:
-
Prepare Repository
- Push code to GitHub
- Ensure
.gitignore
includes sensitive files
-
Deploy on Railway
- Create new project from GitHub repo
- Add Redis service
- Link Redis URL to bot service
- Set remaining environment variables
- Deploy using
npm start
-
Create a New Discord Application
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section and click "Add Bot"
- Under "Privileged Gateway Intents", enable:
- Server Members Intent
- Message Content Intent
-
Get Your Bot Token
- In the "Bot" section, click "Reset Token" to reveal your bot token
- Copy this token - you'll need it for your
.env
file - Keep this token secret and never share it
-
Create Required Roles Create the following roles in your Discord server:
FID-based roles:
- Role for FIDs below 1,000
- Role for FIDs below 5,000
- Role for FIDs below 10,000
Follower-based roles:
- Role for 5,000+ followers
- Role for 10,000+ followers
- Role for 20,000+ followers
- Role for 50,000+ followers
- Role for 100,000+ followers
- Role for 200,000+ followers
-
Get Role IDs
- Enable Developer Mode in Discord (User Settings > App Settings > Advanced > Developer Mode)
- Right-click each role and click "Copy ID"
- Add these IDs to your
.env
file with their corresponding variable names
-
Invite Bot to Server
- Go to OAuth2 > URL Generator
- Select the following scopes:
bot
applications.commands
- Select the following bot permissions:
Read Messages/View Channels
Read Message History
Send Messages
Embed Links
Mention Everyone
(for role pings)
- Copy the generated URL and open it in a browser
- Select your server and authorize the bot
-
Configure Channel
- Create or select a channel for notifications
- Right-click the channel and copy the ID
- Add this ID to your environment variables
-
Bot Permissions Ensure the bot has the following permissions in the notification channel:
- View Channel
- Send Messages
- Embed Links
- Mention Roles
-
Role Hierarchy
- Ensure the bot's role is higher than all notification roles in the server settings
- This allows the bot to mention these roles in messages
-
Add MEE6 to Your Server
- Visit MEE6's website
- Select your server and authorize the bot
- Grant necessary permissions
-
Configure Reaction Roles
- Go to your server's MEE6 dashboard
- Navigate to "Reaction Roles" feature
- Click "Create Reaction Role"
- Set up the following:
- Create a new message or use existing
- Add your Low FID Alert role
- Choose an emoji (e.g., π)
- Save configuration
-
Example Message Format
π¨ **Get Notified About Low FID Token Launches** π¨
Use the button below to get the role to receive notifications when tokens are launched by users with low Farcaster IDs (FIDs).
Now users can simply react to get the roles and be notified about token launches by casters who meet the desired thresholds!
The bot automatically tags all relevant roles for each new token. This means:
For FID Thresholds:
- If a token has FID 800, it will notify:
- Below 1,000 role π₯ (because 800 < 1,000)
- Below 5,000 role π (because 800 < 5,000)
- Below 10,000 role π (because 800 < 10,000)
For Follower Thresholds:
- If a creator has 120k followers, it will notify:
- Over 100,000 role π (because 120k > 100k)
- Over 50,000 role π« (because 120k > 50k)
- Over 20,000 role β (because 120k > 20k)
- Over 10,000 role β¨ (because 120k > 10k)
- Over 5,000 role π (because 120k > 5k)
For Platform Deployments:
- If a token is deployed through clank.fun:
- Clank.fun deployer role π€
- FID and follower notifications are not triggered
- Displays orange embed color
FID Thresholds:
- Below 1,000 π₯
- Below 5,000 π
- Below 10,000 π
Follower Thresholds:
- Over 5,000 π
- Over 10,000 β¨
- Over 20,000 β
- Over 50,000 π«
- Over 100,000 π
- Over 200,000 π
Platform:
- Clank.fun Deployer π€
-
For FID notifications:
- Select roles for the FID ranges you want to monitor
- You'll get notifications for all FIDs BELOW your selected numbers
- Example: "Below 5k" role will notify you about FIDs 1-4,999
-
For follower notifications:
- Select roles for the follower counts you want to monitor
- You'll get notifications for all accounts ABOVE your selected numbers
- Example: "Over 20k" role will notify you about accounts with 20k+ followers
-
For platform notifications:
- Select the clank.fun role to get notifications for all tokens deployed through clank.fun
- These notifications are independent of FID/follower thresholds
-
Want multiple?
- Select any combination of roles
- You'll get notifications when ANY of your selected conditions are met
Contributions are welcome! Please feel free to submit a Pull Request.
I had issues integrating basename resolution because all examples I found in docs are react components. ENS resolution was easy, but seemed to unnecessarily slow down processing. If you can integrate these efficiently, I'd love to display them.
Larry contribution tracking and progress updates are currently not functioning as expected. If you can help with this, I'd love to get it working properly.
Benbodhi
MIT License - see the LICENSE file for details.
Built for the Base ecosystem
- We love Base
- We love Clanker & Larry
- We love Warpcast
- We love Discord
*We is just me btw
Powered By:
- Ethers.js v6 for blockchain interaction
- Discord.js for Discord integration
- Warpcast API for Farcaster data
- Winston for structured logging
- Alchemy for WebSocket provider
- Redis for persistent data storage
- MEE6 for role management integration
- Uniswap V3 for trading interface
- Photon for faster trading interface
- Dexscreener for market data links
- Basescan & Etherscan for blockchain explorer links