From 2f4bb861be0ef43caed8f69e38c3a5951a16682b Mon Sep 17 00:00:00 2001 From: Shaurya Date: Sat, 13 Dec 2025 14:50:43 +0530 Subject: [PATCH 1/2] Add COPYRIGHT.md --- COPYRIGHT.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 COPYRIGHT.md diff --git a/COPYRIGHT.md b/COPYRIGHT.md new file mode 100644 index 0000000..d9467d0 --- /dev/null +++ b/COPYRIGHT.md @@ -0,0 +1,8 @@ +Copyright © 2025 The Stable Order
+All rights reserved. + +All works in this repository may be used according to the conditions +stated in the LICENSE.md file available in this repository. + +These works are WITHOUT ANY WARRANTY, without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. From 779be9ce983c307df93a57c40b26da2505414e3d Mon Sep 17 00:00:00 2001 From: singhshaurya01 Date: Sun, 14 Dec 2025 02:31:54 +0530 Subject: [PATCH 2/2] "Refactor Djed constructor to accept configurable token names and symbols" --- src/Djed.sol | 54 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/Djed.sol b/src/Djed.sol index 0d6ae8f..f8a4486 100644 --- a/src/Djed.sol +++ b/src/Djed.sol @@ -31,37 +31,51 @@ contract Djed is ReentrancyGuard { uint256 public immutable scDecimalScalingFactor; uint256 public immutable rcDecimalScalingFactor; + struct ConstructorParams { + address oracleAddress; + uint256 scalingFactor; + address treasury; + uint256 initialTreasuryFee; + uint256 treasuryRevenueTarget; + uint256 reserveRatioMin; + uint256 reserveRatioMax; + uint256 fee; + uint256 thresholdSupplySC; + uint256 rcMinPrice; + uint256 rcInitialPrice; + uint256 txLimit; + string stableCoinName; + string stableCoinSymbol; + string reserveCoinName; + string reserveCoinSymbol; + } + event BoughtStableCoins(address indexed buyer, address indexed receiver, uint256 amountSC, uint256 amountBC); event SoldStableCoins(address indexed seller, address indexed receiver, uint256 amountSC, uint256 amountBC); event BoughtReserveCoins(address indexed buyer, address indexed receiver, uint256 amountRC, uint256 amountBC); event SoldReserveCoins(address indexed seller, address indexed receiver, uint256 amountRC, uint256 amountBC); event SoldBothCoins(address indexed seller, address indexed receiver, uint256 amountSC, uint256 amountRC, uint256 amountBC); - constructor( - address oracleAddress, uint256 _scalingFactor, - address _treasury, uint256 _initialTreasuryFee, uint256 _treasuryRevenueTarget, - uint256 _reserveRatioMin, uint256 _reserveRatioMax, - uint256 _fee, uint256 _thresholdSupplySC, uint256 _rcMinPrice, uint256 _rcInitialPrice, uint256 _txLimit - ) payable { - stableCoin = new Coin("StableCoin", "SC"); - reserveCoin = new Coin("ReserveCoin", "RC"); + constructor(ConstructorParams memory params) payable { + stableCoin = new Coin(params.stableCoinName, params.stableCoinSymbol); + reserveCoin = new Coin(params.reserveCoinName, params.reserveCoinSymbol); scDecimalScalingFactor = 10**stableCoin.decimals(); rcDecimalScalingFactor = 10**reserveCoin.decimals(); - scalingFactor = _scalingFactor; + scalingFactor = params.scalingFactor; - treasury = _treasury; - initialTreasuryFee = _initialTreasuryFee; - treasuryRevenueTarget = _treasuryRevenueTarget; + treasury = params.treasury; + initialTreasuryFee = params.initialTreasuryFee; + treasuryRevenueTarget = params.treasuryRevenueTarget; - reserveRatioMin = _reserveRatioMin; - reserveRatioMax = _reserveRatioMax; - fee = _fee; - thresholdSupplySC = _thresholdSupplySC; - rcMinPrice = _rcMinPrice; - rcInitialPrice = _rcInitialPrice; - txLimit = _txLimit; + reserveRatioMin = params.reserveRatioMin; + reserveRatioMax = params.reserveRatioMax; + fee = params.fee; + thresholdSupplySC = params.thresholdSupplySC; + rcMinPrice = params.rcMinPrice; + rcInitialPrice = params.rcInitialPrice; + txLimit = params.txLimit; - oracle = IOracle(oracleAddress); + oracle = IOracle(params.oracleAddress); oracle.acceptTermsOfService(); }