Skip to content

Fix config drift 244#282

Merged
Mosas2000 merged 10 commits into
mainfrom
fix-config-drift-244
Apr 28, 2026
Merged

Fix config drift 244#282
Mosas2000 merged 10 commits into
mainfrom
fix-config-drift-244

Conversation

@Mosas2000

Copy link
Copy Markdown
Owner

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

  • Checks config consistency
    update-config.js
  • Helper to update config files
    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

@Mosas2000 Mosas2000 merged commit 74f718a into main Apr 28, 2026
6 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Root and frontend config files can drift out of sync

1 participant