Overview
Base Audit Bot uses environment variables for configuration. All settings are loaded from a.env file and validated on startup.
Configuration File Setup
Required Environment Variables
Base Chain Configuration
BASE_RPC_URL
BASE_RPC_URL
Type: String (URL)
Default:
Required: YesThe RPC endpoint URL for Base mainnet. Must be a valid HTTP(S) URL.
Default:
https://mainnet.base.orgRequired: YesThe RPC endpoint URL for Base mainnet. Must be a valid HTTP(S) URL.
The bot validates that this value starts with
http or https on startup.BASESCAN_API_KEY
BASESCAN_API_KEY
Type: String
Required: YesYour Basescan API key for fetching verified contract source code.
Required: YesYour Basescan API key for fetching verified contract source code.
Anthropic API Configuration
ANTHROPIC_API_KEY
ANTHROPIC_API_KEY
Type: String
Required: YesYour Anthropic API key for Claude AI-powered contract auditing.
Required: YesYour Anthropic API key for Claude AI-powered contract auditing.
Twitter API Configuration
Twitter API v2 Credentials
Twitter API v2 Credentials
All Required: YesThe bot requires full Twitter API v2 credentials with OAuth 1.0a for posting tweets and reading DMs.
Create Twitter Developer Account
Go to https://developer.twitter.com/ and create an account.
Webhook Configuration
WEBHOOK_SECRET
WEBHOOK_SECRET
Type: String
Required: For webhook functionality
Default: Empty stringSecret key for verifying GitHub webhook signatures using HMAC-SHA256.
Required: For webhook functionality
Default: Empty stringSecret key for verifying GitHub webhook signatures using HMAC-SHA256.
WEBHOOK_PORT
WEBHOOK_PORT
Type: Integer
Default:
Required: NoPort number for the webhook server to listen on.
Default:
5000Required: NoPort number for the webhook server to listen on.
Optional Configuration
Bot Behavior Settings
SCAN_INTERVAL_MINUTES
SCAN_INTERVAL_MINUTES
Type: Integer
Default:
Minimum:
Default:
15Minimum:
1How frequently (in minutes) the bot scans for new contract deployments.The bot validates this is at least 1 on startup.
BLOCKS_TO_SCAN
BLOCKS_TO_SCAN
Type: Integer
Default:
Minimum:
Default:
100Minimum:
1Number of recent blocks to scan for new contract deployments each interval.MIN_CONTRACT_SIZE
MIN_CONTRACT_SIZE
Type: Integer
Default:
Default:
100Minimum contract bytecode size (in bytes) to audit. Filters out very small contracts.LOG_LEVEL
LOG_LEVEL
Type: String
Default:
Options:
Default:
INFOOptions:
DEBUG, INFO, WARNING, ERROR, CRITICALLogging verbosity level.Storage Configuration
DATABASE_PATH
DATABASE_PATH
Type: File Path
Default:
Default:
./data/bot.dbPath to SQLite database file for persistent storage.The directory will be created automatically if it doesn’t exist.
TEMP_DIR
TEMP_DIR
Type: Directory Path
Default:
Default:
./temp_reposDirectory for temporarily cloning GitHub repositories during audits.Configuration Validation
The bot performs automatic validation on startup through theConfig.validate() method in config.py:92:
- BASE_RPC_URL: Must start with
httporhttps - SCAN_INTERVAL_MINUTES: Must be at least 1
- BLOCKS_TO_SCAN: Must be at least 1
- Required fields: All required environment variables must be present
Example Configuration
Here’s a complete example.env file:
Loading Configuration
The configuration is loaded automatically from the.env file using the Config.from_env() method in config.py:44: