📄 IProjectManagerStorage.sol
D-OPEN SOVEREIGN
1/*
2 * Copyright (c) 2026 DataPond D-Library Pty Ltd. ("The Sanctuary")
3 * Non-Profit Public Library — The World Library
4 * 
5 * D-SAFE Certification issued by POND Enterprise.
6 * Published under the D-Open Code Sovereign Licence v1.0 framework
7 * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.
8 * https://registry.world.bibliotech.com/licence
9 * Source code donated to DataPond D-Library by it's author: data pond.
10 * 
11 * Technical Guardian ("The Shield"): Pond Enterprise Pty Ltd. (ACN 694 747 987)
12 * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.
13 * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.
14 */
15
16// SPDX-License-Identifier: MIT
17pragma solidity ^0.8.24;
18
19interface IProjectManagerStorage {
20    struct Version {
21        uint32 publicationDate;
22        string uri;
23        string name;
24        string headline;
25        string arweaveAddressLogo;
26        string arweaveAddressBanner;
27        string descriptionMarkdown;
28        uint256 minimumFundingBeforeStartWork;
29        uint256 maximumFunding;
30        uint8[] tags;
31        uint8 status;
32        uint8 complexity;
33    }
34
35    struct Project {
36        uint16 id;
37    }
38
39    struct StripeDonation {
40        string stripePaymentId;
41        uint256 amountUSD;
42        string username;
43        address donor;
44        string country;
45        string language;
46        uint256 timestamp;
47        uint256 chainId;
48    }
49
50    // read only methods - public access
51    function nbProjects() external view returns (uint16);
52    function getProject(uint16 projectId) external view returns (uint16 id);
53    function getNbLanguages(uint16 projectId) external view returns (uint16);
54    function getLanguageAtIndex(uint16 projectId, uint16 index) external view returns (bytes4);
55    function getLanguageIndex(uint16 projectId, bytes4 lang) external view returns (uint16);
56    function getNbVersions(uint16 projectId, bytes4 lang) external view returns (uint16);
57    function getVersion(uint16 projectId, bytes4 lang, uint16 versionNumber) external view returns (Version memory);
58    function getVotingBalance(uint16 projectId, bytes4 lang) external view returns (uint256);
59    function getUserProjectDonation(uint16 projectId, address user) external view returns (uint256);
60    function getUserTotalDonationForProject(address user, uint16 projectId) external view returns (uint256);
61    function getUserBalances(address user) external view returns (uint256[3] memory);
62    function getWeeklyDonations(uint256 week) external view returns (StripeDonation[] memory);
63    function getDonationsRange(uint256 fromWeek, uint256 toWeek) external view returns (StripeDonation[] memory);
64
65    // State changing methods (onlyAuthorized)
66    function addAuthorized(address addr) external;
67    function incrementNbProjects() external returns (uint16);
68    function setProject(uint16 projectId) external;
69    function setNbLanguages(uint16 projectId, uint16 count) external;
70    function setLanguageMapping(uint16 projectId, bytes4 lang, uint16 index) external;
71    function setNbVersions(uint16 projectId, bytes4 lang, uint16 count) external;
72    function setVersion(uint16 projectId, bytes4 lang, uint16 versionNumber, Version calldata version) external;
73    function updateVotingBalance(uint16 projectId, bytes4 lang, uint256 amount, bool add) external;
74    function updateUserProjectDonation(uint16 projectId, address user, uint256 amount, bool add) external;
75    function updateUserTotalDonationForProject(address user, uint16 projectId, uint256 amount, bool add) external;
76    function updateUserBalances(address user, uint256[3] calldata newBalances) external;
77    function recordStripeDonation(uint256 week, StripeDonation calldata donation) external;
78
79    // ===== Admin bulk-import (migration scripts only) =====
80    function importUserBalances(address user, uint256[3] calldata bals) external;
81    function importStripeDonation(uint256 week, StripeDonation calldata donation) external;
82}