Skip to content

Made stablecoin and reservecoin names and symbols configurable#47

Open
DeveloperAmrit wants to merge 1 commit into
DjedAlliance:mainfrom
DeveloperAmrit:fix-18-symbols
Open

Made stablecoin and reservecoin names and symbols configurable#47
DeveloperAmrit wants to merge 1 commit into
DjedAlliance:mainfrom
DeveloperAmrit:fix-18-symbols

Conversation

@DeveloperAmrit
Copy link
Copy Markdown
Member

@DeveloperAmrit DeveloperAmrit commented Feb 4, 2026

Fixes #18

Description
This PR makes the names and symbols for the stablecoin (SC) and reservecoin (RC) configurable during deployment. Previously, these values were hardcoded within the Djed and DjedShu contracts.

Key Changes

  1. Contracts:
    • Updated Djed and DjedShu constructors to accept nameSC, symbolSC, nameRC, and symbolRC.
    • Removed hardcoded "StableCoin", "SC", "ReserveCoin", and "RC" strings.
  2. Deployment Scripts:
    • Updated DeploymentParameters.sol to include configurable coin metadata.
    • Modified deployDjedContract.s.sol and deployDjedShuContract.sol to pass these parameters during deployment.
  3. Test Suite:
    • Updated Djed.t.sol, Fee.t.sol, and TransactionLimit.t.sol to match the new constructor signatures.
    • Centralized test coin constants in Utilities.sol.
  4. Tooling & Optimization:
    • Enabled via_ir and the optimizer in foundry.toml to support the increased constructor parameters and optimize contract size.
    • Added foundry.lock for consistent dependency management.

Summary by CodeRabbit

Release Notes

  • New Features

    • Djed and DjedShu contract constructors now accept custom names and symbols for stablecoin and reservecoin, enabling flexible token identification.
  • Chores

    • Enhanced compiler configuration with IR generation enabled and optimizer set to 200 runs for improved performance.

	modified:   scripts/DeploymentParameters.sol
	modified:   scripts/deployDjedContract.s.sol
	modified:   scripts/deployDjedShuContract.sol
	modified:   src/Djed.sol
	modified:   src/DjedShu.sol
	modified:   src/test/Djed.t.sol
	modified:   src/test/Fee.t.sol
	modified:   src/test/TransactionLimit.t.sol
	modified:   src/test/Utilities.sol
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The changes make stablecoin and reserve coin names/symbols configurable throughout the system by introducing four new string parameters (nameSC, symbolSC, nameRC, symbolRC) into constructors, deployment scripts, and configuration files, replacing hardcoded values with parameterized alternatives.

Changes

Cohort / File(s) Summary
Compiler & Deployment Configuration
foundry.toml, scripts/DeploymentParameters.sol
Added optimizer configuration (via_ir, optimizer, optimizer_runs) to foundry.toml. Added four string constants (NAME_SC, SYMBOL_SC, NAME_RC, SYMBOL_RC) and updated getConfigFromNetwork return signature to include these four values at the beginning of the return tuple.
Deployment Scripts
scripts/deployDjedContract.s.sol, scripts/deployDjedShuContract.sol
Extracted four new local string variables (nameSC, symbolSC, nameRC, symbolRC) from network config and passed them as the first four arguments to both Djed and DjedShu constructor calls.
Contract Implementation
src/Djed.sol, src/DjedShu.sol
Updated constructors to accept four new string memory parameters (nameSC, symbolSC, nameRC, symbolRC) and use them when instantiating Coin contracts instead of hardcoded string literals.
Test Suite
src/test/Djed.t.sol, src/test/Fee.t.sol, src/test/TransactionLimit.t.sol, src/test/Utilities.sol
Updated all test files to pass the four new string parameters to Djed constructor calls. Added four string constants (NAME_SC, SYMBOL_SC, NAME_RC, SYMBOL_RC) to Utilities.sol for shared test configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • #18: Directly addresses the request to make stablecoin and reserve coin names/symbols configurable by passing them as constructor parameters instead of using hardcoded values.

Poem

🐰 No more names cast in stone so tight,
Parameters flow left and right!
From script to contract, each coin takes flight,
With configurable symbols shining bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes: foundry.toml configuration (via_ir, optimizer, optimizer_runs) and foundry.lock are unrelated to the core requirement of making coin names/symbols configurable. Remove foundry.toml and foundry.lock changes from this PR; these optimization settings should be addressed separately or justified as supporting changes in the PR description.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: making stablecoin and reservecoin names/symbols configurable instead of hardcoded.
Linked Issues check ✅ Passed The PR successfully addresses issue #18 by making stablecoin and reservecoin names/symbols configurable through constructor parameters without exceeding function argument limits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Make the name and symbol of the Stablecoin and the Reservecoin configurable

1 participant