@@ -73,15 +73,15 @@ contract UFragmentsPolicy is Ownable {
73
73
// MAX_SUPPLY = MAX_INT256 / MAX_RATE
74
74
uint256 private constant MAX_SUPPLY = ~ (uint256 (1 ) << 255 ) / MAX_RATE;
75
75
76
- // CPI-U value July 10th 1983 100 , DECIMALS Fixed point number
77
- uint256 private constant BASE_CPI = 100 * ( 10 ** DECIMALS) ;
76
+ // CPI value at the time of launch , DECIMALS Fixed point number
77
+ uint256 private baseCpi ;
78
78
79
79
/**
80
80
* @notice Anyone can call this function to initiate a new rebase operation, provided more than
81
81
* the minimum time period has elapsed.
82
82
* @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag
83
83
* Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate
84
- * and targetRate is CpiOracleRate / BASE_CPI
84
+ * and targetRate is CpiOracleRate / baseCpi
85
85
*/
86
86
function rebase () external {
87
87
// This comparison also ensures there is no reentrancy.
@@ -94,7 +94,7 @@ contract UFragmentsPolicy is Ownable {
94
94
(cpi, cpiValid) = cpiOracle.getData ();
95
95
require (cpiValid);
96
96
97
- uint256 targetRate = cpi.mul (10 ** DECIMALS).div (BASE_CPI );
97
+ uint256 targetRate = cpi.mul (10 ** DECIMALS).div (baseCpi );
98
98
99
99
uint256 exchangeRate;
100
100
bool rateValid;
@@ -188,7 +188,7 @@ contract UFragmentsPolicy is Ownable {
188
188
* It is called at the time of contract creation to invoke parent class initializers and
189
189
* initialize the contract's state variables.
190
190
*/
191
- function initialize (address owner , UFragments uFrags_ )
191
+ function initialize (address owner , UFragments uFrags_ , uint256 baseCpi_ )
192
192
public
193
193
initializer
194
194
{
@@ -203,6 +203,7 @@ contract UFragmentsPolicy is Ownable {
203
203
epoch = 0 ;
204
204
205
205
uFrags = uFrags_;
206
+ baseCpi = baseCpi_;
206
207
}
207
208
208
209
/**
0 commit comments