Skip to content

feat: make stablecoin and reservecoin names/symbols configurable - #56

Open
subheeksh5599 wants to merge 2 commits into
DjedAlliance:mainfrom
subheeksh5599:feat/configurable-coin-names
Open

feat: make stablecoin and reservecoin names/symbols configurable#56
subheeksh5599 wants to merge 2 commits into
DjedAlliance:mainfrom
subheeksh5599:feat/configurable-coin-names

Conversation

@subheeksh5599

@subheeksh5599 subheeksh5599 commented Jul 29, 2026

Copy link
Copy Markdown

What

Makes stablecoin and reservecoin names and symbols configurable via constructor parameters instead of hardcoded values.

Before

stableCoin = new Coin("StableCoin", "SC");
reserveCoin = new Coin("ReserveCoin", "RC");

After

stableCoin = new Coin(_stableCoinName, _stableCoinSymbol);
reserveCoin = new Coin(_reserveCoinName, _reserveCoinSymbol);

Changes

  • Djed.sol / DjedShu.sol — added 4 string params (_stableCoinName, _stableCoinSymbol, _reserveCoinName, _reserveCoinSymbol) to constructors
  • DeploymentParameters.sol — added config fields with current values as defaults for all networks
  • deployDjedContract.s.sol / deployDjedShuContract.sol — pass new params
  • Tests (Djed.t.sol, Fee.t.sol, TransactionLimit.t.sol) — pass default values, all 39 tests pass

Testing

Ran 5 test suites: 39 tests passed, 0 failed, 0 skipped

Closes #18

Summary by CodeRabbit

  • New Features

    • Added configurable names and symbols for stable and reserve coins.
    • Deployment configurations now provide token metadata for supported networks.
    • Deployed coins use the configured names and symbols instead of fixed defaults.
  • Tests

    • Updated contract deployment tests to include the new token metadata settings.

Add _stableCoinName, _stableCoinSymbol, _reserveCoinName, _reserveCoinSymbol
as constructor parameters in Djed and DjedShu contracts instead of hardcoded
'StableCoin'/'SC'/'ReserveCoin'/'RC'.

Update deployment scripts, parameters, and all tests to pass the configurable
values while defaulting to the original names for backward compatibility.

Closes DjedAlliance#18
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@subheeksh5599, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 067804ae-a055-42c1-8104-8029c2c325f6

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2f2c1 and e5ebf17.

📒 Files selected for processing (2)
  • scripts/DeploymentParameters.sol
  • src/test/Djed.t.sol
📝 Walkthrough

Walkthrough

The change makes stable and reserve coin names and symbols configurable through network deployment parameters, forwards them through both deployment scripts and constructors, and updates test deployments to supply the expanded constructor arguments.

Changes

Configurable coin metadata

Layer / File(s) Summary
Network metadata configuration
scripts/DeploymentParameters.sol
Adds stable/reserve coin name and symbol fields, assigns values for supported networks, and returns them from getConfigFromNetwork.
Constructor coin initialization
src/Djed.sol, src/DjedShu.sol
Extends both constructors with four metadata parameters and uses them to initialize Coin instances.
Deployment and test wiring
scripts/deployDjedContract.s.sol, scripts/deployDjedShuContract.sol, src/test/*.t.sol
Forwards metadata from deployment configuration and supplies the new arguments in Djed test setups.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DeploymentParameters
  participant DeploymentScript
  participant DjedOrDjedShu
  participant Coin
  DeploymentParameters->>DeploymentScript: return coin names and symbols
  DeploymentScript->>DjedOrDjedShu: pass metadata to constructor
  DjedOrDjedShu->>Coin: initialize stable and reserve coins
Loading

Possibly related issues

  • Issue 43: Directly concerns configurable stablecoin and reservecoin names and symbols in the Djed constructors.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: making stablecoin and reservecoin names and symbols configurable.
Linked Issues check ✅ Passed The PR satisfies issue #18 by passing configurable names and symbols into the constructors and using them when creating the coins.
Out of Scope Changes check ✅ Passed The changes stay focused on configurability updates and aligned test/script adjustments, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/test/Djed.t.sol (1)

30-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a non-default metadata assertion.

This setup only verifies the expanded constructor signature. Add one test using distinct stable/reserve names and symbols, then assert the deployed coin metadata, so argument ordering and propagation are covered.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/Djed.t.sol` around lines 30 - 32, Extend the Djed deployment tests
around the constructor setup to deploy with distinct non-default stable and
reserve names and symbols, then assert the deployed coins expose those exact
metadata values. Use the existing metadata accessors and preserve the current
default-configuration coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/DeploymentParameters.sol`:
- Around line 133-137: Update the network metadata selection in
DeploymentParameters around the return values including STABLE_COIN_NAME and
RESERVE_COIN_NAME so MILKOMEDA_TESTNET is handled explicitly. Assign its
intended coin metadata before returning, or remove/reject the enum value if it
is unsupported, ensuring no empty or stale strings reach the coin constructors.

---

Nitpick comments:
In `@src/test/Djed.t.sol`:
- Around line 30-32: Extend the Djed deployment tests around the constructor
setup to deploy with distinct non-default stable and reserve names and symbols,
then assert the deployed coins expose those exact metadata values. Use the
existing metadata accessors and preserve the current default-configuration
coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bf9aaf6-c4f5-4e4c-b6d9-ca8daf87c605

📥 Commits

Reviewing files that changed from the base of the PR and between b5308e4 and 7f2f2c1.

📒 Files selected for processing (8)
  • scripts/DeploymentParameters.sol
  • scripts/deployDjedContract.s.sol
  • scripts/deployDjedShuContract.sol
  • src/Djed.sol
  • src/DjedShu.sol
  • src/test/Djed.t.sol
  • src/test/Fee.t.sol
  • src/test/TransactionLimit.t.sol

Comment thread scripts/DeploymentParameters.sol
- Add default coin metadata for MILKOMEDA_TESTNET to prevent empty strings
- Add testConfigurableCoinNames to verify custom names/symbols propagate
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