src/main-rbf.ts) is now the PRIMARY/PRODUCTION bot. The Original Bot (src/index.ts) is LEGACY/DEPRECATED.
# 1. Check .env file exists and has required values
# 2. Verify all required variables are set
# 3. Check contract address format
# 4. Verify RBF bot configuration (BASE_MULTIPLIER=200.0, RBF_* variables)npm run start:rbf:dry # RBF bot (PRODUCTION)# Run without dry-run to test actual blockchain calls
npm run start:rbf # RBF bot (PRODUCTION)
# (Stop with Ctrl+C after approvals are set)# Run and wait for actual window to open
npm run start:rbf # RBF bot (PRODUCTION)npm run start:rbf:dry # RBF bot (PRODUCTION) # LEGACY - Original bot (not recommended)
npm start # LEGACY - Original bot (not recommended)Purpose: Verify all config is correct before running
Steps:
- Copy
.env.exampleto.env - Fill in required values:
PRIVATE_KEY- Your hot wallet private keySACRIFICE_ADDR- Contract address (validated automatically)TEDDY_ID- Your Steady Teddy token IDMIBERA_ID- Your Mibera token ID
- Set optional values:
UNLOCK_TIME_UNIT-seconds(default) ormilliseconds
Expected Result:
- β Bot starts without errors
- β Shows wallet address
- β Shows RPC count
- β Shows token IDs
- β Network verified (Chain ID 80094)
If Errors:
- β "Missing required environment variable" β Check
.envfile - β "SACRIFICE_ADDR must be a valid Ethereum address" β Fix address format
- β "Chain ID mismatch" β Check RPC endpoints
Purpose: Test bot logic without sending transactions
Command:
npm run start:rbf:dry # RBF bot (PRODUCTION)What to Verify:
- β Bot initializes successfully
- β Network verification passes
- β Ownership check runs (should pass if you own NFTs)
- β Approval check runs (may set approval if needed)
- β Bot enters polling loop
- β View function checks work
- β Logs show unlock time (if available)
- β Dynamic polling activates when close to unlock
- β NO transactions sent (dry-run mode)
Expected Output:
βΉ Initializing MiTeddy snipe bot...
βΉ Chain: Berachain (ID: 80094)
βΉ Wallet: 0x...
βΉ RPCs: 3 configured
β Network verified: Chain ID 80094
βΉ Verifying NFT ownership...
β Ownership verified - Steady Teddy #1234
β Ownership verified - Mibera #5678
βΉ Waiting for sacrifice window to open...
βΉ Polling every 250ms
βΉ Still waiting... (20 checks, unlock in ~45.2s)
Stop Test: Press Ctrl+C when satisfied
Purpose: Verify bot correctly checks NFT ownership
Setup:
- Use a wallet that owns both NFTs
- Or use a wallet that doesn't own one (to test error handling)
Expected Behavior:
- β If owns both: Continues to approval check
- β If missing one: Shows clear error and exits
Error Example:
β You do not own Steady Teddy #1234. Owner: 0x...
Purpose: Verify bot sets approvals correctly
Setup:
- Use wallet with NFTs but no approvals set
Expected Behavior:
- β Checks if approval needed
- β
Sends
setApprovalForAlltransaction - β Waits for confirmation
- β Continues to polling
In Dry-Run:
β οΈ Shows "DRY RUN: Would set approval"- β Doesn't actually send transaction
Purpose: Verify caching works correctly
What to Look For:
- First call: Makes RPC call (slower)
- Subsequent calls in same block: Uses cache (faster, no RPC call)
- New block: Cache invalidates, fresh call
How to Verify:
- Watch logs for RPC activity
- Same block = no new RPC calls
- New block = new RPC call
Purpose: Verify all RPCs receive transaction simultaneously
Setup:
- Configure multiple RPCs in
.env - Run in dry-run mode first
Expected Behavior:
- β All RPCs receive transaction in parallel
- β Logs show "Broadcast successful to RPC 1 (primary)", "RPC 2", etc.
- β Faster than sequential broadcasting
In Dry-Run:
β οΈ Shows "DRY RUN: Would send transaction"- β Doesn't actually broadcast
Purpose: Verify unlockTime unit conversion works
Test Cases:
# .env
UNLOCK_TIME_UNIT=seconds # or omit (default)Expected:
- β Pre-warming triggers at 2 seconds (not 2000 seconds)
- β Fast polling at < 1 second
- β Logs show "Window opening in 2s" (not "2000ms")
# .env
UNLOCK_TIME_UNIT=millisecondsExpected:
- β Pre-warming triggers at 2000ms (2 seconds)
- β Fast polling at < 1000ms
- β Logs show "Window opening in 2000ms"
How to Verify:
- Check contract ABI/docs for
remainingUnlockTime()return type - Set
UNLOCK_TIME_UNITaccordingly - Watch logs when close to unlock
- Verify timing matches expected behavior
Purpose: Verify polling speed adjusts based on unlock time
Expected Behavior:
- Normal (> 5 seconds): Polls every
SIMULATE_MS(default 250ms) - Close (< 5 seconds): Polls every 50ms
- Very Close (< 1 second): Polls every 10ms
How to Verify:
- Watch log timestamps
- Should see faster polling as unlock time approaches
- Logs should show "fast polling" or "increased polling"
Purpose: Verify transaction pre-warming works
Setup:
- Set
PRE_WARM_TX=truein.env - Wait for unlock time < 2 seconds
Expected Behavior:
- β Pre-warming triggers when < 2 seconds to unlock
- β Only happens once (not repeatedly)
- β Uses fresh nonce
- β Pre-broadcasts to mempool
- β Logs "Transaction pre-warmed to [private/public] mempool"
In Dry-Run:
β οΈ Pre-warming skipped (dry-run mode)
Purpose: Verify RPC health monitoring works
Setup:
- Set
RPC_HEALTH_CHECK=truein.env - Configure multiple RPCs
Expected Behavior:
- β Health check runs on startup
- β RPCs sorted by latency
- β Periodic health checks (every 100 attempts)
- β Health checks skipped when < 10 seconds to unlock
- β Logs show "RPCs sorted by latency: ..."
Purpose: Verify gas bumping works (requires actual transaction)
Setup:
- Run without dry-run
- Use low gas price to force bumping
Expected Behavior:
- β Sends transaction with initial gas
- β
If not included, bumps gas after
BUMP_INTERVAL_MS - β Re-broadcasts with higher gas
- β
Continues up to
MAX_BUMPS - β Logs show gas increases
Note: This test requires actual BERA for gas fees
Purpose: Verify bot handles errors gracefully
Test Cases:
- Temporarily break one RPC URL
- β Bot should continue with other RPCs
- β Logs should show warnings
- Disconnect internet briefly
- β Bot should retry
- β Logs should show errors
- Set invalid
SACRIFICE_ADDR - β Should error clearly on startup
- β Should not crash silently
# 1. Set up .env with your values
# 2. Run dry-run
npm run start:rbf:dry # RBF bot (PRODUCTION)
# 3. Verify:
# - Bot starts
# - Shows wallet
# - Enters polling loop
# - No errors# 1. Set up .env
# 2. Run without dry-run
npm start
# 3. Verify:
# - Ownership check passes
# - Approvals set (if needed)
# - Polling works
# - View functions work
# - No crashes
# 4. Stop with Ctrl+C- Bot starts without errors
- Network verification passes
- Ownership verified
- Polling loop runs smoothly
- View function checks work
- Logs show unlock time
- Dynamic polling activates
- No crashes or hangs
- Errors in logs (check messages)
- Bot hangs (check RPC connectivity)
- Wrong unlock time (check
UNLOCK_TIME_UNIT) - Memory usage growing (check cache limits)
- Transactions not sending (check dry-run mode)
- Bot crashes on startup β Check config
- "Chain ID mismatch" β Check RPC endpoints
- "You do not own..." β Check token IDs
- "Invalid address" β Check
SACRIFICE_ADDRformat
- Configuration validated
- Dry-run test passed
- Ownership verified
- Approvals set (if needed)
- UnlockTime unit verified (seconds vs milliseconds)
- View function caching works
- Parallel broadcasting works
- Dynamic polling activates
- Pre-warming works (if enabled)
- RPC health check works
- Error handling verified
- Memory usage stable
- No crashes in extended run
- Check
.envfile exists and has all required variables - Check
PRIVATE_KEYformat (0x + 64 hex chars) - Check
SACRIFICE_ADDRformat (valid Ethereum address) - Check RPC URLs are accessible
- Verify contract's
remainingUnlockTime()return type - Set
UNLOCK_TIME_UNITaccordingly - Check logs for unlock time display
- Check RPC URLs are correct
- Check network connectivity
- Try different RPC providers
- Check rate limits
- Check cache size limits (should be 1000 max)
- Monitor memory usage over time
- Restart bot periodically if needed
- Dry-Run (5 min) - Verify basic functionality
- Ownership Test (2 min) - Verify NFT ownership check
- Approval Test (5 min) - Verify approval setting
- Extended Dry-Run (30 min) - Verify polling and caching
- Full Test (Wait for window) - Verify complete flow
Ready to test! Start with dry-run mode for safest testing. π