Open ryu9827 opened 6 years ago
CAPITAL_LETTERS_WITH_UNDERSCORE usually means constant variable. Using the same logic in the development and public documents is not a great idea, I believe. Just imagine, that your cars parts will be called not the "driving wheel" for example, but "part number 56TH - W00000000023.123 YH".
Readability of the code means that anyone can read the code and understand conception beside that code. In this case "feeForTheStakingInterval" looks good I think.
This issue is not about the names or weather it is capital letters. It is about their roles in the formula. In the codes, weiPerFee is the divisor. By contrast, ETH_FEE_RATE is a multiplier on the whitepaper. I think it is better for understanding if both of them are divisors so we or the stakers don't worry about if the developer makes a mistake here.
Oh, I see your point. Yes, they used different formulas in the code and in the WP. Sure, it is better to keep consistency. Then it may be better to call the issue something like "Formulas of the FEE calculations in the code and whitepaper are contradicting each other"
https://github.com/tikonoff/staking-app/blob/8306bb8deebe0f554e99bf4e525ea4a3f5672397/contracts/Stake.sol#L140 Here using weiPerFee to be the divisor. In the whitepaper, ETH_FEE_RATE is used to multiple ETH amount to calculate FEE tokens. We can understand that weiPerFee is the reciprocal of ETH_FEE_RATE. But it is better for readability if we keep code logic align to the whitepaper.