This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Schema.sol
140 lines (115 loc) · 2.88 KB
/
Schema.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/**
* @title TextDAO Schema v0.1.0
*/
library Schema {
/// @custom:storage-location erc7201:textDAO.ProposeStorage
struct ProposeStorage {
mapping(uint => Proposal) proposals;
uint nextProposalId;
ProposalsConfig config;
}
struct ProposalsConfig {
uint expiryDuration;
uint tallyInterval;
uint repsNum;
uint quorumScore;
}
struct Proposal {
Header[] headers;
Command[] cmds;
mapping(uint => bool) tallied;
ProposalMeta proposalMeta;
}
struct Header {
uint id;
uint currentScore;
bytes32 metadataURI;
uint[] tagIds;
}
struct Command {
uint id;
Action[] actions;
uint currentScore;
}
struct Action {
string func;
bytes abiParams;
}
struct ProposalMeta {
uint currentScore;
uint[] headerRank;
uint[] cmdRank;
uint nextHeaderTallyFrom;
uint nextCmdTallyFrom;
address[] reps;
uint nextRepId;
uint createdAt;
}
/// @custom:storage-location erc7201:textDAO.TextSaveProtectedStorage
struct TextSaveProtectedStorage {
mapping(uint => Text) texts;
uint nextTextId;
}
struct Text {
uint id;
bytes32[] metadataURIs;
}
/// @custom:storage-location erc7201:textDAO.MemberJoinProtectedStorage
struct MemberJoinProtectedStorage {
mapping(uint => Member) members;
uint nextMemberId;
}
struct Member {
uint id;
address addr;
bytes32 metadataURI;
}
/// @custom:storage-location erc7201:textDAO.VRFStorage
struct VRFStorage {
mapping(uint => Request) requests;
uint nextId;
uint64 subscriptionId;
VRFConfig config;
}
struct Request {
uint requestId;
uint proposalId;
}
struct VRFConfig {
address vrfCoordinator;
bytes32 keyHash;
uint32 callbackGasLimit;
uint16 requestConfirmations;
uint32 numWords;
address LINKTOKEN;
}
/// @custom:storage-location erc7201:textDAO.ConfigOverrideStorage
struct ConfigOverrideStorage {
mapping(bytes4 => ConfigOverride) overrides;
// bytes4[] overridesIndex;
}
struct ConfigOverride {
uint quorumScore;
}
/// @custom:storage-location erc7201:textDAO.TagStorage
struct TagStorage {
mapping(uint => Tag) tags;
uint nextId;
}
struct Tag {
uint id;
bytes32 metadataURI;
}
/// @custom:storage-location erc7201:textDAO.TagRelationStorage
struct TagRelationStorage {
mapping(uint => TagRelation) relations;
uint nextId;
}
struct TagRelation {
uint id;
uint tagId;
uint taggedId;
}
}