Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
[submodule "service_contracts/lib/openzeppelin-contracts-upgradeable"]
path = service_contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "service_contracts/lib/fws-payments"]
path = service_contracts/lib/fws-payments
url = https://github.com/FilOzone/fws-payments
[submodule "service_contracts/lib/pdp"]
path = service_contracts/lib/pdp
url = https://github.com/FilOzone/pdp
[submodule "service_contracts/lib/session-key-registry"]
path = service_contracts/lib/session-key-registry
url = https://github.com/FilOzone/SessionKeyRegistry
[submodule "service_contracts/lib/pyth-sdk-solidity"]
path = service_contracts/lib/pyth-sdk-solidity
url = https://github.com/pyth-network/pyth-sdk-solidity
[submodule "service_contracts/lib/prb-math"]
path = service_contracts/lib/prb-math
url = https://github.com/PaulRBerg/prb-math
10 changes: 6 additions & 4 deletions service_contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ remappings = [
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/',
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/',
'forge-std/=lib/forge-std/src/',
'@fws-payments/=lib/fws-payments/src/',
'@pdp/=lib/pdp/src/',
'@session-key-registry/=lib/session-key-registry/src/',
'@pythnetwork/pyth-sdk-solidity/=lib/pdp/lib/pyth-sdk-solidity/',
'@payments/=src/payments/contracts/',
'@pdp/=src/pdp/contracts/',
'@session-key-registry/=src/session-key-registry/contracts/',
'@service-provider/=src/service-provider/',
'@pythnetwork/pyth-sdk-solidity/=lib/pyth-sdk-solidity/',
'@prb-math/=lib/prb-math/src/',
]

# Allow reading test data files
Expand Down
115 changes: 115 additions & 0 deletions service_contracts/generated_view.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
pragma solidity ^0.8.20;

// Generated with ./tools/generate_view_contract.sh out/FilecoinWarmStorageService.sol/FilecoinWarmStorageService.json

