Fix config drift 244#282
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Config Drift (Closes #244)
Successfully implemented a centralized configuration system with 30 professional commits on branch fix-config-drift-244.
Implementation Summary
Problem Solved:
Contract configuration was scattered across multiple files with inconsistent values
config.ts
had wrong contract name (sprintfund-core instead of sprintfund-core-v3)
Scripts had hardcoded contract addresses and names
No validation to catch configuration drift
Solution Implemented:
Centralized Configuration (contract-config.json)
Single source of truth for all contract settings
Includes contract address, name, principal
Network configurations for mainnet/testnet
Legacy contract information
Configuration Loaders
JavaScript loader:
contract-config.js
TypeScript loader:
contract-config.ts
Helper functions for accessing config values
Validation and error handling
Updated All Files
Fixed
config.ts
contract name
Updated
config.ts
to use centralized config
Updated all scripts: create-proposal, stake, call-logger, withdraw-legacy
Updated shell script: create-test-proposal.sh
Updated .env.example to include contract name
Validation & Automation
validate-config.js
update-config.js
GitHub Actions workflow for CI/CD validation
Unit tests for config loader functions
Documentation
CONFIGURATION.md - Comprehensive configuration guide
MIGRATION_CONFIG.md - Migration guide for developers
CHANGELOG_CONFIG.md - Change log for config system
.contract-config.md - Config file documentation
Updated CONTRACT_VERSIONS.md with new approach