@openzeppelin/confidential-contracts 0.2.0-rc.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/contracts/Checkpoints.json +2 -2
- package/build/contracts/CheckpointsConfidential.json +3 -9
- package/build/contracts/ConfidentialFungibleTokenUtils.json +2 -2
- package/build/contracts/ConfidentialFungibleTokenVotes.json +23 -0
- package/build/contracts/{TFHESafeMath.json → FHESafeMath.json} +4 -4
- package/build/contracts/HandleAccessManager.json +34 -0
- package/build/contracts/VestingWalletCliffConfidential.json +3 -3
- package/build/contracts/VestingWalletConfidential.json +3 -3
- package/build/contracts/VestingWalletConfidentialFactory.json +155 -0
- package/build/contracts/VotesConfidential.json +23 -0
- package/finance/ERC7821WithExecutor.sol +2 -2
- package/finance/VestingWalletCliffConfidential.sol +15 -4
- package/finance/VestingWalletConfidential.sol +28 -13
- package/finance/VestingWalletConfidentialFactory.sol +120 -0
- package/governance/utils/VotesConfidential.sol +18 -4
- package/interfaces/IConfidentialFungibleToken.sol +2 -2
- package/interfaces/IConfidentialFungibleTokenReceiver.sol +1 -1
- package/package.json +1 -1
- package/token/ConfidentialFungibleToken.sol +9 -12
- package/token/extensions/ConfidentialFungibleTokenERC20Wrapper.sol +19 -8
- package/token/extensions/ConfidentialFungibleTokenVotes.sol +9 -1
- package/token/utils/ConfidentialFungibleTokenUtils.sol +1 -1
- package/utils/{TFHESafeMath.sol → FHESafeMath.sol} +2 -2
- package/utils/HandleAccessManager.sol +29 -0
- package/utils/structs/CheckpointsConfidential.sol +1 -6
- package/utils/structs/temporary-Checkpoints.sol +1 -1
- package/build/contracts/VestingWalletCliffExecutorConfidential.json +0 -424
- package/build/contracts/VestingWalletCliffExecutorConfidentialFactory.json +0 -290
- package/finance/VestingWalletCliffExecutorConfidentialFactory.sol +0 -203
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "VestingWalletCliffExecutorConfidentialFactory",
|
|
4
|
-
"sourceName": "contracts/finance/VestingWalletCliffExecutorConfidentialFactory.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [],
|
|
8
|
-
"name": "FailedDeployment",
|
|
9
|
-
"type": "error"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"inputs": [
|
|
13
|
-
{
|
|
14
|
-
"internalType": "uint256",
|
|
15
|
-
"name": "balance",
|
|
16
|
-
"type": "uint256"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"internalType": "uint256",
|
|
20
|
-
"name": "needed",
|
|
21
|
-
"type": "uint256"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"name": "InsufficientBalance",
|
|
25
|
-
"type": "error"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"inputs": [
|
|
29
|
-
{
|
|
30
|
-
"internalType": "address",
|
|
31
|
-
"name": "owner",
|
|
32
|
-
"type": "address"
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"name": "OwnableInvalidOwner",
|
|
36
|
-
"type": "error"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"inputs": [
|
|
40
|
-
{
|
|
41
|
-
"internalType": "uint64",
|
|
42
|
-
"name": "cliffSeconds",
|
|
43
|
-
"type": "uint64"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"internalType": "uint64",
|
|
47
|
-
"name": "durationSeconds",
|
|
48
|
-
"type": "uint64"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"name": "VestingWalletCliffConfidentialInvalidCliffDuration",
|
|
52
|
-
"type": "error"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"anonymous": false,
|
|
56
|
-
"inputs": [
|
|
57
|
-
{
|
|
58
|
-
"indexed": true,
|
|
59
|
-
"internalType": "address",
|
|
60
|
-
"name": "vestingWalletConfidential",
|
|
61
|
-
"type": "address"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"indexed": true,
|
|
65
|
-
"internalType": "address",
|
|
66
|
-
"name": "beneficiary",
|
|
67
|
-
"type": "address"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"indexed": false,
|
|
71
|
-
"internalType": "uint48",
|
|
72
|
-
"name": "startTimestamp",
|
|
73
|
-
"type": "uint48"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"indexed": false,
|
|
77
|
-
"internalType": "uint48",
|
|
78
|
-
"name": "durationSeconds",
|
|
79
|
-
"type": "uint48"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"indexed": false,
|
|
83
|
-
"internalType": "uint48",
|
|
84
|
-
"name": "cliffSeconds",
|
|
85
|
-
"type": "uint48"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"indexed": true,
|
|
89
|
-
"internalType": "address",
|
|
90
|
-
"name": "executor",
|
|
91
|
-
"type": "address"
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
"name": "VestingWalletConfidentialCreated",
|
|
95
|
-
"type": "event"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"anonymous": false,
|
|
99
|
-
"inputs": [
|
|
100
|
-
{
|
|
101
|
-
"indexed": true,
|
|
102
|
-
"internalType": "address",
|
|
103
|
-
"name": "vestingWalletConfidential",
|
|
104
|
-
"type": "address"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"indexed": true,
|
|
108
|
-
"internalType": "address",
|
|
109
|
-
"name": "beneficiary",
|
|
110
|
-
"type": "address"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"indexed": true,
|
|
114
|
-
"internalType": "address",
|
|
115
|
-
"name": "confidentialFungibleToken",
|
|
116
|
-
"type": "address"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"indexed": false,
|
|
120
|
-
"internalType": "euint64",
|
|
121
|
-
"name": "encryptedAmount",
|
|
122
|
-
"type": "bytes32"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"indexed": false,
|
|
126
|
-
"internalType": "uint48",
|
|
127
|
-
"name": "startTimestamp",
|
|
128
|
-
"type": "uint48"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"indexed": false,
|
|
132
|
-
"internalType": "uint48",
|
|
133
|
-
"name": "durationSeconds",
|
|
134
|
-
"type": "uint48"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"indexed": false,
|
|
138
|
-
"internalType": "uint48",
|
|
139
|
-
"name": "cliffSeconds",
|
|
140
|
-
"type": "uint48"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"indexed": false,
|
|
144
|
-
"internalType": "address",
|
|
145
|
-
"name": "executor",
|
|
146
|
-
"type": "address"
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
"name": "VestingWalletConfidentialFunded",
|
|
150
|
-
"type": "event"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"inputs": [
|
|
154
|
-
{
|
|
155
|
-
"internalType": "address",
|
|
156
|
-
"name": "confidentialFungibleToken",
|
|
157
|
-
"type": "address"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"components": [
|
|
161
|
-
{
|
|
162
|
-
"internalType": "address",
|
|
163
|
-
"name": "beneficiary",
|
|
164
|
-
"type": "address"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"internalType": "externalEuint64",
|
|
168
|
-
"name": "encryptedAmount",
|
|
169
|
-
"type": "bytes32"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"internalType": "uint48",
|
|
173
|
-
"name": "startTimestamp",
|
|
174
|
-
"type": "uint48"
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"internalType": "uint48",
|
|
178
|
-
"name": "durationSeconds",
|
|
179
|
-
"type": "uint48"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"internalType": "uint48",
|
|
183
|
-
"name": "cliffSeconds",
|
|
184
|
-
"type": "uint48"
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
"internalType": "struct VestingWalletCliffExecutorConfidentialFactory.VestingPlan[]",
|
|
188
|
-
"name": "vestingPlans",
|
|
189
|
-
"type": "tuple[]"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"internalType": "address",
|
|
193
|
-
"name": "executor",
|
|
194
|
-
"type": "address"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"internalType": "bytes",
|
|
198
|
-
"name": "inputProof",
|
|
199
|
-
"type": "bytes"
|
|
200
|
-
}
|
|
201
|
-
],
|
|
202
|
-
"name": "batchFundVestingWalletConfidential",
|
|
203
|
-
"outputs": [],
|
|
204
|
-
"stateMutability": "nonpayable",
|
|
205
|
-
"type": "function"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"inputs": [
|
|
209
|
-
{
|
|
210
|
-
"internalType": "address",
|
|
211
|
-
"name": "beneficiary",
|
|
212
|
-
"type": "address"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"internalType": "uint48",
|
|
216
|
-
"name": "startTimestamp",
|
|
217
|
-
"type": "uint48"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"internalType": "uint48",
|
|
221
|
-
"name": "durationSeconds",
|
|
222
|
-
"type": "uint48"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"internalType": "uint48",
|
|
226
|
-
"name": "cliffSeconds",
|
|
227
|
-
"type": "uint48"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"internalType": "address",
|
|
231
|
-
"name": "executor",
|
|
232
|
-
"type": "address"
|
|
233
|
-
}
|
|
234
|
-
],
|
|
235
|
-
"name": "createVestingWalletConfidential",
|
|
236
|
-
"outputs": [
|
|
237
|
-
{
|
|
238
|
-
"internalType": "address",
|
|
239
|
-
"name": "",
|
|
240
|
-
"type": "address"
|
|
241
|
-
}
|
|
242
|
-
],
|
|
243
|
-
"stateMutability": "nonpayable",
|
|
244
|
-
"type": "function"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"inputs": [
|
|
248
|
-
{
|
|
249
|
-
"internalType": "address",
|
|
250
|
-
"name": "beneficiary",
|
|
251
|
-
"type": "address"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"internalType": "uint48",
|
|
255
|
-
"name": "startTimestamp",
|
|
256
|
-
"type": "uint48"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"internalType": "uint48",
|
|
260
|
-
"name": "durationSeconds",
|
|
261
|
-
"type": "uint48"
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
"internalType": "uint48",
|
|
265
|
-
"name": "cliffSeconds",
|
|
266
|
-
"type": "uint48"
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"internalType": "address",
|
|
270
|
-
"name": "executor",
|
|
271
|
-
"type": "address"
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
"name": "predictVestingWalletConfidential",
|
|
275
|
-
"outputs": [
|
|
276
|
-
{
|
|
277
|
-
"internalType": "address",
|
|
278
|
-
"name": "",
|
|
279
|
-
"type": "address"
|
|
280
|
-
}
|
|
281
|
-
],
|
|
282
|
-
"stateMutability": "view",
|
|
283
|
-
"type": "function"
|
|
284
|
-
}
|
|
285
|
-
],
|
|
286
|
-
"bytecode": "0x60a0604052604051600e906042565b604051809103905ff0801580156026573d5f5f3e3d5ffd5b506001600160a01b0316608052348015603d575f5ffd5b50604f565b611a9680610b0983390190565b608051610a9c61006d5f395f818160a0015261033b0152610a9c5ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c806314a5fd8314610043578063b4550a3814610072578063c61666db14610087575b5f5ffd5b6100566100513660046107d2565b61009a565b6040516001600160a01b03909116815260200160405180910390f35b610085610080366004610878565b6100db565b005b6100566100953660046107d2565b610334565b5f6100d17f00000000000000000000000000000000000000000000000000000000000000006100cc8888888888610454565b6104ce565b9695505050505050565b835f5b8181101561032a575f8787838181106100f9576100f961093a565b905060a0020180360381019061010f919061094e565b6060810151608082015191925065ffffffffffff808216908316111561015f576040516315956cd160e21b815265ffffffffffff9283166004820152911660248201526044015b60405180910390fd5b505080515f906001600160a01b031661019757604051631e4fbdf760e01b81526001600160a01b039091166004820152602401610156565b505f6101b5825f01518360400151846060015185608001518b61009a565b90505f5f6101fc846020015189898080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061053992505050565b9050610208818d610546565b5060405163eb3155b560e01b81523360048201526001600160a01b038481166024830152604482018390528d169063eb3155b5906064016020604051808303815f875af115801561025b573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061027f91906109e1565b9150508a6001600160a01b0316835f01516001600160a01b0316836001600160a01b03167f71711e1b968738dfe628b1cd84ad6a61f851fb28ce36f9c5c3731e797004fad5848760400151886060015189608001518f60405161031795949392919094855265ffffffffffff9384166020860152918316604085015290911660608301526001600160a01b0316608082015260a00190565b60405180910390a45050506001016100de565b5050505050505050565b5f5f61036c7f00000000000000000000000000000000000000000000000000000000000000006103678989898989610454565b610558565b604051630d5756af60e11b81526001600160a01b03898116600483015265ffffffffffff808a166024840152808916604484015287166064830152858116608483015291925090821690631aaead5e9060a4015f604051808303815f87803b1580156103d6575f5ffd5b505af11580156103e8573d5f5f3e3d5ffd5b50506040805165ffffffffffff8a81168252898116602083015288168183015290516001600160a01b03878116945085811693508b16917f9195f344285379ebeb1910bb6c9214f680b24c0a2fa4642e4e903eac944d351a919081900360600190a49695505050505050565b604080516bffffffffffffffffffffffff19606088811b821660208401526001600160d01b031960d089811b8216603486015288811b8216603a86015287901b16938301939093529183901b90911660468201525f90605a0160405160208183030381529060405280519060200120905095945050505050565b6040513060388201526f5af43d82803e903d91602b57fd5bf3ff602482015260148101839052733d602d80600a3d3981f3363d3d373d3d3d363d738152605881018290526037600c820120607882015260556043909101205f906001600160a01b03165b9392505050565b5f61053283836005610564565b5f6105518383610684565b5090919050565b5f61053283835f61070d565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163196d0b9b60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b039091169063196d0b9b906105dd9088903390899089906004016109f8565b6020604051808303815f875af11580156105f9573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061061d91906109e1565b8154604051630f8e573b60e21b8152600481018390523360248201529193506001600160a01b031690633e395cec906044015f604051808303815f87803b158015610666575f5ffd5b505af1158015610678573d5f5f3e3d5ffd5b50505050509392505050565b5f7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6008054604051630f8e573b60e21b8152600481018690526001600160a01b038581166024830152929350911690633e395cec906044015f604051808303815f87803b1580156106f2575f5ffd5b505af1158015610704573d5f5f3e3d5ffd5b50505050505050565b5f814710156107385760405163cf47918160e01b815247600482015260248101839052604401610156565b763d602d80600a3d3981f3363d3d373d3d3d363d730000008460601b60e81c175f526e5af43d82803e903d91602b57fd5bf38460781b17602052826037600984f590506001600160a01b0381166105325760405163b06ebf3d60e01b815260040160405180910390fd5b80356001600160a01b03811681146107b8575f5ffd5b919050565b803565ffffffffffff811681146107b8575f5ffd5b5f5f5f5f5f60a086880312156107e6575f5ffd5b6107ef866107a2565b94506107fd602087016107bd565b935061080b604087016107bd565b9250610819606087016107bd565b9150610827608087016107a2565b90509295509295909350565b5f5f83601f840112610843575f5ffd5b50813567ffffffffffffffff81111561085a575f5ffd5b602083019150836020828501011115610871575f5ffd5b9250929050565b5f5f5f5f5f5f6080878903121561088d575f5ffd5b610896876107a2565b9550602087013567ffffffffffffffff8111156108b1575f5ffd5b8701601f810189136108c1575f5ffd5b803567ffffffffffffffff8111156108d7575f5ffd5b89602060a0830284010111156108eb575f5ffd5b60209190910195509350610901604088016107a2565b9250606087013567ffffffffffffffff81111561091c575f5ffd5b61092889828a01610833565b979a9699509497509295939492505050565b634e487b7160e01b5f52603260045260245ffd5b5f60a082840312801561095f575f5ffd5b5060405160a0810167ffffffffffffffff8111828210171561098f57634e487b7160e01b5f52604160045260245ffd5b60405261099b836107a2565b8152602083810135908201526109b3604084016107bd565b60408201526109c4606084016107bd565b60608201526109d5608084016107bd565b60808201529392505050565b5f602082840312156109f1575f5ffd5b5051919050565b84815260018060a01b0384166020820152608060408201525f8351806080840152806020860160a085015e5f60a0828501015260a0601f19601f83011684010191505060548310610a5757634e487b7160e01b5f52602160045260245ffd5b8260608301529594505050505056fea26469706673582212206e6b5747d52e1d3270b8c12f482e950ae886e7d8f9e61e7c0a0331b9cb4f52cd64736f6c634300081d00336080604052348015600e575f5ffd5b5060156019565b60c9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161560685760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b039081161460c65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6119c0806100d65f395ff3fe6080604052600436106100e4575f3560e01c80639852595c11610087578063d03c791411610057578063d03c791414610290578063e9ae5c53146102bf578063efbe1c1c146102d2578063f2fde38b146102e6575f5ffd5b80639852595c14610202578063a3f8eace14610221578063be9a655514610240578063c34c08e514610254575f5ffd5b80631aaead5e116100c25780631aaead5e14610176578063715018a614610195578063810ec23b146101a95780638da5cb5b146101d6575f5ffd5b80630fb5a6b4146100e857806313d033c0146101195780631916558714610155575b5f5ffd5b3480156100f3575f5ffd5b506100fc610305565b6040516001600160401b0390911681526020015b60405180910390f35b348015610124575f5ffd5b507f3c715f77db997bdb68403fafb54820cd57dedce553ed6315028656b0d601c700546001600160401b03166100fc565b348015610160575f5ffd5b5061017461016f36600461160d565b61033a565b005b348015610181575f5ffd5b5061017461019036600461163b565b61048f565b3480156101a0575f5ffd5b5061017461059e565b3480156101b4575f5ffd5b506101c86101c336600461169c565b6105b1565b604051908152602001610110565b3480156101e1575f5ffd5b506101ea610647565b6040516001600160a01b039091168152602001610110565b34801561020d575f5ffd5b506101c861021c36600461160d565b610675565b34801561022c575f5ffd5b506101c861023b36600461160d565b6106ae565b34801561024b575f5ffd5b506100fc6106d2565b34801561025f575f5ffd5b507f246106ffca67a7d3806ba14f6748826b9c39c9fa594b14f83fe454e8e9d0dc00546001600160a01b03166101ea565b34801561029b575f5ffd5b506102af6102aa3660046116dc565b610700565b6040519015158152602001610110565b6101746102cd3660046116f3565b610757565b3480156102dd575f5ffd5b506100fc6107be565b3480156102f1575f5ffd5b5061017461030036600461160d565b6107de565b7f78ce9ee9eb65fa0cf5bf10e861c3a95cb7c3c713c96ab1e5323a21e84679680154600160401b90046001600160401b031690565b610342610818565b5f61034c826106ae565b90506103588183610885565b505f826001600160a01b0316635bebed7e610371610647565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af11580156103bb573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103df9190611768565b90505f6103f46103ee85610675565b83610897565b905061040781610402610647565b6108c5565b50610411816108d0565b50807f78ce9ee9eb65fa0cf5bf10e861c3a95cb7c3c713c96ab1e5323a21e8467968006001600160a01b0386165f81815260209283526040908190209390935591518481527f2b0c4ec6f49851e91126b16eb680925b819182e196af5660912b8845a868b66d910160405180910390a250505061048c6108df565b50565b5f610498610909565b805490915060ff600160401b82041615906001600160401b03165f811580156104be5750825b90505f826001600160401b031660011480156104d95750303b155b9050811580156104e7575080155b156105055760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561052f57845460ff60401b1916600160401b1785555b61053a8a8a8a610931565b61054387610995565b61054c86610a5a565b831561059257845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050505050565b6105a6610aa3565b6105af5f610ad5565b565b60405163344ff10160e01b81523060048201525f9061063e906106389061062a906001600160a01b0387169063344ff10190602401602060405180830381865afa158015610601573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106259190611768565b610b45565b61063386610675565b610b51565b83610b87565b90505b92915050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03165f9081527f78ce9ee9eb65fa0cf5bf10e861c3a95cb7c3c713c96ab1e5323a21e846796800602052604090205490565b5f6106416106cd6106bf84426105b1565b6106c885610675565b610be8565b610c1e565b7f78ce9ee9eb65fa0cf5bf10e861c3a95cb7c3c713c96ab1e5323a21e846796801546001600160401b031690565b5f5f5f5f61070d85610c2a565b50919450925090506001600160f81b03198316600160f81b14801561073a57506001600160f81b03198216155b801561074e57506001600160e01b03198116155b95945050505050565b61076333848484610c68565b61078757604051637cf8632b60e01b81523360048201526024015b60405180910390fd5b61079083610700565b6107ad57604051637f18127560e01b815260040160405180910390fd5b6107b882825f610cc5565b50505050565b5f6107c7610305565b6107cf6106d2565b6107d99190611793565b905090565b6107e6610aa3565b6001600160a01b03811661080f57604051631e4fbdf760e01b81525f600482015260240161077e565b61048c81610ad5565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005c1561085857604051633ee5aeb560e01b815260040160405180910390fd5b6105af60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005b90610df5565b5f6108908383610dfc565b5090919050565b5f826108a9576108a65f610e70565b92505b816108ba576108b75f610e70565b91505b61063e83835f610e85565b5f6108908383610f32565b5f6108db8230610f32565b5090565b6105af5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0061087f565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610641565b610939610f78565b61094283610f9d565b7f78ce9ee9eb65fa0cf5bf10e861c3a95cb7c3c713c96ab1e5323a21e846796801805465ffffffffffff9384166fffffffffffffffffffffffffffffffff199091161791909216600160401b0217905550565b61099d610f78565b6109a5610305565b6001600160401b03168165ffffffffffff161115816109c2610305565b90916109fa576040516315956cd160e21b815265ffffffffffff90921660048301526001600160401b0316602482015260440161077e565b50508065ffffffffffff16610a0d6106d2565b610a179190611793565b7f3c715f77db997bdb68403fafb54820cd57dedce553ed6315028656b0d601c700805467ffffffffffffffff19166001600160401b039290921691909117905550565b610a62610f78565b7f246106ffca67a7d3806ba14f6748826b9c39c9fa594b14f83fe454e8e9d0dc0080546001600160a01b0319166001600160a01b0392909216919091179055565b33610aac610647565b6001600160a01b0316146105af5760405163118cdaa760e01b815233600482015260240161077e565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f610641826006610fae565b5f82610b6357610b605f611045565b92505b81610b7457610b715f610e70565b91505b61063e83610b8184610b45565b5f610e85565b5f610bb97f3c715f77db997bdb68403fafb54820cd57dedce553ed6315028656b0d601c700546001600160401b031690565b6001600160401b0316826001600160401b031610610be057610bdb838361105a565b61063e565b505f92915050565b5f82610bfa57610bf75f611045565b92505b81610c0b57610c085f610e70565b91505b61063e83610c1884610b45565b5f6110ee565b5f610641826005610fae565b5f5f5f5f610c38855f611151565b610c43866001611151565b610c4e876006611189565b610c5988600a6111c1565b93509350935093509193509193565b5f610c9a7f246106ffca67a7d3806ba14f6748826b9c39c9fa594b14f83fe454e8e9d0dc00546001600160a01b031690565b6001600160a01b0316856001600160a01b0316148061074e5750306001600160a01b0386161461074e565b6060365f610cd386866111fc565b9092509050806001600160401b03811115610cf057610cf06117b2565b604051908082528060200260200182016040528015610d2357816020015b6060815260200190600190039081610d0e5790505b5092505f5b81811015610deb57610dc68186858585818110610d4757610d476117c6565b9050602002810190610d5991906117da565b610d6790602081019061160d565b868686818110610d7957610d796117c6565b9050602002810190610d8b91906117da565b60200135878787818110610da157610da16117c6565b9050602002810190610db391906117da565b610dc19060408101906117f8565b6112c1565b848281518110610dd857610dd86117c6565b6020908102919091010152600101610d28565b5050509392505050565b80825d5050565b5f51602061194b5f395f51905f528054604051630f8e573b60e21b8152600481018590526001600160a01b03848116602483015290911690633e395cec906044015b5f604051808303815f87803b158015610e55575f5ffd5b505af1158015610e67573d5f5f3e3d5ffd5b50505050505050565b5f610641826001600160401b03166005611353565b5f5f8215610e985750600160f81b610e9b565b505f5b5f51602061196b5f395f51905f525460405163022f65e760e31b81525f51602061194b5f395f51905f52916001600160a01b03169063117b2f3890610ee890899089908790600401611841565b6020604051808303815f875af1158015610f04573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f289190611768565b9695505050505050565b5f51602061194b5f395f51905f528054604051635ca4b5b160e11b8152600481018590526001600160a01b0384811660248301529091169063b9496b6290604401610e3e565b610f806113a2565b6105af57604051631afcd79f60e31b815260040160405180910390fd5b610fa5610f78565b61048c816113bb565b5f51602061196b5f395f51905f52546040516307227b9160e21b81525f915f51602061194b5f395f51905f52916001600160a01b0390911690631c89ee4490610ffd9087908790600401611881565b6020604051808303815f875af1158015611019573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061103d9190611768565b949350505050565b5f610641826001600160801b03166006611353565b5f6110636106d2565b6001600160401b0316826001600160401b0316101561108357505f610641565b61108b6107be565b6001600160401b0316826001600160401b0316106110aa575081610641565b6110e76110d1846110b96106d2565b6110c3908661189c565b6001600160401b03166113c3565b6110d9610305565b6001600160401b03166113ea565b9050610641565b5f5f82156111015750600160f81b611104565b505f5b5f51602061196b5f395f51905f52546040516303056db360e31b81525f51602061194b5f395f51905f52916001600160a01b03169063182b6d9890610ee890899089908790600401611841565b5f601f8260ff16111561117757604051631dd4bb1b60e11b815260040160405180910390fd5b506008021b6001600160f81b03191690565b5f601c8260ff1611156111af57604051631dd4bb1b60e11b815260040160405180910390fd5b506008021b6001600160e01b03191690565b5f600a8260ff1611156111e757604051631dd4bb1b60e11b815260040160405180910390fd5b506008021b69ffffffffffffffffffff191690565b365f8260208110156112215760405163eb0bcc5d60e01b815260040160405180910390fd5b5f61122f60208287896118bb565b611238916118e2565b9050601f19820181111561125f5760405163eb0bcc5d60e01b815260040160405180910390fd5b5f61126f6020830183888a6118bb565b611278916118e2565b90506001600160401b03811180611296575080602002602083850303105b156112b45760405163eb0bcc5d60e01b815260040160405180910390fd5b9501602001959350505050565b60605f806001600160a01b038716156112da57866112dc565b305b6001600160a01b03168686866040516112f69291906118ff565b5f6040518083038185875af1925050503d805f8114611330576040519150601f19603f3d011682016040523d82523d5f602084013e611335565b606091505b50915091506113468989848461140f565b9998505050505050505050565b5f51602061196b5f395f51905f5254604051639cd07acb60e01b81525f915f51602061194b5f395f51905f52916001600160a01b0390911690639cd07acb90610ffd9087908790600401611881565b5f6113ab610909565b54600160401b900460ff16919050565b6107e6610f78565b5f826113d5576113d25f611045565b92505b61063e836001600160801b03841660016114b6565b5f826113fc576113f95f611045565b92505b61063e836001600160801b038416611519565b60606001600160f81b031984166114305761142a83836115ae565b506114ae565b6001600160f81b03198416600160f81b036114895782611484577f2eea2f51f83910481f4b5ba28b7003a6e045d4b59f67dfff8d4c901194050089858360405161147b92919061190e565b60405180910390a15b6114ae565b6040516323a2408560e01b81526001600160f81b03198516600482015260240161077e565b509392505050565b5f5f82156114c95750600160f81b6114cc565b505f5b5f51602061196b5f395f51905f5254604051630afe14ad60e31b81525f51602061194b5f395f51905f52916001600160a01b0316906357f0a56890610ee890899089908790600401611841565b5f51602061196b5f395f51905f5254604051635a53accb60e01b81525f91600160f81b915f51602061194b5f395f51905f52916001600160a01b031690635a53accb9061156e90889088908790600401611841565b6020604051808303815f875af115801561158a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074e9190611768565b6060826115c3576115be826115ca565b610641565b5080610641565b8051156115d957805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b0381168114611608575f5ffd5b919050565b5f6020828403121561161d575f5ffd5b61063e826115f2565b803565ffffffffffff81168114611608575f5ffd5b5f5f5f5f5f60a0868803121561164f575f5ffd5b611658866115f2565b945061166660208701611626565b935061167460408701611626565b925061168260608701611626565b9150611690608087016115f2565b90509295509295909350565b5f5f604083850312156116ad575f5ffd5b6116b6836115f2565b915060208301356001600160401b03811681146116d1575f5ffd5b809150509250929050565b5f602082840312156116ec575f5ffd5b5035919050565b5f5f5f60408486031215611705575f5ffd5b8335925060208401356001600160401b03811115611721575f5ffd5b8401601f81018613611731575f5ffd5b80356001600160401b03811115611746575f5ffd5b866020828401011115611757575f5ffd5b939660209190910195509293505050565b5f60208284031215611778575f5ffd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b6001600160401b0381811683821601908111156106415761064161177f565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e198336030181126117ee575f5ffd5b9190910192915050565b5f5f8335601e1984360301811261180d575f5ffd5b8301803591506001600160401b03821115611826575f5ffd5b60200191503681900382131561183a575f5ffd5b9250929050565b92835260208301919091526001600160f81b031916604082015260600190565b6054811061187d57634e487b7160e01b5f52602160045260245ffd5b9052565b828152604081016118956020830184611861565b9392505050565b6001600160401b0382811682821603908111156106415761064161177f565b5f5f858511156118c9575f5ffd5b838611156118d5575f5ffd5b5050820193919092039150565b80356020831015610641575f19602084900360031b1b1692915050565b818382375f9101908152919050565b828152604060208201525f82518060408401528060208501606085015e5f606082850101526060601f19601f830116840101915050939250505056feed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600ed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea601a26469706673582212201f2e93da8f1a5ab45352a4349f38b1910f72f6a840e0b4ef01f718b329d40f0364736f6c634300081d0033",
|
|
287
|
-
"deployedBytecode": "0x608060405234801561000f575f5ffd5b506004361061003f575f3560e01c806314a5fd8314610043578063b4550a3814610072578063c61666db14610087575b5f5ffd5b6100566100513660046107d2565b61009a565b6040516001600160a01b03909116815260200160405180910390f35b610085610080366004610878565b6100db565b005b6100566100953660046107d2565b610334565b5f6100d17f00000000000000000000000000000000000000000000000000000000000000006100cc8888888888610454565b6104ce565b9695505050505050565b835f5b8181101561032a575f8787838181106100f9576100f961093a565b905060a0020180360381019061010f919061094e565b6060810151608082015191925065ffffffffffff808216908316111561015f576040516315956cd160e21b815265ffffffffffff9283166004820152911660248201526044015b60405180910390fd5b505080515f906001600160a01b031661019757604051631e4fbdf760e01b81526001600160a01b039091166004820152602401610156565b505f6101b5825f01518360400151846060015185608001518b61009a565b90505f5f6101fc846020015189898080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061053992505050565b9050610208818d610546565b5060405163eb3155b560e01b81523360048201526001600160a01b038481166024830152604482018390528d169063eb3155b5906064016020604051808303815f875af115801561025b573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061027f91906109e1565b9150508a6001600160a01b0316835f01516001600160a01b0316836001600160a01b03167f71711e1b968738dfe628b1cd84ad6a61f851fb28ce36f9c5c3731e797004fad5848760400151886060015189608001518f60405161031795949392919094855265ffffffffffff9384166020860152918316604085015290911660608301526001600160a01b0316608082015260a00190565b60405180910390a45050506001016100de565b5050505050505050565b5f5f61036c7f00000000000000000000000000000000000000000000000000000000000000006103678989898989610454565b610558565b604051630d5756af60e11b81526001600160a01b03898116600483015265ffffffffffff808a166024840152808916604484015287166064830152858116608483015291925090821690631aaead5e9060a4015f604051808303815f87803b1580156103d6575f5ffd5b505af11580156103e8573d5f5f3e3d5ffd5b50506040805165ffffffffffff8a81168252898116602083015288168183015290516001600160a01b03878116945085811693508b16917f9195f344285379ebeb1910bb6c9214f680b24c0a2fa4642e4e903eac944d351a919081900360600190a49695505050505050565b604080516bffffffffffffffffffffffff19606088811b821660208401526001600160d01b031960d089811b8216603486015288811b8216603a86015287901b16938301939093529183901b90911660468201525f90605a0160405160208183030381529060405280519060200120905095945050505050565b6040513060388201526f5af43d82803e903d91602b57fd5bf3ff602482015260148101839052733d602d80600a3d3981f3363d3d373d3d3d363d738152605881018290526037600c820120607882015260556043909101205f906001600160a01b03165b9392505050565b5f61053283836005610564565b5f6105518383610684565b5090919050565b5f61053283835f61070d565b7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6015460405163196d0b9b60e01b81525f917fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600916001600160a01b039091169063196d0b9b906105dd9088903390899089906004016109f8565b6020604051808303815f875af11580156105f9573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061061d91906109e1565b8154604051630f8e573b60e21b8152600481018390523360248201529193506001600160a01b031690633e395cec906044015f604051808303815f87803b158015610666575f5ffd5b505af1158015610678573d5f5f3e3d5ffd5b50505050509392505050565b5f7fed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea6008054604051630f8e573b60e21b8152600481018690526001600160a01b038581166024830152929350911690633e395cec906044015f604051808303815f87803b1580156106f2575f5ffd5b505af1158015610704573d5f5f3e3d5ffd5b50505050505050565b5f814710156107385760405163cf47918160e01b815247600482015260248101839052604401610156565b763d602d80600a3d3981f3363d3d373d3d3d363d730000008460601b60e81c175f526e5af43d82803e903d91602b57fd5bf38460781b17602052826037600984f590506001600160a01b0381166105325760405163b06ebf3d60e01b815260040160405180910390fd5b80356001600160a01b03811681146107b8575f5ffd5b919050565b803565ffffffffffff811681146107b8575f5ffd5b5f5f5f5f5f60a086880312156107e6575f5ffd5b6107ef866107a2565b94506107fd602087016107bd565b935061080b604087016107bd565b9250610819606087016107bd565b9150610827608087016107a2565b90509295509295909350565b5f5f83601f840112610843575f5ffd5b50813567ffffffffffffffff81111561085a575f5ffd5b602083019150836020828501011115610871575f5ffd5b9250929050565b5f5f5f5f5f5f6080878903121561088d575f5ffd5b610896876107a2565b9550602087013567ffffffffffffffff8111156108b1575f5ffd5b8701601f810189136108c1575f5ffd5b803567ffffffffffffffff8111156108d7575f5ffd5b89602060a0830284010111156108eb575f5ffd5b60209190910195509350610901604088016107a2565b9250606087013567ffffffffffffffff81111561091c575f5ffd5b61092889828a01610833565b979a9699509497509295939492505050565b634e487b7160e01b5f52603260045260245ffd5b5f60a082840312801561095f575f5ffd5b5060405160a0810167ffffffffffffffff8111828210171561098f57634e487b7160e01b5f52604160045260245ffd5b60405261099b836107a2565b8152602083810135908201526109b3604084016107bd565b60408201526109c4606084016107bd565b60608201526109d5608084016107bd565b60808201529392505050565b5f602082840312156109f1575f5ffd5b5051919050565b84815260018060a01b0384166020820152608060408201525f8351806080840152806020860160a085015e5f60a0828501015260a0601f19601f83011684010191505060548310610a5757634e487b7160e01b5f52602160045260245ffd5b8260608301529594505050505056fea26469706673582212206e6b5747d52e1d3270b8c12f482e950ae886e7d8f9e61e7c0a0331b9cb4f52cd64736f6c634300081d0033",
|
|
288
|
-
"linkReferences": {},
|
|
289
|
-
"deployedLinkReferences": {}
|
|
290
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Confidential Contracts (last updated v0.2.0-rc.1) (finance/VestingWalletCliffExecutorConfidentialFactory.sol)
|
|
3
|
-
pragma solidity ^0.8.27;
|
|
4
|
-
|
|
5
|
-
import {FHE, euint64, externalEuint64, euint128} from "@fhevm/solidity/lib/FHE.sol";
|
|
6
|
-
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
7
|
-
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
|
8
|
-
import {IConfidentialFungibleToken} from "./../interfaces/IConfidentialFungibleToken.sol";
|
|
9
|
-
import {ERC7821WithExecutor} from "./ERC7821WithExecutor.sol";
|
|
10
|
-
import {VestingWalletCliffConfidential} from "./VestingWalletCliffConfidential.sol";
|
|
11
|
-
import {VestingWalletConfidential} from "./VestingWalletConfidential.sol";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @dev This factory enables creating {VestingWalletCliffExecutorConfidential} in batch.
|
|
15
|
-
*
|
|
16
|
-
* Confidential vesting wallets created inherit both {VestingWalletCliffConfidential} for vesting cliffs
|
|
17
|
-
* and {ERC7821WithExecutor} to allow for arbitrary calls to be executed from the vesting wallet.
|
|
18
|
-
*/
|
|
19
|
-
contract VestingWalletCliffExecutorConfidentialFactory {
|
|
20
|
-
struct VestingPlan {
|
|
21
|
-
address beneficiary;
|
|
22
|
-
externalEuint64 encryptedAmount;
|
|
23
|
-
uint48 startTimestamp;
|
|
24
|
-
uint48 durationSeconds;
|
|
25
|
-
uint48 cliffSeconds;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
address private immutable _vestingImplementation = address(new VestingWalletCliffExecutorConfidential());
|
|
29
|
-
|
|
30
|
-
event VestingWalletConfidentialFunded(
|
|
31
|
-
address indexed vestingWalletConfidential,
|
|
32
|
-
address indexed beneficiary,
|
|
33
|
-
address indexed confidentialFungibleToken,
|
|
34
|
-
euint64 encryptedAmount,
|
|
35
|
-
uint48 startTimestamp,
|
|
36
|
-
uint48 durationSeconds,
|
|
37
|
-
uint48 cliffSeconds,
|
|
38
|
-
address executor
|
|
39
|
-
);
|
|
40
|
-
event VestingWalletConfidentialCreated(
|
|
41
|
-
address indexed vestingWalletConfidential,
|
|
42
|
-
address indexed beneficiary,
|
|
43
|
-
uint48 startTimestamp,
|
|
44
|
-
uint48 durationSeconds,
|
|
45
|
-
uint48 cliffSeconds,
|
|
46
|
-
address indexed executor
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @dev Batches the funding of multiple confidential vesting wallets.
|
|
51
|
-
*
|
|
52
|
-
* Funds are sent to deterministic wallet addresses. Wallets can be created either
|
|
53
|
-
* before or after this operation.
|
|
54
|
-
*
|
|
55
|
-
* Emits a {VestingWalletConfidentialFunded} event for each funded vesting plan.
|
|
56
|
-
*/
|
|
57
|
-
function batchFundVestingWalletConfidential(
|
|
58
|
-
address confidentialFungibleToken,
|
|
59
|
-
VestingPlan[] calldata vestingPlans,
|
|
60
|
-
address executor,
|
|
61
|
-
bytes calldata inputProof
|
|
62
|
-
) public virtual {
|
|
63
|
-
uint256 vestingPlansLength = vestingPlans.length;
|
|
64
|
-
for (uint256 i = 0; i < vestingPlansLength; i++) {
|
|
65
|
-
VestingPlan memory vestingPlan = vestingPlans[i];
|
|
66
|
-
require(
|
|
67
|
-
vestingPlan.cliffSeconds <= vestingPlan.durationSeconds,
|
|
68
|
-
VestingWalletCliffConfidential.VestingWalletCliffConfidentialInvalidCliffDuration(
|
|
69
|
-
vestingPlan.cliffSeconds,
|
|
70
|
-
vestingPlan.durationSeconds
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
require(vestingPlan.beneficiary != address(0), OwnableUpgradeable.OwnableInvalidOwner(address(0)));
|
|
75
|
-
address vestingWalletAddress = predictVestingWalletConfidential(
|
|
76
|
-
vestingPlan.beneficiary,
|
|
77
|
-
vestingPlan.startTimestamp,
|
|
78
|
-
vestingPlan.durationSeconds,
|
|
79
|
-
vestingPlan.cliffSeconds,
|
|
80
|
-
executor
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
euint64 transferredAmount;
|
|
84
|
-
{
|
|
85
|
-
// avoiding stack too deep with scope
|
|
86
|
-
euint64 encryptedAmount = FHE.fromExternal(vestingPlan.encryptedAmount, inputProof);
|
|
87
|
-
FHE.allowTransient(encryptedAmount, confidentialFungibleToken);
|
|
88
|
-
transferredAmount = IConfidentialFungibleToken(confidentialFungibleToken).confidentialTransferFrom(
|
|
89
|
-
msg.sender,
|
|
90
|
-
vestingWalletAddress,
|
|
91
|
-
encryptedAmount
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
emit VestingWalletConfidentialFunded(
|
|
96
|
-
vestingWalletAddress,
|
|
97
|
-
vestingPlan.beneficiary,
|
|
98
|
-
confidentialFungibleToken,
|
|
99
|
-
transferredAmount,
|
|
100
|
-
vestingPlan.startTimestamp,
|
|
101
|
-
vestingPlan.durationSeconds,
|
|
102
|
-
vestingPlan.cliffSeconds,
|
|
103
|
-
executor
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @dev Creates a confidential vesting wallet.
|
|
110
|
-
*
|
|
111
|
-
* Emits a {VestingWalletConfidentialCreated}.
|
|
112
|
-
*/
|
|
113
|
-
function createVestingWalletConfidential(
|
|
114
|
-
address beneficiary,
|
|
115
|
-
uint48 startTimestamp,
|
|
116
|
-
uint48 durationSeconds,
|
|
117
|
-
uint48 cliffSeconds,
|
|
118
|
-
address executor
|
|
119
|
-
) public virtual returns (address) {
|
|
120
|
-
// Will revert if clone already created
|
|
121
|
-
address vestingWalletConfidentialAddress = Clones.cloneDeterministic(
|
|
122
|
-
_vestingImplementation,
|
|
123
|
-
_getCreate2VestingWalletConfidentialSalt(
|
|
124
|
-
beneficiary,
|
|
125
|
-
startTimestamp,
|
|
126
|
-
durationSeconds,
|
|
127
|
-
cliffSeconds,
|
|
128
|
-
executor
|
|
129
|
-
)
|
|
130
|
-
);
|
|
131
|
-
VestingWalletCliffExecutorConfidential(vestingWalletConfidentialAddress).initialize(
|
|
132
|
-
beneficiary,
|
|
133
|
-
startTimestamp,
|
|
134
|
-
durationSeconds,
|
|
135
|
-
cliffSeconds,
|
|
136
|
-
executor
|
|
137
|
-
);
|
|
138
|
-
emit VestingWalletConfidentialCreated(
|
|
139
|
-
beneficiary,
|
|
140
|
-
vestingWalletConfidentialAddress,
|
|
141
|
-
startTimestamp,
|
|
142
|
-
durationSeconds,
|
|
143
|
-
cliffSeconds,
|
|
144
|
-
executor
|
|
145
|
-
);
|
|
146
|
-
return vestingWalletConfidentialAddress;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* @dev Predicts deterministic address for a confidential vesting wallet.
|
|
151
|
-
*/
|
|
152
|
-
function predictVestingWalletConfidential(
|
|
153
|
-
address beneficiary,
|
|
154
|
-
uint48 startTimestamp,
|
|
155
|
-
uint48 durationSeconds,
|
|
156
|
-
uint48 cliffSeconds,
|
|
157
|
-
address executor
|
|
158
|
-
) public view virtual returns (address) {
|
|
159
|
-
return
|
|
160
|
-
Clones.predictDeterministicAddress(
|
|
161
|
-
_vestingImplementation,
|
|
162
|
-
_getCreate2VestingWalletConfidentialSalt(
|
|
163
|
-
beneficiary,
|
|
164
|
-
startTimestamp,
|
|
165
|
-
durationSeconds,
|
|
166
|
-
cliffSeconds,
|
|
167
|
-
executor
|
|
168
|
-
)
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @dev Gets create2 salt for a confidential vesting wallet.
|
|
174
|
-
*/
|
|
175
|
-
function _getCreate2VestingWalletConfidentialSalt(
|
|
176
|
-
address beneficiary,
|
|
177
|
-
uint48 startTimestamp,
|
|
178
|
-
uint48 durationSeconds,
|
|
179
|
-
uint48 cliffSeconds,
|
|
180
|
-
address executor
|
|
181
|
-
) internal pure virtual returns (bytes32) {
|
|
182
|
-
return keccak256(abi.encodePacked(beneficiary, startTimestamp, durationSeconds, cliffSeconds, executor));
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// slither-disable-next-line locked-ether
|
|
187
|
-
contract VestingWalletCliffExecutorConfidential is VestingWalletCliffConfidential, ERC7821WithExecutor {
|
|
188
|
-
constructor() {
|
|
189
|
-
_disableInitializers();
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function initialize(
|
|
193
|
-
address beneficiary,
|
|
194
|
-
uint48 startTimestamp,
|
|
195
|
-
uint48 durationSeconds,
|
|
196
|
-
uint48 cliffSeconds,
|
|
197
|
-
address executor
|
|
198
|
-
) public initializer {
|
|
199
|
-
__VestingWalletConfidential_init(beneficiary, startTimestamp, durationSeconds);
|
|
200
|
-
__VestingWalletCliffConfidential_init(cliffSeconds);
|
|
201
|
-
__ERC7821WithExecutor_init(executor);
|
|
202
|
-
}
|
|
203
|
-
}
|