Summary
The contract address (SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T) and contract name (sprintfund-core) are hardcoded as string constants in at least five separate files: page.tsx, CreateProposalForm.tsx, ProposalList.tsx, UserDashboard.tsx, Stats.tsx, and ExecuteProposal.tsx.
Problem
If the contract is redeployed or the network changes, every file needs manual updates. There is already a discrepancy where scripts reference sprintfund-core-v3 while the frontend uses sprintfund-core.
Recommended Fix
Create a central configuration file:
// config/contract.ts
export const CONTRACT_CONFIG = {
address: process.env.NEXT_PUBLIC_CONTRACT_ADDRESS || 'SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T',
name: process.env.NEXT_PUBLIC_CONTRACT_NAME || 'sprintfund-core',
};
Import from this single source in all components.
Impact
Medium - Maintenance burden and risk of inconsistency across the codebase.
Summary
The contract address (SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5T) and contract name (sprintfund-core) are hardcoded as string constants in at least five separate files: page.tsx, CreateProposalForm.tsx, ProposalList.tsx, UserDashboard.tsx, Stats.tsx, and ExecuteProposal.tsx.
Problem
If the contract is redeployed or the network changes, every file needs manual updates. There is already a discrepancy where scripts reference sprintfund-core-v3 while the frontend uses sprintfund-core.
Recommended Fix
Create a central configuration file:
Import from this single source in all components.
Impact
Medium - Maintenance burden and risk of inconsistency across the codebase.