feat: make stablecoin and reservecoin names/symbols configurable - #56
feat: make stablecoin and reservecoin names/symbols configurable#56subheeksh5599 wants to merge 2 commits into
Conversation
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
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe 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. ChangesConfigurable coin metadata
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
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/Djed.t.sol (1)
30-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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
📒 Files selected for processing (8)
scripts/DeploymentParameters.solscripts/deployDjedContract.s.solscripts/deployDjedShuContract.solsrc/Djed.solsrc/DjedShu.solsrc/test/Djed.t.solsrc/test/Fee.t.solsrc/test/TransactionLimit.t.sol
- Add default coin metadata for MILKOMEDA_TESTNET to prevent empty strings - Add testConfigurableCoinNames to verify custom names/symbols propagate
What
Makes stablecoin and reservecoin names and symbols configurable via constructor parameters instead of hardcoded values.
Before
After
Changes
_stableCoinName,_stableCoinSymbol,_reserveCoinName,_reserveCoinSymbol) to constructorsTesting
Closes #18
Summary by CodeRabbit
New Features
Tests