Skip to content

Commit 935097a

Browse files
authored
chore: revert temporary price revert from #261 (#316)
This reverts the temporary price revert from PR #261, restoring the 2.5 USDFC per TiB per month pricing originally introduced in PR #239. Now that the duplication contract changes have landed, we can safely restore the intended pricing structure.
1 parent af644df commit 935097a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

service_contracts/src/FilecoinWarmStorageService.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ contract FilecoinWarmStorageService is
154154

155155
// Structure for service pricing information
156156
struct ServicePricing {
157-
uint256 pricePerTiBPerMonthNoCDN; // Price without CDN add-on (5 USDFC per TiB per month)
157+
uint256 pricePerTiBPerMonthNoCDN; // Price without CDN add-on (2.5 USDFC per TiB per month)
158158
uint256 pricePerTiBPerMonthWithCDN; // Price with CDN add-on (3 USDFC per TiB per month)
159159
IERC20 tokenAddress; // Address of the USDFC token
160160
uint256 epochsPerMonth; // Number of epochs in a month
@@ -193,7 +193,7 @@ contract FilecoinWarmStorageService is
193193
0x7769746843444e0000000000000000000000000000000000000000000000000e;
194194

195195
// Pricing constants
196-
uint256 private immutable STORAGE_PRICE_PER_TIB_PER_MONTH; // 5 USDFC per TiB per month without CDN with correct decimals
196+
uint256 private immutable STORAGE_PRICE_PER_TIB_PER_MONTH; // 2.5 USDFC per TiB per month without CDN with correct decimals
197197
uint256 private immutable CACHE_MISS_PRICE_PER_TIB_PER_MONTH; // .5 USDFC per TiB per month for CDN with correct decimals
198198
uint256 private immutable CDN_PRICE_PER_TIB_PER_MONTH; // .5 USDFC per TiB per month for CDN with correct decimals
199199

@@ -321,7 +321,7 @@ contract FilecoinWarmStorageService is
321321
TOKEN_DECIMALS = _usdfc.decimals();
322322

323323
// Initialize the fee constants based on the actual token decimals
324-
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS); // 5 USDFC
324+
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS) / 2; // 2.5 USDFC
325325
CACHE_MISS_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
326326
CDN_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
327327

service_contracts/test/FilecoinWarmStorageService.t.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -910,11 +910,11 @@ contract FilecoinWarmStorageServiceTest is MockFVMTest {
910910
FilecoinWarmStorageService.ServicePricing memory pricing = pdpServiceWithPayments.getServicePrice();
911911

912912
uint256 decimals = 6; // MockUSDFC uses 6 decimals in tests
913-
uint256 expectedNoCDN = 5 * 10 ** decimals; // 5 USDFC with 6 decimals
914-
uint256 expectedWithCDN = 55 * 10 ** (decimals - 1); // 5.5 USDFC with 6 decimals
913+
uint256 expectedNoCDN = 25 * 10 ** (decimals - 1); // 2.5 USDFC with 6 decimals
914+
uint256 expectedWithCDN = 3 * 10 ** decimals; // 3 USDFC with 6 decimals (2.5 + 0.5 CDN)
915915

916-
assertEq(pricing.pricePerTiBPerMonthNoCDN, expectedNoCDN, "No CDN price should be 5 * 10^decimals");
917-
assertEq(pricing.pricePerTiBPerMonthWithCDN, expectedWithCDN, "With CDN price should be 5.5 * 10^decimals");
916+
assertEq(pricing.pricePerTiBPerMonthNoCDN, expectedNoCDN, "No CDN price should be 2.5 * 10^decimals");
917+
assertEq(pricing.pricePerTiBPerMonthWithCDN, expectedWithCDN, "With CDN price should be 3 * 10^decimals");
918918
assertEq(address(pricing.tokenAddress), address(mockUSDFC), "Token address should match USDFC");
919919
assertEq(pricing.epochsPerMonth, 86400, "Epochs per month should be 86400");
920920

@@ -928,16 +928,16 @@ contract FilecoinWarmStorageServiceTest is MockFVMTest {
928928
(uint256 serviceFee, uint256 spPayment) = pdpServiceWithPayments.getEffectiveRates();
929929

930930
uint256 decimals = 6; // MockUSDFC uses 6 decimals in tests
931-
// Total is 5 USDFC with 6 decimals
932-
uint256 expectedTotal = 5 * 10 ** decimals;
931+
// Total is 2.5 USDFC with 6 decimals
932+
uint256 expectedTotal = 25 * 10 ** (decimals - 1);
933933

934934
// Test setup uses 0% commission
935935
uint256 expectedServiceFee = 0; // 0% commission
936936
uint256 expectedSpPayment = expectedTotal; // 100% goes to SP
937937

938938
assertEq(serviceFee, expectedServiceFee, "Service fee should be 0 with 0% commission");
939-
assertEq(spPayment, expectedSpPayment, "SP payment should be 5 * 10^6");
940-
assertEq(serviceFee + spPayment, expectedTotal, "Total should equal 5 * 10^6");
939+
assertEq(spPayment, expectedSpPayment, "SP payment should be 2.5 * 10^6");
940+
assertEq(serviceFee + spPayment, expectedTotal, "Total should equal 2.5 * 10^6");
941941

942942
// Verify the values are in expected range
943943
assert(serviceFee + spPayment < 10 ** 8); // Less than 10^8

service_contracts/test/FilecoinWarmStorageServiceOwner.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ contract FilecoinWarmStorageServiceOwnerTest is MockFVMTest {
147147
maxPieceSizeInBytes: 1024 * 1024,
148148
ipniPiece: false,
149149
ipniIpfs: false,
150-
storagePricePerTibPerMonth: 5 * 10 ** 6, // 5 USDFC per TiB per month
150+
storagePricePerTibPerMonth: 25 * 10 ** 5, // 2.5 USDFC per TiB per month
151151
minProvingPeriodInEpochs: 2880,
152152
location: "US",
153153
paymentTokenAddress: IERC20(address(0))

0 commit comments

Comments
 (0)