Skip to content

Commit d21495a

Browse files
authored
chore: temporarily revert of price changes in #239 (#261)
Towards #254 We are cutting a set of contracts for the M3 milestone. The price changes in #239 was done with #250 being landed in mind. Since #250 is not going to land before in M4, I have temporarily reverted the price changes, so that we keep the price intact for the M3 contract publishing.
1 parent 2fac39a commit d21495a

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
@@ -145,7 +145,7 @@ contract FilecoinWarmStorageService is
145145

146146
// Structure for service pricing information
147147
struct ServicePricing {
148-
uint256 pricePerTiBPerMonthNoCDN; // Price without CDN add-on (2.5 USDFC per TiB per month)
148+
uint256 pricePerTiBPerMonthNoCDN; // Price without CDN add-on (5 USDFC per TiB per month)
149149
uint256 pricePerTiBPerMonthWithCDN; // Price with CDN add-on (3 USDFC per TiB per month)
150150
IERC20 tokenAddress; // Address of the USDFC token
151151
uint256 epochsPerMonth; // Number of epochs in a month
@@ -171,7 +171,7 @@ contract FilecoinWarmStorageService is
171171
string private constant METADATA_KEY_WITH_CDN = "withCDN";
172172

173173
// Pricing constants
174-
uint256 private immutable STORAGE_PRICE_PER_TIB_PER_MONTH; // 2.5 USDFC per TiB per month without CDN with correct decimals
174+
uint256 private immutable STORAGE_PRICE_PER_TIB_PER_MONTH; // 5 USDFC per TiB per month without CDN with correct decimals
175175
uint256 private immutable CACHE_MISS_PRICE_PER_TIB_PER_MONTH; // .5 USDFC per TiB per month for CDN with correct decimals
176176
uint256 private immutable CDN_PRICE_PER_TIB_PER_MONTH; // .5 USDFC per TiB per month for CDN with correct decimals
177177

@@ -317,7 +317,7 @@ contract FilecoinWarmStorageService is
317317
TOKEN_DECIMALS = _usdfc.decimals();
318318

319319
// Initialize the fee constants based on the actual token decimals
320-
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS) / 2; // 2.5 USDFC
320+
STORAGE_PRICE_PER_TIB_PER_MONTH = (5 * 10 ** TOKEN_DECIMALS); // 5 USDFC
321321
CACHE_MISS_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
322322
CDN_PRICE_PER_TIB_PER_MONTH = (1 * 10 ** TOKEN_DECIMALS) / 2; // 0.5 USDFC
323323
}

service_contracts/test/FilecoinWarmStorageService.t.sol

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

796796
uint256 decimals = 6; // MockUSDFC uses 6 decimals in tests
797-
uint256 expectedNoCDN = 25 * 10 ** (decimals - 1); // 2.5 USDFC with 6 decimals
798-
uint256 expectedWithCDN = 3 * 10 ** decimals; // 3 USDFC with 6 decimals (2.5 + 0.5 CDN)
797+
uint256 expectedNoCDN = 5 * 10 ** decimals; // 5 USDFC with 6 decimals
798+
uint256 expectedWithCDN = 55 * 10 ** (decimals - 1); // 5.5 USDFC with 6 decimals
799799

800-
assertEq(pricing.pricePerTiBPerMonthNoCDN, expectedNoCDN, "No CDN price should be 2.5 * 10^decimals");
801-
assertEq(pricing.pricePerTiBPerMonthWithCDN, expectedWithCDN, "With CDN price should be 3 * 10^decimals");
800+
assertEq(pricing.pricePerTiBPerMonthNoCDN, expectedNoCDN, "No CDN price should be 5 * 10^decimals");
801+
assertEq(pricing.pricePerTiBPerMonthWithCDN, expectedWithCDN, "With CDN price should be 5.5 * 10^decimals");
802802
assertEq(address(pricing.tokenAddress), address(mockUSDFC), "Token address should match USDFC");
803803
assertEq(pricing.epochsPerMonth, 86400, "Epochs per month should be 86400");
804804

@@ -812,16 +812,16 @@ contract FilecoinWarmStorageServiceTest is Test {
812812
(uint256 serviceFee, uint256 spPayment) = pdpServiceWithPayments.getEffectiveRates();
813813

814814
uint256 decimals = 6; // MockUSDFC uses 6 decimals in tests
815-
// Total is 2.5 USDFC with 6 decimals
816-
uint256 expectedTotal = 25 * 10 ** (decimals - 1);
815+
// Total is 5 USDFC with 6 decimals
816+
uint256 expectedTotal = 5 * 10 ** decimals;
817817

818818
// Test setup uses 0% commission
819819
uint256 expectedServiceFee = 0; // 0% commission
820820
uint256 expectedSpPayment = expectedTotal; // 100% goes to SP
821821

822822
assertEq(serviceFee, expectedServiceFee, "Service fee should be 0 with 0% commission");
823-
assertEq(spPayment, expectedSpPayment, "SP payment should be 2.5 * 10^6");
824-
assertEq(serviceFee + spPayment, expectedTotal, "Total should equal 2.5 * 10^6");
823+
assertEq(spPayment, expectedSpPayment, "SP payment should be 5 * 10^6");
824+
assertEq(serviceFee + spPayment, expectedTotal, "Total should equal 5 * 10^6");
825825

826826
// Verify the values are in expected range
827827
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
@@ -146,7 +146,7 @@ contract FilecoinWarmStorageServiceOwnerTest is Test {
146146
maxPieceSizeInBytes: 1024 * 1024,
147147
ipniPiece: false,
148148
ipniIpfs: false,
149-
storagePricePerTibPerMonth: 25 * 10 ** 5, // 2.5 USDFC per TiB per month
149+
storagePricePerTibPerMonth: 5 * 10 ** 6, // 5 USDFC per TiB per month
150150
minProvingPeriodInEpochs: 2880,
151151
location: "US",
152152
paymentTokenAddress: IERC20(address(0))

0 commit comments

Comments
 (0)