-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathComponentInterface.s.sol
285 lines (250 loc) · 9.74 KB
/
ComponentInterface.s.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
import "./Util.s.sol";
import {LibString} from "@solady/utils/LibString.sol";
import {ACloneable} from "contracts/shared/ACloneable.sol";
import {ABudget} from "contracts/budgets/ABudget.sol";
import {AManagedBudget} from "contracts/budgets/AManagedBudget.sol";
import {AManagedBudgetWithFees} from "contracts/budgets/AManagedBudgetWithFees.sol";
import {AManagedBudgetWithFeesV2} from "contracts/budgets/AManagedBudgetWithFeesV2.sol";
import {AVestingBudget} from "contracts/budgets/AVestingBudget.sol";
import {ATransparentBudget} from "contracts/budgets/ATransparentBudget.sol";
import {ASignerValidator} from "contracts/validators/ASignerValidator.sol";
import {ALimitedSignerValidator} from "contracts/validators/ALimitedSignerValidator.sol";
import {AEventAction} from "contracts/actions/EventAction.sol";
import {AAllowListIncentive} from "contracts/incentives/AllowListIncentive.sol";
import {ACGDAIncentive} from "contracts/incentives/CGDAIncentive.sol";
import {AERC20Incentive} from "contracts/incentives/ERC20Incentive.sol";
import {AERC20PeggedIncentive} from "contracts/incentives/AERC20PeggedIncentive.sol";
import {AIncentive} from "contracts/incentives/AIncentive.sol";
import {AERC20VariableIncentive} from "contracts/incentives/ERC20VariableIncentive.sol";
import {AERC20VariableCriteriaIncentiveV2} from "contracts/incentives/AERC20VariableCriteriaIncentiveV2.sol";
import {AERC20PeggedVariableCriteriaIncentiveV2} from "contracts/incentives/AERC20PeggedVariableCriteriaIncentiveV2.sol";
import {APointsIncentive} from "contracts/incentives/PointsIncentive.sol";
import {ASimpleAllowList} from "contracts/allowlists/SimpleAllowList.sol";
import {ASimpleDenyList} from "contracts/allowlists/SimpleDenyList.sol";
contract LogComponentInterface is ScriptUtils {
using stdJson for string;
using LibString for uint256;
string constant componentJsonKey = "componentJsonKey";
string componentJson;
function run() public {
_getInterfaceAEventAction();
_getInterfaceAERC20Incentive();
_getInterfaceAERC20PeggedIncentive();
// _getInterfaceAERC20PeggedVariableCriteriaIncentive();
_getInterfaceAERC20PeggedVariableCriteriaIncentiveV2();
_getInterfaceACloneable();
_getInterfaceABudget();
_getInterfaceATransparentBudget();
_getInterfaceAManagedBudget();
_getInterfaceAManagedBudgetWithFees();
_getInterfaceAManagedBudgetWithFeesV2();
_getInterfaceAVestingBudget();
_getInterfaceASignerValidator();
_getInterfaceALimitedSignerValidator();
_getInterfaceAAllowListIncentive();
_getInterfaceACGDAIncentive();
_getInterfaceAIncentive();
_getInterfaceAERC20VariableIncentive();
_getInterfaceAPointsIncentive();
_getInterfaceASimpleAllowList();
_getInterfaceASimpleDenyList();
// _getInterfaceAERC20VariableCriteriaIncentive();
_getInterfaceAERC20VariableCriteriaIncentiveV2();
_saveJson();
}
function _buildJsonDeployPath()
internal
view
override
returns (string memory)
{
return
string(
abi.encodePacked(
vm.projectRoot(),
"/deploys/componentInterfaces.json"
)
);
}
function _saveJson() internal {
vm.writeJson(componentJson, _buildJsonDeployPath());
}
function _getInterfaceAManagedBudget() internal {
string memory interfaceId = uint256(
uint32(type(AManagedBudget).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AManagedBudget",
interfaceId
);
}
function _getInterfaceAManagedBudgetWithFees() internal {
string memory interfaceId = uint256(
uint32(type(AManagedBudgetWithFees).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AManagedBudgetWithFees",
interfaceId
);
}
function _getInterfaceAManagedBudgetWithFeesV2() internal {
string memory interfaceId = uint256(
uint32(type(AManagedBudgetWithFeesV2).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AManagedBudgetWithFeesV2",
interfaceId
);
}
function _getInterfaceAEventAction() internal {
string memory interfaceId = uint256(
uint32(type(AEventAction).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize("AEventAction", interfaceId);
}
function _getInterfaceAERC20Incentive() internal {
string memory interfaceId = uint256(
uint32(type(AERC20Incentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AERC20Incentive",
interfaceId
);
}
function _getInterfaceACloneable() internal {
string memory interfaceId = uint256(
uint32(type(ACloneable).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize("ACloneable", interfaceId);
}
function _getInterfaceABudget() internal {
string memory interfaceId = uint256(uint32(type(ABudget).interfaceId))
.toHexString(4);
componentJson = componentJsonKey.serialize("ABudget", interfaceId);
}
function _getInterfaceATransparentBudget() internal {
string memory interfaceId = uint256(
uint32(type(ATransparentBudget).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ATransparentBudget",
interfaceId
);
}
function _getInterfaceAVestingBudget() internal {
string memory interfaceId = uint256(
uint32(type(AVestingBudget).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AVestingBudget",
interfaceId
);
}
function _getInterfaceASignerValidator() internal {
string memory interfaceId = uint256(
uint32(type(ASignerValidator).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ASignerValidator",
interfaceId
);
}
function _getInterfaceALimitedSignerValidator() internal {
string memory interfaceId = uint256(
uint32(type(ALimitedSignerValidator).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ALimitedSignerValidator",
interfaceId
);
}
function _getInterfaceAAllowListIncentive() internal {
string memory interfaceId = uint256(
uint32(type(AAllowListIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AAllowListIncentive",
interfaceId
);
}
function _getInterfaceACGDAIncentive() internal {
string memory interfaceId = uint256(
uint32(type(ACGDAIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ACGDAIncentive",
interfaceId
);
}
function _getInterfaceAIncentive() internal {
string memory interfaceId = uint256(
uint32(type(AIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize("AIncentive", interfaceId);
}
function _getInterfaceAERC20PeggedIncentive() internal {
string memory interfaceId = uint256(
uint32(type(AERC20PeggedIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AERC20PeggedIncentive",
interfaceId
);
}
function _getInterfaceAERC20PeggedVariableCriteriaIncentiveV2() internal {
string memory interfaceId = uint256(
uint32(type(AERC20PeggedVariableCriteriaIncentiveV2).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AERC20PeggedVariableCriteriaIncentiveV2",
interfaceId
);
}
function _getInterfaceAERC20VariableIncentive() internal {
string memory interfaceId = uint256(
uint32(type(AERC20VariableIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AERC20VariableIncentive",
interfaceId
);
}
function _getInterfaceAERC20VariableCriteriaIncentiveV2() internal {
string memory interfaceId = uint256(
uint32(type(AERC20VariableCriteriaIncentiveV2).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"AERC20VariableCriteriaIncentiveV2",
interfaceId
);
}
function _getInterfaceAPointsIncentive() internal {
string memory interfaceId = uint256(
uint32(type(APointsIncentive).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"APointsIncentive",
interfaceId
);
}
function _getInterfaceASimpleAllowList() internal {
string memory interfaceId = uint256(
uint32(type(ASimpleAllowList).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ASimpleAllowList",
interfaceId
);
}
function _getInterfaceASimpleDenyList() internal {
string memory interfaceId = uint256(
uint32(type(ASimpleDenyList).interfaceId)
).toHexString(4);
componentJson = componentJsonKey.serialize(
"ASimpleDenyList",
interfaceId
);
}
}