/
AppStorage.sol
102 lines (54 loc) · 1.67 KB
/
AppStorage.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {LibDiamond} from "../libraries/LibDiamond.sol";
struct Content {
uint256 contentID;
string contentName;
address contentCreator;
string contentDescription;
bool flagged;
uint256 flaggedTimestamp;
address flaggedBy;
string reasonForFlagging;
uint256 validatorsYesVotes;
uint256 validatorsNoVotes;
uint256 generalYesVotes;
uint256 generalNoVotes;
bool validatorsApprovedForRedFlagging;
bool isRedFlagged;
uint256 totalGeneralVotesCount;
uint256 totalValidatorsVotesCount;
}
struct redFlaggedContent {
uint256 contentID;
uint256 flaggedTimestamp;
address flaggedBy;
}
struct VotersDetails {
address voterAddress;
bool verified;
mapping(uint256 => bool) hasVotedOnContent;
}
struct AppStorage {
// FlagContent Facet
address _jiggyTokenAddress;
address _membershipNftAddress;
address _validatorNftAddress;
uint256 _totalFlaggedContent;
uint256 _totalRedFlaggedContent;
uint256 _totalVoters;
uint256 votingDeadline;
bool _isVotingOn;
mapping(uint256 => Content) ContentBank;
mapping (address => VotersDetails) Voters;
mapping(uint256 => redFlaggedContent) redFlaggedContents;
mapping(address => mapping(uint256 => bool)) validatorsVotes;
mapping(address => mapping(uint256 => bool)) generalVotes;
}
contract Modifiers {
modifier onlyOwner() {
address owner = LibDiamond.contractOwner();
require(owner == msg.sender, "Only Owner can call this function");
_;
}
}