DjedAlliance / Djed-Solidity

Other
10 stars 5 forks source link

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

Open ceilican opened 6 months ago

ceilican commented 6 months ago

In lines 46 and 47 of Djed.sol (https://github.com/DjedAlliance/Djed-Solidity/blob/main/src/Djed.sol), the satablecoin and the reservecoin are given fixed and hard-coded names and symbols: "Stablecoin", "SC", "Reservecoin", "RC".

We should make these names and symbols configurable.

The desired names and symbols should be passed as arguments in the constructor and then used in lines 46 and 47.

Note that there is a limit in the number of arguments that a function, including a constructor, can have. If adding 4 more arguments in teh constructor will make us exceed this limit, we will need to find a workaround. A one-time setup function to be called once after the constructor could be a solution.

keshav-nischal commented 5 months ago

@ceilican , this can be done by changing the constructor's argument grouping ->"address _treasury, uint256 _initialTreasuryFee, uint256 _treasuryRevenueTarget", ->"uint256 _reserveRatioMin, uint256 _reserveRatioMax," -> and ....(other similar arguments) using struct and then we can add two new args that will take {"Stablecoin", "SC"} and {"Reservecoin", "RC"} as input. Having many arguments for a function is not considered a good practice. This will also solve that.

your suggestion "A one-time setup function to be called once after the constructor could be a solution.". is not clear to me. you or anyone else can explain what this means. how will we allow the external program to input "Stablecoin", "SC", "Reservecoin", "RC" in the new function?

If you agree with my approach, I can work on this issue