import {IPDPProvingSchedule} from "@pdp/IPDPProvingSchedule.sol";
import "./FilecoinWarmStorageService.sol";
import "./lib/FilecoinWarmStorageServiceStateInternalLibrary.sol";
contract FilecoinWarmStorageServiceStateView is IPDPProvingSchedule {
using FilecoinWarmStorageServiceStateInternalLibrary for FilecoinWarmStorageService;
FilecoinWarmStorageService public immutable service;
constructor(FilecoinWarmStorageService _service) {
service = _service;
}
function UPGRADE_INTERFACE_VERSION() external view returns (string memory) {
return FilecoinWarmStorageServiceStateInternalLibrary.UPGRADE_INTERFACE_VERSION();
}
function calculateRatesPerEpoch(uint256 totalBytes) external view returns (uint256 storageRate, uint256 cacheMissRate, uint256 cdnRate) {
return FilecoinWarmStorageServiceStateInternalLibrary.calculateRatesPerEpoch(totalBytes);
}
function configureProvingPeriod(uint64 _maxProvingPeriod, uint256 _challengeWindowSize) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.configureProvingPeriod(_maxProvingPeriod, _challengeWindowSize);
}
function dataSetCreated(uint256 dataSetId, address creator, bytes extraData) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.dataSetCreated(dataSetId, creator, extraData);
}
function dataSetDeleted(uint256 dataSetId, uint256 , bytes extraData) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.dataSetDeleted(dataSetId, , extraData);
}
function eip712Domain() external view returns (bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions) {
return FilecoinWarmStorageServiceStateInternalLibrary.eip712Domain();
}
function extsload(bytes32 slot) external view returns (bytes32) {
return FilecoinWarmStorageServiceStateInternalLibrary.extsload(slot);
}
function extsloadStruct(bytes32 slot, uint256 size) external view returns (bytes32[] memory) {
return FilecoinWarmStorageServiceStateInternalLibrary.extsloadStruct(slot, size);
}
function filCDNAddress() external view returns (address) {
return FilecoinWarmStorageServiceStateInternalLibrary.filCDNAddress();
}
function getEffectiveRates() external view returns (uint256 serviceFee, uint256 spPayment) {
return FilecoinWarmStorageServiceStateInternalLibrary.getEffectiveRates();
}
function getProvingPeriodForEpoch(uint256 dataSetId, uint256 epoch) external view returns (uint256) {
return FilecoinWarmStorageServiceStateInternalLibrary.getProvingPeriodForEpoch(dataSetId, epoch);
}
function getServicePrice() external view returns (FilecoinWarmStorageService.ServicePricing memory pricing) {
return FilecoinWarmStorageServiceStateInternalLibrary.getServicePrice();
}
function initialize(uint64 _maxProvingPeriod, uint256 _challengeWindowSize) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.initialize(_maxProvingPeriod, _challengeWindowSize);
}
function isEpochProven(uint256 dataSetId, uint256 epoch) external view returns (bool) {
return FilecoinWarmStorageServiceStateInternalLibrary.isEpochProven(dataSetId, epoch);
}
function migrate() external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.migrate();
}
function nextProvingPeriod(uint256 dataSetId, uint256 challengeEpoch, uint256 leafCount, bytes ) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.nextProvingPeriod(dataSetId, challengeEpoch, leafCount, );
}
function owner() external view returns (address) {
return FilecoinWarmStorageServiceStateInternalLibrary.owner();
}
function paymentsContractAddress() external view returns (address) {
return FilecoinWarmStorageServiceStateInternalLibrary.paymentsContractAddress();
}
function pdpVerifierAddress() external view returns (address) {
return FilecoinWarmStorageServiceStateInternalLibrary.pdpVerifierAddress();
}
function piecesAdded(uint256 dataSetId, uint256 firstAdded, tuple[] pieceData, bytes extraData) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.piecesAdded(dataSetId, firstAdded, pieceData, extraData);
}
function piecesScheduledRemove(uint256 dataSetId, uint256[] pieceIds, bytes extraData) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.piecesScheduledRemove(dataSetId, pieceIds, extraData);
}
function possessionProven(uint256 dataSetId, uint256 , uint256 , uint256 challengeCount) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.possessionProven(dataSetId, , , challengeCount);
}
function proxiableUUID() external view returns (bytes32) {
return FilecoinWarmStorageServiceStateInternalLibrary.proxiableUUID();
}
function railTerminated(uint256 railId, address terminator, uint256 endEpoch) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.railTerminated(railId, terminator, endEpoch);
}
function renounceOwnership() external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.renounceOwnership();
}
function serviceCommissionBps() external view returns (uint256) {
return FilecoinWarmStorageServiceStateInternalLibrary.serviceCommissionBps();
}
function storageProviderChanged(uint256 dataSetId, address oldServiceProvider, address newServiceProvider, bytes extraData) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.storageProviderChanged(dataSetId, oldServiceProvider, newServiceProvider, extraData);
}
function terminateService(uint256 dataSetId) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.terminateService(dataSetId);
}
function transferOwnership(address newOwner) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.transferOwnership(newOwner);
}
function updateServiceCommission(uint256 newCommissionBps) external nonpayable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.updateServiceCommission(newCommissionBps);
}
function upgradeToAndCall(address newImplementation, bytes data) external payable returns () {
return FilecoinWarmStorageServiceStateInternalLibrary.upgradeToAndCall(newImplementation, data);
}
function usdfcTokenAddress() external view returns (address) {
return FilecoinWarmStorageServiceStateInternalLibrary.usdfcTokenAddress();
}
function validatePayment(uint256 railId, uint256 proposedAmount, uint256 fromEpoch, uint256 toEpoch, uint256 ) external nonpayable returns (IValidator.ValidationResult memory result) {
return FilecoinWarmStorageServiceStateInternalLibrary.validatePayment(railId, proposedAmount, fromEpoch, toEpoch, );
}

}
1 change: 0 additions & 1 deletion service_contracts/lib/fws-payments
Submodule fws-payments deleted from 477228
1 change: 0 additions & 1 deletion service_contracts/lib/pdp
Submodule pdp deleted from 616813
1 change: 1 addition & 0 deletions service_contracts/lib/prb-math
Submodule prb-math added at 119f37
1 change: 1 addition & 0 deletions service_contracts/lib/pyth-sdk-solidity
Submodule pyth-sdk-solidity added at 11d6bc
1 change: 0 additions & 1 deletion service_contracts/lib/session-key-registry
Submodule session-key-registry deleted from e472ca
Loading
Loading