From fb23bfec5d2137e55c6e38405feac17a855bb678 Mon Sep 17 00:00:00 2001 From: baroooo Date: Mon, 25 Nov 2024 14:55:36 +0100 Subject: [PATCH] chore: rename to EXPANSION_MAX_WEIGHT --- contracts/goodDollar/GoodDollarExpansionController.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contracts/goodDollar/GoodDollarExpansionController.sol b/contracts/goodDollar/GoodDollarExpansionController.sol index 55ccc4f..92cebb6 100644 --- a/contracts/goodDollar/GoodDollarExpansionController.sol +++ b/contracts/goodDollar/GoodDollarExpansionController.sol @@ -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 @@ -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"); @@ -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)); }