Skip to content

Commit

Permalink
chore: rename to EXPANSION_MAX_WEIGHT
Browse files Browse the repository at this point in the history
  • Loading branch information
baroooo committed Nov 25, 2024
1 parent 1d86bd5 commit fb23bfe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/goodDollar/GoodDollarExpansionController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ contract GoodDollarExpansionController is IGoodDollarExpansionController, Pausab
/* ==================== State Variables ==================== */
/* ========================================================= */

// MAX_WEIGHT is the max rate that can be assigned to an exchange
uint256 public constant MAX_WEIGHT = 1e18;
// EXPANSION_MAX_WEIGHT is the max rate that can be assigned to an exchange
uint256 public constant EXPANSION_MAX_WEIGHT = 1e18;

// BANCOR_MAX_WEIGHT is used for BPS calculations in GoodDollarExchangeProvider
uint32 public constant BANCOR_MAX_WEIGHT = 1e8;

// Address of the distribution helper contract
Expand Down Expand Up @@ -125,7 +126,7 @@ contract GoodDollarExpansionController is IGoodDollarExpansionController, Pausab

/// @inheritdoc IGoodDollarExpansionController
function setExpansionConfig(bytes32 exchangeId, uint64 expansionRate, uint32 expansionFrequency) external onlyAvatar {
require(expansionRate < MAX_WEIGHT, "Expansion rate must be less than 100%");
require(expansionRate < EXPANSION_MAX_WEIGHT, "Expansion rate must be less than 100%");
require(expansionRate > 0, "Expansion rate must be greater than 0");
require(expansionFrequency > 0, "Expansion frequency must be greater than 0");

Expand Down Expand Up @@ -246,7 +247,7 @@ contract GoodDollarExpansionController is IGoodDollarExpansionController, Pausab
numberOfExpansions = (block.timestamp - config.lastExpansion) / config.expansionFrequency;
}

uint256 stepReserveRatioScalar = MAX_WEIGHT - config.expansionRate;
uint256 stepReserveRatioScalar = EXPANSION_MAX_WEIGHT - config.expansionRate;
return unwrap(powu(wrap(stepReserveRatioScalar), numberOfExpansions));
}

Expand Down

0 comments on commit fb23bfe

Please sign in to comment.