Avoid hardcoding configuration values directly in code. Instead, make parameters configurable through CLI arguments, config files, environment variables, or runtime queries, while providing sensible defaults.
Hardcoded values reduce flexibility, make testing difficult, and require code changes for different environments. Configuration should be externalized to support different deployment contexts and operational requirements.
Examples of good practices:
faucet --batch-size 6000
instead of let batch_size = 6000;
voyager_client.client_info()
instead of hardcoded client typesDEFAULT_DECIMALS = 6
for cosmos tokens, but allow override when needed#[serde(default = "default_delay_blocks")]
This approach improves maintainability, testability, and deployment flexibility while ensuring the system can adapt to different operational requirements without code modifications.
Enter the URL of a public GitHub repository