Skip to content

Commit 2e18fc5

Browse files
committed
fix: initialize pricing variables in initialize() for UUPS proxy
fix: initialize pricing variables in initialize() for UUPS proxy
1 parent d0a014b commit 2e18fc5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

service_contracts/src/FilecoinWarmStorageService.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,6 @@ contract FilecoinWarmStorageService is
328328
// Read token decimals from the USDFC token contract
329329
TOKEN_DECIMALS = _usdfc.decimals();
330330

331-
// Initialize the fee constants based on the actual token decimals
332-
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS) / 2; // 2.5 USDFC
333-
CACHE_MISS_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
334-
CDN_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
335-
336331
// Initialize the lockup constants based on the actual token decimals
337332
DEFAULT_CDN_LOCKUP_AMOUNT = (7 * 10 ** TOKEN_DECIMALS) / 10; // 0.7 USDFC
338333
DEFAULT_CACHE_MISS_LOCKUP_AMOUNT = (3 * 10 ** TOKEN_DECIMALS) / 10; // 0.3 USDFC
@@ -382,6 +377,11 @@ contract FilecoinWarmStorageService is
382377

383378
// Set commission rate
384379
serviceCommissionBps = 0; // 0%
380+
381+
// Initialize pricing rates based on token decimals
382+
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS) / 2; // 2.5 USDFC
383+
CACHE_MISS_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
384+
CDN_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
385385
}
386386

387387
function announcePlannedUpgrade(PlannedUpgrade calldata plannedUpgrade) external onlyOwner {

0 commit comments

Comments
 (0)