@bananapus/suckers-v6 0.0.47 → 0.0.49
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/package.json +3 -3
- package/script/Deploy.s.sol +125 -139
- package/script/helpers/SuckerDeploymentLib.sol +10 -12
- package/src/JBArbitrumSucker.sol +5 -2
- package/src/JBCCIPSucker.sol +3 -3
- package/src/JBCeloSucker.sol +2 -0
- package/src/JBOptimismSucker.sol +2 -0
- package/src/JBSucker.sol +42 -8
- package/src/JBSuckerRegistry.sol +79 -60
- package/src/JBSwapCCIPSucker.sol +38 -101
- package/src/deployers/JBSwapCCIPSuckerDeployer.sol +17 -17
- package/src/interfaces/IJBSucker.sol +11 -6
- package/src/interfaces/IJBSuckerRegistry.sol +6 -3
- package/src/interfaces/IL1ArbitrumGateway.sol +10 -10
- package/src/libraries/CCIPHelper.sol +64 -64
- package/src/libraries/JBCCIPLib.sol +18 -0
- package/src/libraries/JBRelayBeneficiary.sol +1 -1
- package/src/libraries/JBSuckerLib.sol +157 -161
- package/src/libraries/JBSwapPoolLib.sol +268 -268
- package/src/structs/PeerValueScratch.sol +18 -0
- package/src/utils/MerkleLib.sol +108 -108
package/script/Deploy.s.sol
CHANGED
|
@@ -32,38 +32,23 @@ import {CCIPHelper} from "../src/libraries/CCIPHelper.sol";
|
|
|
32
32
|
contract DeployScript is Script, Sphinx {
|
|
33
33
|
/// @notice tracks the deployment of the core contracts for the chain we are deploying to.
|
|
34
34
|
CoreDeployment core;
|
|
35
|
-
/// @notice
|
|
36
|
-
|
|
37
|
-
address
|
|
38
|
-
|
|
39
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
40
|
-
address TRUSTED_FORWARDER;
|
|
35
|
+
/// @notice Tracks the addresses of deployers that will get pre-approved.
|
|
36
|
+
address[] private preApprovedDeployers;
|
|
37
|
+
address private trustedForwarder;
|
|
41
38
|
|
|
42
39
|
/// @notice the nonces that are used to deploy the contracts.
|
|
43
|
-
|
|
44
|
-
bytes32
|
|
45
|
-
|
|
46
|
-
bytes32
|
|
47
|
-
|
|
48
|
-
bytes32
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
bytes32
|
|
52
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
53
|
-
bytes32 ARB_OP_SALT = "_SUCKER_ARB_OP_V6_";
|
|
54
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
55
|
-
bytes32 OP_BASE_SALT = "_SUCKER_OP_BASE_V6_";
|
|
56
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
57
|
-
bytes32 TEMPO_SALT = "_SUCKER_ETH_TEMPO_V6_";
|
|
58
|
-
|
|
59
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
60
|
-
IJBSuckerRegistry REGISTRY;
|
|
61
|
-
|
|
62
|
-
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
|
-
bytes32 REGISTRY_SALT = "REGISTRYV6";
|
|
40
|
+
bytes32 private constant _OP_SALT = "_SUCKER_ETH_OP_V6_";
|
|
41
|
+
bytes32 private constant _BASE_SALT = "_SUCKER_ETH_BASE_V6_";
|
|
42
|
+
bytes32 private constant _ARB_SALT = "_SUCKER_ETH_ARB_V6_";
|
|
43
|
+
bytes32 private constant _ARB_BASE_SALT = "_SUCKER_ARB_BASE_V6_";
|
|
44
|
+
bytes32 private constant _ARB_OP_SALT = "_SUCKER_ARB_OP_V6_";
|
|
45
|
+
bytes32 private constant _OP_BASE_SALT = "_SUCKER_OP_BASE_V6_";
|
|
46
|
+
bytes32 private constant _TEMPO_SALT = "_SUCKER_ETH_TEMPO_V6_";
|
|
47
|
+
IJBSuckerRegistry private registry;
|
|
48
|
+
bytes32 private constant _REGISTRY_SALT = "REGISTRYV6";
|
|
64
49
|
|
|
65
50
|
function configureSphinx() public override {
|
|
66
|
-
//
|
|
51
|
+
// Safe owners and threshold are resolved by the Sphinx project config.
|
|
67
52
|
sphinxConfig.projectName = "nana-suckers-v6";
|
|
68
53
|
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum", "tempo"];
|
|
69
54
|
sphinxConfig.testnets =
|
|
@@ -78,7 +63,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
78
63
|
);
|
|
79
64
|
|
|
80
65
|
// We use the same trusted forwarder as the core deployment.
|
|
81
|
-
|
|
66
|
+
trustedForwarder = core.permissions.trustedForwarder();
|
|
82
67
|
|
|
83
68
|
// Perform the deployment transactions.
|
|
84
69
|
deploy();
|
|
@@ -97,31 +82,31 @@ contract DeployScript is Script, Sphinx {
|
|
|
97
82
|
// If the registry is already deployed we don't have to deploy it
|
|
98
83
|
// (and we can't add more pre_approved deployers etc.)
|
|
99
84
|
bool registryAlreadyDeployed = _isDeployed({
|
|
100
|
-
salt:
|
|
85
|
+
salt: _REGISTRY_SALT,
|
|
101
86
|
creationCode: type(JBSuckerRegistry).creationCode,
|
|
102
|
-
arguments: abi.encode(core.directory, core.permissions, safeAddress(),
|
|
87
|
+
arguments: abi.encode(core.directory, core.permissions, safeAddress(), trustedForwarder)
|
|
103
88
|
});
|
|
104
89
|
|
|
105
90
|
if (!registryAlreadyDeployed) {
|
|
106
|
-
|
|
91
|
+
registry = IJBSuckerRegistry(
|
|
107
92
|
address(
|
|
108
|
-
new JBSuckerRegistry{salt:
|
|
93
|
+
new JBSuckerRegistry{salt: _REGISTRY_SALT}({
|
|
109
94
|
directory: core.directory,
|
|
110
95
|
permissions: core.permissions,
|
|
111
96
|
initialOwner: safeAddress(),
|
|
112
|
-
trustedForwarder:
|
|
97
|
+
trustedForwarder: trustedForwarder
|
|
113
98
|
})
|
|
114
99
|
)
|
|
115
100
|
);
|
|
116
101
|
} else {
|
|
117
102
|
// Compute the existing registry address.
|
|
118
|
-
|
|
103
|
+
registry = IJBSuckerRegistry(
|
|
119
104
|
vm.computeCreate2Address({
|
|
120
|
-
salt:
|
|
105
|
+
salt: _REGISTRY_SALT,
|
|
121
106
|
initCodeHash: keccak256(
|
|
122
107
|
abi.encodePacked(
|
|
123
108
|
type(JBSuckerRegistry).creationCode,
|
|
124
|
-
abi.encode(core.directory, core.permissions, safeAddress(),
|
|
109
|
+
abi.encode(core.directory, core.permissions, safeAddress(), trustedForwarder)
|
|
125
110
|
)
|
|
126
111
|
),
|
|
127
112
|
deployer: address(0x4e59b44847b379578588920cA78FbF26c0B4956C)
|
|
@@ -137,8 +122,8 @@ contract DeployScript is Script, Sphinx {
|
|
|
137
122
|
|
|
138
123
|
// Synchronize any deployers discovered or resumed during this run into the registry as long as the
|
|
139
124
|
// current safe still controls it. This keeps partial-deployment recovery idempotent.
|
|
140
|
-
if (
|
|
141
|
-
|
|
125
|
+
if (preApprovedDeployers.length != 0 && Ownable(address(registry)).owner() == safeAddress()) {
|
|
126
|
+
registry.allowSuckerDeployers(preApprovedDeployers);
|
|
142
127
|
}
|
|
143
128
|
|
|
144
129
|
if (!registryAlreadyDeployed) {
|
|
@@ -150,7 +135,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
150
135
|
address feeProjectOwner = core.projects.ownerOf(1);
|
|
151
136
|
if (feeProjectOwner != address(0) && feeProjectOwner != safeAddress()) {
|
|
152
137
|
// Transfer ownership to JBDAO.
|
|
153
|
-
Ownable(address(
|
|
138
|
+
Ownable(address(registry)).transferOwnership(feeProjectOwner);
|
|
154
139
|
}
|
|
155
140
|
}
|
|
156
141
|
}
|
|
@@ -160,21 +145,21 @@ contract DeployScript is Script, Sphinx {
|
|
|
160
145
|
function _optimismSucker() internal {
|
|
161
146
|
// Check if the deployer already exists at the CREATE2 address.
|
|
162
147
|
bool alreadyDeployed = _isDeployed({
|
|
163
|
-
salt:
|
|
148
|
+
salt: _OP_SALT,
|
|
164
149
|
creationCode: type(JBOptimismSuckerDeployer).creationCode,
|
|
165
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
150
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
166
151
|
});
|
|
167
152
|
|
|
168
153
|
// If already deployed, verify the full pipeline completed (singleton + registry allowlisting).
|
|
169
154
|
// Only skip if everything is fully configured; otherwise fall through to resume.
|
|
170
155
|
if (alreadyDeployed) {
|
|
171
156
|
address deployerAddr = _computeAddress({
|
|
172
|
-
salt:
|
|
157
|
+
salt: _OP_SALT,
|
|
173
158
|
creationCode: type(JBOptimismSuckerDeployer).creationCode,
|
|
174
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
159
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
175
160
|
});
|
|
176
161
|
bool singletonSet = address(JBOptimismSuckerDeployer(deployerAddr).singleton()) != address(0);
|
|
177
|
-
bool registryAllowed =
|
|
162
|
+
bool registryAllowed = registry.suckerDeployerIsAllowed(deployerAddr);
|
|
178
163
|
if (singletonSet && registryAllowed) return;
|
|
179
164
|
}
|
|
180
165
|
|
|
@@ -187,20 +172,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
187
172
|
// Resume from a partial deployment — deployer exists, recompute its address.
|
|
188
173
|
_opDeployer = JBOptimismSuckerDeployer(
|
|
189
174
|
_computeAddress({
|
|
190
|
-
salt:
|
|
175
|
+
salt: _OP_SALT,
|
|
191
176
|
creationCode: type(JBOptimismSuckerDeployer).creationCode,
|
|
192
177
|
arguments: abi.encode(
|
|
193
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
178
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
194
179
|
)
|
|
195
180
|
})
|
|
196
181
|
);
|
|
197
182
|
} else {
|
|
198
|
-
_opDeployer = new JBOptimismSuckerDeployer{salt:
|
|
183
|
+
_opDeployer = new JBOptimismSuckerDeployer{salt: _OP_SALT}({
|
|
199
184
|
directory: core.directory,
|
|
200
185
|
permissions: core.permissions,
|
|
201
186
|
tokens: core.tokens,
|
|
202
187
|
configurator: safeAddress(),
|
|
203
|
-
trustedForwarder:
|
|
188
|
+
trustedForwarder: trustedForwarder
|
|
204
189
|
});
|
|
205
190
|
}
|
|
206
191
|
|
|
@@ -221,22 +206,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
221
206
|
|
|
222
207
|
if (address(_opDeployer.singleton()) == address(0)) {
|
|
223
208
|
// Deploy the singleton instance.
|
|
224
|
-
JBOptimismSucker _singleton = new JBOptimismSucker{salt:
|
|
209
|
+
JBOptimismSucker _singleton = new JBOptimismSucker{salt: _OP_SALT}({
|
|
225
210
|
deployer: _opDeployer,
|
|
226
211
|
directory: core.directory,
|
|
227
212
|
permissions: core.permissions,
|
|
228
213
|
prices: core.prices,
|
|
229
214
|
tokens: core.tokens,
|
|
230
215
|
feeProjectId: 1,
|
|
231
|
-
registry:
|
|
232
|
-
trustedForwarder:
|
|
216
|
+
registry: registry,
|
|
217
|
+
trustedForwarder: trustedForwarder
|
|
233
218
|
});
|
|
234
219
|
|
|
235
220
|
// Configure the deployer to use the singleton instance.
|
|
236
221
|
_opDeployer.configureSingleton(_singleton);
|
|
237
222
|
}
|
|
238
223
|
|
|
239
|
-
|
|
224
|
+
preApprovedDeployers.push(address(_opDeployer));
|
|
240
225
|
}
|
|
241
226
|
|
|
242
227
|
// Check if we should do the L2 portion.
|
|
@@ -247,20 +232,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
247
232
|
if (alreadyDeployed) {
|
|
248
233
|
_opDeployer = JBOptimismSuckerDeployer(
|
|
249
234
|
_computeAddress({
|
|
250
|
-
salt:
|
|
235
|
+
salt: _OP_SALT,
|
|
251
236
|
creationCode: type(JBOptimismSuckerDeployer).creationCode,
|
|
252
237
|
arguments: abi.encode(
|
|
253
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
238
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
254
239
|
)
|
|
255
240
|
})
|
|
256
241
|
);
|
|
257
242
|
} else {
|
|
258
|
-
_opDeployer = new JBOptimismSuckerDeployer{salt:
|
|
243
|
+
_opDeployer = new JBOptimismSuckerDeployer{salt: _OP_SALT}({
|
|
259
244
|
directory: core.directory,
|
|
260
245
|
permissions: core.permissions,
|
|
261
246
|
tokens: core.tokens,
|
|
262
247
|
configurator: safeAddress(),
|
|
263
|
-
trustedForwarder:
|
|
248
|
+
trustedForwarder: trustedForwarder
|
|
264
249
|
});
|
|
265
250
|
}
|
|
266
251
|
|
|
@@ -273,22 +258,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
273
258
|
|
|
274
259
|
if (address(_opDeployer.singleton()) == address(0)) {
|
|
275
260
|
// Deploy the singleton instance.
|
|
276
|
-
JBOptimismSucker _singleton = new JBOptimismSucker{salt:
|
|
261
|
+
JBOptimismSucker _singleton = new JBOptimismSucker{salt: _OP_SALT}({
|
|
277
262
|
deployer: _opDeployer,
|
|
278
263
|
directory: core.directory,
|
|
279
264
|
permissions: core.permissions,
|
|
280
265
|
prices: core.prices,
|
|
281
266
|
tokens: core.tokens,
|
|
282
267
|
feeProjectId: 1,
|
|
283
|
-
registry:
|
|
284
|
-
trustedForwarder:
|
|
268
|
+
registry: registry,
|
|
269
|
+
trustedForwarder: trustedForwarder
|
|
285
270
|
});
|
|
286
271
|
|
|
287
272
|
// Configure the deployer to use the singleton instance.
|
|
288
273
|
_opDeployer.configureSingleton(_singleton);
|
|
289
274
|
}
|
|
290
275
|
|
|
291
|
-
|
|
276
|
+
preApprovedDeployers.push(address(_opDeployer));
|
|
292
277
|
}
|
|
293
278
|
}
|
|
294
279
|
|
|
@@ -296,21 +281,21 @@ contract DeployScript is Script, Sphinx {
|
|
|
296
281
|
function _baseSucker() internal {
|
|
297
282
|
// Check if the deployer already exists at the CREATE2 address.
|
|
298
283
|
bool alreadyDeployed = _isDeployed({
|
|
299
|
-
salt:
|
|
284
|
+
salt: _BASE_SALT,
|
|
300
285
|
creationCode: type(JBBaseSuckerDeployer).creationCode,
|
|
301
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
286
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
302
287
|
});
|
|
303
288
|
|
|
304
289
|
// If already deployed, verify the full pipeline completed (singleton + registry allowlisting).
|
|
305
290
|
// Only skip if everything is fully configured; otherwise fall through to resume.
|
|
306
291
|
if (alreadyDeployed) {
|
|
307
292
|
address deployerAddr = _computeAddress({
|
|
308
|
-
salt:
|
|
293
|
+
salt: _BASE_SALT,
|
|
309
294
|
creationCode: type(JBBaseSuckerDeployer).creationCode,
|
|
310
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
295
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
311
296
|
});
|
|
312
297
|
bool singletonSet = address(JBBaseSuckerDeployer(deployerAddr).singleton()) != address(0);
|
|
313
|
-
bool registryAllowed =
|
|
298
|
+
bool registryAllowed = registry.suckerDeployerIsAllowed(deployerAddr);
|
|
314
299
|
if (singletonSet && registryAllowed) return;
|
|
315
300
|
}
|
|
316
301
|
|
|
@@ -322,20 +307,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
322
307
|
if (alreadyDeployed) {
|
|
323
308
|
_baseDeployer = JBBaseSuckerDeployer(
|
|
324
309
|
_computeAddress({
|
|
325
|
-
salt:
|
|
310
|
+
salt: _BASE_SALT,
|
|
326
311
|
creationCode: type(JBBaseSuckerDeployer).creationCode,
|
|
327
312
|
arguments: abi.encode(
|
|
328
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
313
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
329
314
|
)
|
|
330
315
|
})
|
|
331
316
|
);
|
|
332
317
|
} else {
|
|
333
|
-
_baseDeployer = new JBBaseSuckerDeployer{salt:
|
|
318
|
+
_baseDeployer = new JBBaseSuckerDeployer{salt: _BASE_SALT}({
|
|
334
319
|
directory: core.directory,
|
|
335
320
|
permissions: core.permissions,
|
|
336
321
|
tokens: core.tokens,
|
|
337
322
|
configurator: safeAddress(),
|
|
338
|
-
trustedForwarder:
|
|
323
|
+
trustedForwarder: trustedForwarder
|
|
339
324
|
});
|
|
340
325
|
}
|
|
341
326
|
|
|
@@ -356,22 +341,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
356
341
|
|
|
357
342
|
if (address(_baseDeployer.singleton()) == address(0)) {
|
|
358
343
|
// Deploy the singleton instance.
|
|
359
|
-
JBBaseSucker _singleton = new JBBaseSucker{salt:
|
|
344
|
+
JBBaseSucker _singleton = new JBBaseSucker{salt: _BASE_SALT}({
|
|
360
345
|
deployer: _baseDeployer,
|
|
361
346
|
directory: core.directory,
|
|
362
347
|
permissions: core.permissions,
|
|
363
348
|
prices: core.prices,
|
|
364
349
|
tokens: core.tokens,
|
|
365
350
|
feeProjectId: 1,
|
|
366
|
-
registry:
|
|
367
|
-
trustedForwarder:
|
|
351
|
+
registry: registry,
|
|
352
|
+
trustedForwarder: trustedForwarder
|
|
368
353
|
});
|
|
369
354
|
|
|
370
355
|
// Configure the deployer to use the singleton instance.
|
|
371
356
|
_baseDeployer.configureSingleton(_singleton);
|
|
372
357
|
}
|
|
373
358
|
|
|
374
|
-
|
|
359
|
+
preApprovedDeployers.push(address(_baseDeployer));
|
|
375
360
|
}
|
|
376
361
|
|
|
377
362
|
// Check if we should do the L2 portion.
|
|
@@ -382,20 +367,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
382
367
|
if (alreadyDeployed) {
|
|
383
368
|
_baseDeployer = JBBaseSuckerDeployer(
|
|
384
369
|
_computeAddress({
|
|
385
|
-
salt:
|
|
370
|
+
salt: _BASE_SALT,
|
|
386
371
|
creationCode: type(JBBaseSuckerDeployer).creationCode,
|
|
387
372
|
arguments: abi.encode(
|
|
388
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
373
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
389
374
|
)
|
|
390
375
|
})
|
|
391
376
|
);
|
|
392
377
|
} else {
|
|
393
|
-
_baseDeployer = new JBBaseSuckerDeployer{salt:
|
|
378
|
+
_baseDeployer = new JBBaseSuckerDeployer{salt: _BASE_SALT}({
|
|
394
379
|
directory: core.directory,
|
|
395
380
|
permissions: core.permissions,
|
|
396
381
|
tokens: core.tokens,
|
|
397
382
|
configurator: safeAddress(),
|
|
398
|
-
trustedForwarder:
|
|
383
|
+
trustedForwarder: trustedForwarder
|
|
399
384
|
});
|
|
400
385
|
}
|
|
401
386
|
|
|
@@ -408,22 +393,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
408
393
|
|
|
409
394
|
if (address(_baseDeployer.singleton()) == address(0)) {
|
|
410
395
|
// Deploy the singleton instance.
|
|
411
|
-
JBBaseSucker _singleton = new JBBaseSucker{salt:
|
|
396
|
+
JBBaseSucker _singleton = new JBBaseSucker{salt: _BASE_SALT}({
|
|
412
397
|
deployer: _baseDeployer,
|
|
413
398
|
directory: core.directory,
|
|
414
399
|
permissions: core.permissions,
|
|
415
400
|
prices: core.prices,
|
|
416
401
|
tokens: core.tokens,
|
|
417
402
|
feeProjectId: 1,
|
|
418
|
-
registry:
|
|
419
|
-
trustedForwarder:
|
|
403
|
+
registry: registry,
|
|
404
|
+
trustedForwarder: trustedForwarder
|
|
420
405
|
});
|
|
421
406
|
|
|
422
407
|
// Configure the deployer to use the singleton instance.
|
|
423
408
|
_baseDeployer.configureSingleton(_singleton);
|
|
424
409
|
}
|
|
425
410
|
|
|
426
|
-
|
|
411
|
+
preApprovedDeployers.push(address(_baseDeployer));
|
|
427
412
|
}
|
|
428
413
|
}
|
|
429
414
|
|
|
@@ -432,21 +417,21 @@ contract DeployScript is Script, Sphinx {
|
|
|
432
417
|
function _arbitrumSucker() internal {
|
|
433
418
|
// Check if the deployer already exists at the CREATE2 address.
|
|
434
419
|
bool alreadyDeployed = _isDeployed({
|
|
435
|
-
salt:
|
|
420
|
+
salt: _ARB_SALT,
|
|
436
421
|
creationCode: type(JBArbitrumSuckerDeployer).creationCode,
|
|
437
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
422
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
438
423
|
});
|
|
439
424
|
|
|
440
425
|
// If already deployed, verify the full pipeline completed (singleton + registry allowlisting).
|
|
441
426
|
// Only skip if everything is fully configured; otherwise fall through to resume.
|
|
442
427
|
if (alreadyDeployed) {
|
|
443
428
|
address deployerAddr = _computeAddress({
|
|
444
|
-
salt:
|
|
429
|
+
salt: _ARB_SALT,
|
|
445
430
|
creationCode: type(JBArbitrumSuckerDeployer).creationCode,
|
|
446
|
-
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(),
|
|
431
|
+
arguments: abi.encode(core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder)
|
|
447
432
|
});
|
|
448
433
|
bool singletonSet = address(JBArbitrumSuckerDeployer(deployerAddr).singleton()) != address(0);
|
|
449
|
-
bool registryAllowed =
|
|
434
|
+
bool registryAllowed = registry.suckerDeployerIsAllowed(deployerAddr);
|
|
450
435
|
if (singletonSet && registryAllowed) return;
|
|
451
436
|
}
|
|
452
437
|
|
|
@@ -458,20 +443,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
458
443
|
if (alreadyDeployed) {
|
|
459
444
|
_arbDeployer = JBArbitrumSuckerDeployer(
|
|
460
445
|
_computeAddress({
|
|
461
|
-
salt:
|
|
446
|
+
salt: _ARB_SALT,
|
|
462
447
|
creationCode: type(JBArbitrumSuckerDeployer).creationCode,
|
|
463
448
|
arguments: abi.encode(
|
|
464
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
449
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
465
450
|
)
|
|
466
451
|
})
|
|
467
452
|
);
|
|
468
453
|
} else {
|
|
469
|
-
_arbDeployer = new JBArbitrumSuckerDeployer{salt:
|
|
454
|
+
_arbDeployer = new JBArbitrumSuckerDeployer{salt: _ARB_SALT}({
|
|
470
455
|
directory: core.directory,
|
|
471
456
|
permissions: core.permissions,
|
|
472
457
|
tokens: core.tokens,
|
|
473
458
|
configurator: safeAddress(),
|
|
474
|
-
trustedForwarder:
|
|
459
|
+
trustedForwarder: trustedForwarder
|
|
475
460
|
});
|
|
476
461
|
}
|
|
477
462
|
|
|
@@ -487,22 +472,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
487
472
|
|
|
488
473
|
if (address(_arbDeployer.singleton()) == address(0)) {
|
|
489
474
|
// Deploy the singleton instance.
|
|
490
|
-
JBArbitrumSucker _singleton = new JBArbitrumSucker{salt:
|
|
475
|
+
JBArbitrumSucker _singleton = new JBArbitrumSucker{salt: _ARB_SALT}({
|
|
491
476
|
deployer: _arbDeployer,
|
|
492
477
|
directory: core.directory,
|
|
493
478
|
permissions: core.permissions,
|
|
494
479
|
prices: core.prices,
|
|
495
480
|
tokens: core.tokens,
|
|
496
481
|
feeProjectId: 1,
|
|
497
|
-
registry:
|
|
498
|
-
trustedForwarder:
|
|
482
|
+
registry: registry,
|
|
483
|
+
trustedForwarder: trustedForwarder
|
|
499
484
|
});
|
|
500
485
|
|
|
501
486
|
// Configure the deployer to use the singleton instance.
|
|
502
487
|
_arbDeployer.configureSingleton(_singleton);
|
|
503
488
|
}
|
|
504
489
|
|
|
505
|
-
|
|
490
|
+
preApprovedDeployers.push(address(_arbDeployer));
|
|
506
491
|
}
|
|
507
492
|
|
|
508
493
|
// Check if we should do the L2 portion.
|
|
@@ -513,20 +498,20 @@ contract DeployScript is Script, Sphinx {
|
|
|
513
498
|
if (alreadyDeployed) {
|
|
514
499
|
_arbDeployer = JBArbitrumSuckerDeployer(
|
|
515
500
|
_computeAddress({
|
|
516
|
-
salt:
|
|
501
|
+
salt: _ARB_SALT,
|
|
517
502
|
creationCode: type(JBArbitrumSuckerDeployer).creationCode,
|
|
518
503
|
arguments: abi.encode(
|
|
519
|
-
core.directory, core.permissions, core.tokens, safeAddress(),
|
|
504
|
+
core.directory, core.permissions, core.tokens, safeAddress(), trustedForwarder
|
|
520
505
|
)
|
|
521
506
|
})
|
|
522
507
|
);
|
|
523
508
|
} else {
|
|
524
|
-
_arbDeployer = new JBArbitrumSuckerDeployer{salt:
|
|
509
|
+
_arbDeployer = new JBArbitrumSuckerDeployer{salt: _ARB_SALT}({
|
|
525
510
|
directory: core.directory,
|
|
526
511
|
permissions: core.permissions,
|
|
527
512
|
tokens: core.tokens,
|
|
528
513
|
configurator: safeAddress(),
|
|
529
|
-
trustedForwarder:
|
|
514
|
+
trustedForwarder: trustedForwarder
|
|
530
515
|
});
|
|
531
516
|
}
|
|
532
517
|
|
|
@@ -542,22 +527,22 @@ contract DeployScript is Script, Sphinx {
|
|
|
542
527
|
|
|
543
528
|
if (address(_arbDeployer.singleton()) == address(0)) {
|
|
544
529
|
// Deploy the singleton instance.
|
|
545
|
-
JBArbitrumSucker _singleton = new JBArbitrumSucker{salt:
|
|
530
|
+
JBArbitrumSucker _singleton = new JBArbitrumSucker{salt: _ARB_SALT}({
|
|
546
531
|
deployer: _arbDeployer,
|
|
547
532
|
directory: core.directory,
|
|
548
533
|
permissions: core.permissions,
|
|
549
534
|
prices: core.prices,
|
|
550
535
|
tokens: core.tokens,
|
|
551
536
|
feeProjectId: 1,
|
|
552
|
-
registry:
|
|
553
|
-
trustedForwarder:
|
|
537
|
+
registry: registry,
|
|
538
|
+
trustedForwarder: trustedForwarder
|
|
554
539
|
});
|
|
555
540
|
|
|
556
541
|
// Configure the deployer to use the singleton instance.
|
|
557
542
|
_arbDeployer.configureSingleton(_singleton);
|
|
558
543
|
}
|
|
559
544
|
|
|
560
|
-
|
|
545
|
+
preApprovedDeployers.push(address(_arbDeployer));
|
|
561
546
|
}
|
|
562
547
|
}
|
|
563
548
|
|
|
@@ -565,37 +550,38 @@ contract DeployScript is Script, Sphinx {
|
|
|
565
550
|
// Deploy all the L1 suckers.
|
|
566
551
|
if (block.chainid == 1 || block.chainid == 11_155_111) {
|
|
567
552
|
// Optimsim
|
|
568
|
-
|
|
553
|
+
preApprovedDeployers.push(
|
|
569
554
|
address(
|
|
570
555
|
_deployCCIPSuckerFor({
|
|
571
|
-
salt:
|
|
556
|
+
salt: _OP_SALT, remoteChainId: block.chainid == 1 ? CCIPHelper.OP_ID : CCIPHelper.OP_SEP_ID
|
|
572
557
|
})
|
|
573
558
|
)
|
|
574
559
|
);
|
|
575
560
|
|
|
576
561
|
// Base
|
|
577
|
-
|
|
562
|
+
preApprovedDeployers.push(
|
|
578
563
|
address(
|
|
579
564
|
_deployCCIPSuckerFor({
|
|
580
|
-
salt:
|
|
565
|
+
salt: _BASE_SALT,
|
|
566
|
+
remoteChainId: block.chainid == 1 ? CCIPHelper.BASE_ID : CCIPHelper.BASE_SEP_ID
|
|
581
567
|
})
|
|
582
568
|
)
|
|
583
569
|
);
|
|
584
570
|
|
|
585
571
|
// Arbitrum
|
|
586
|
-
|
|
572
|
+
preApprovedDeployers.push(
|
|
587
573
|
address(
|
|
588
574
|
_deployCCIPSuckerFor({
|
|
589
|
-
salt:
|
|
575
|
+
salt: _ARB_SALT, remoteChainId: block.chainid == 1 ? CCIPHelper.ARB_ID : CCIPHelper.ARB_SEP_ID
|
|
590
576
|
})
|
|
591
577
|
)
|
|
592
578
|
);
|
|
593
579
|
|
|
594
580
|
// Tempo
|
|
595
|
-
|
|
581
|
+
preApprovedDeployers.push(
|
|
596
582
|
address(
|
|
597
583
|
_deployCCIPSuckerFor({
|
|
598
|
-
salt:
|
|
584
|
+
salt: _TEMPO_SALT,
|
|
599
585
|
remoteChainId: block.chainid == 1 ? CCIPHelper.TEMPO_ID : CCIPHelper.TEMPO_MOD_ID
|
|
600
586
|
})
|
|
601
587
|
)
|
|
@@ -606,30 +592,30 @@ contract DeployScript is Script, Sphinx {
|
|
|
606
592
|
// ARB & ARB Sepolia.
|
|
607
593
|
if (block.chainid == 42_161 || block.chainid == 421_614) {
|
|
608
594
|
// L1.
|
|
609
|
-
|
|
595
|
+
preApprovedDeployers.push(
|
|
610
596
|
address(
|
|
611
597
|
_deployCCIPSuckerFor({
|
|
612
|
-
salt:
|
|
598
|
+
salt: _ARB_SALT,
|
|
613
599
|
remoteChainId: block.chainid == 42_161 ? CCIPHelper.ETH_ID : CCIPHelper.ETH_SEP_ID
|
|
614
600
|
})
|
|
615
601
|
)
|
|
616
602
|
);
|
|
617
603
|
|
|
618
604
|
// ARB -> OP.
|
|
619
|
-
|
|
605
|
+
preApprovedDeployers.push(
|
|
620
606
|
address(
|
|
621
607
|
_deployCCIPSuckerFor({
|
|
622
|
-
salt:
|
|
608
|
+
salt: _ARB_OP_SALT,
|
|
623
609
|
remoteChainId: block.chainid == 42_161 ? CCIPHelper.OP_ID : CCIPHelper.OP_SEP_ID
|
|
624
610
|
})
|
|
625
611
|
)
|
|
626
612
|
);
|
|
627
613
|
|
|
628
614
|
// ARB -> BASE.
|
|
629
|
-
|
|
615
|
+
preApprovedDeployers.push(
|
|
630
616
|
address(
|
|
631
617
|
_deployCCIPSuckerFor({
|
|
632
|
-
salt:
|
|
618
|
+
salt: _ARB_BASE_SALT,
|
|
633
619
|
remoteChainId: block.chainid == 42_161 ? CCIPHelper.BASE_ID : CCIPHelper.BASE_SEP_ID
|
|
634
620
|
})
|
|
635
621
|
)
|
|
@@ -638,29 +624,29 @@ contract DeployScript is Script, Sphinx {
|
|
|
638
624
|
// OP & OP Sepolia.
|
|
639
625
|
} else if (block.chainid == 10 || block.chainid == 11_155_420) {
|
|
640
626
|
// L1.
|
|
641
|
-
|
|
627
|
+
preApprovedDeployers.push(
|
|
642
628
|
address(
|
|
643
629
|
_deployCCIPSuckerFor({
|
|
644
|
-
salt:
|
|
630
|
+
salt: _OP_SALT, remoteChainId: block.chainid == 10 ? CCIPHelper.ETH_ID : CCIPHelper.ETH_SEP_ID
|
|
645
631
|
})
|
|
646
632
|
)
|
|
647
633
|
);
|
|
648
634
|
|
|
649
635
|
// OP -> ARB.
|
|
650
|
-
|
|
636
|
+
preApprovedDeployers.push(
|
|
651
637
|
address(
|
|
652
638
|
_deployCCIPSuckerFor({
|
|
653
|
-
salt:
|
|
639
|
+
salt: _ARB_OP_SALT,
|
|
654
640
|
remoteChainId: block.chainid == 10 ? CCIPHelper.ARB_ID : CCIPHelper.ARB_SEP_ID
|
|
655
641
|
})
|
|
656
642
|
)
|
|
657
643
|
);
|
|
658
644
|
|
|
659
645
|
// OP -> BASE.
|
|
660
|
-
|
|
646
|
+
preApprovedDeployers.push(
|
|
661
647
|
address(
|
|
662
648
|
_deployCCIPSuckerFor({
|
|
663
|
-
salt:
|
|
649
|
+
salt: _OP_BASE_SALT,
|
|
664
650
|
remoteChainId: block.chainid == 10 ? CCIPHelper.BASE_ID : CCIPHelper.BASE_SEP_ID
|
|
665
651
|
})
|
|
666
652
|
)
|
|
@@ -669,30 +655,30 @@ contract DeployScript is Script, Sphinx {
|
|
|
669
655
|
// BASE & BASE Sepolia.
|
|
670
656
|
} else if (block.chainid == 8453 || block.chainid == 84_532) {
|
|
671
657
|
// L1.
|
|
672
|
-
|
|
658
|
+
preApprovedDeployers.push(
|
|
673
659
|
address(
|
|
674
660
|
_deployCCIPSuckerFor({
|
|
675
|
-
salt:
|
|
661
|
+
salt: _BASE_SALT,
|
|
676
662
|
remoteChainId: block.chainid == 8453 ? CCIPHelper.ETH_ID : CCIPHelper.ETH_SEP_ID
|
|
677
663
|
})
|
|
678
664
|
)
|
|
679
665
|
);
|
|
680
666
|
|
|
681
667
|
// BASE -> OP.
|
|
682
|
-
|
|
668
|
+
preApprovedDeployers.push(
|
|
683
669
|
address(
|
|
684
670
|
_deployCCIPSuckerFor({
|
|
685
|
-
salt:
|
|
671
|
+
salt: _OP_BASE_SALT,
|
|
686
672
|
remoteChainId: block.chainid == 8453 ? CCIPHelper.OP_ID : CCIPHelper.OP_SEP_ID
|
|
687
673
|
})
|
|
688
674
|
)
|
|
689
675
|
);
|
|
690
676
|
|
|
691
677
|
// BASE -> ARB.
|
|
692
|
-
|
|
678
|
+
preApprovedDeployers.push(
|
|
693
679
|
address(
|
|
694
680
|
_deployCCIPSuckerFor({
|
|
695
|
-
salt:
|
|
681
|
+
salt: _ARB_BASE_SALT,
|
|
696
682
|
remoteChainId: block.chainid == 8453 ? CCIPHelper.ARB_ID : CCIPHelper.ARB_SEP_ID
|
|
697
683
|
})
|
|
698
684
|
)
|
|
@@ -702,10 +688,10 @@ contract DeployScript is Script, Sphinx {
|
|
|
702
688
|
// Tempo / Tempo Moderato.
|
|
703
689
|
if (block.chainid == 4217 || block.chainid == 42_431) {
|
|
704
690
|
// Tempo -> ETH.
|
|
705
|
-
|
|
691
|
+
preApprovedDeployers.push(
|
|
706
692
|
address(
|
|
707
693
|
_deployCCIPSuckerFor({
|
|
708
|
-
salt:
|
|
694
|
+
salt: _TEMPO_SALT,
|
|
709
695
|
remoteChainId: block.chainid == 4217 ? CCIPHelper.ETH_ID : CCIPHelper.ETH_SEP_ID
|
|
710
696
|
})
|
|
711
697
|
)
|
|
@@ -725,7 +711,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
725
711
|
prices: core.prices,
|
|
726
712
|
tokens: core.tokens,
|
|
727
713
|
configurator: safeAddress(),
|
|
728
|
-
|
|
714
|
+
forwarder: trustedForwarder,
|
|
729
715
|
remoteChainId: remoteChainId,
|
|
730
716
|
// Get the selector of the other side.
|
|
731
717
|
remoteChainSelector: CCIPHelper.selectorOfChain(remoteChainId),
|
|
@@ -742,7 +728,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
742
728
|
IJBPrices prices,
|
|
743
729
|
IJBTokens tokens,
|
|
744
730
|
address configurator,
|
|
745
|
-
address
|
|
731
|
+
address forwarder,
|
|
746
732
|
uint256 remoteChainId,
|
|
747
733
|
uint64 remoteChainSelector,
|
|
748
734
|
ICCIPRouter router
|
|
@@ -754,7 +740,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
754
740
|
bool alreadyDeployed = _isDeployed({
|
|
755
741
|
salt: salt,
|
|
756
742
|
creationCode: type(JBCCIPSuckerDeployer).creationCode,
|
|
757
|
-
arguments: abi.encode(directory, permissions, tokens, configurator,
|
|
743
|
+
arguments: abi.encode(directory, permissions, tokens, configurator, forwarder)
|
|
758
744
|
});
|
|
759
745
|
|
|
760
746
|
if (alreadyDeployed) {
|
|
@@ -762,13 +748,13 @@ contract DeployScript is Script, Sphinx {
|
|
|
762
748
|
_computeAddress({
|
|
763
749
|
salt: salt,
|
|
764
750
|
creationCode: type(JBCCIPSuckerDeployer).creationCode,
|
|
765
|
-
arguments: abi.encode(directory, permissions, tokens, configurator,
|
|
751
|
+
arguments: abi.encode(directory, permissions, tokens, configurator, forwarder)
|
|
766
752
|
})
|
|
767
753
|
);
|
|
768
754
|
|
|
769
755
|
// If the full pipeline is complete (singleton configured + registry allowlisted), return early.
|
|
770
756
|
bool singletonSet = address(deployer.singleton()) != address(0);
|
|
771
|
-
bool registryAllowed =
|
|
757
|
+
bool registryAllowed = registry.suckerDeployerIsAllowed(address(deployer));
|
|
772
758
|
if (singletonSet && registryAllowed) return deployer;
|
|
773
759
|
|
|
774
760
|
// Otherwise, resume the partial deployment below.
|
|
@@ -778,7 +764,7 @@ contract DeployScript is Script, Sphinx {
|
|
|
778
764
|
permissions: permissions,
|
|
779
765
|
tokens: tokens,
|
|
780
766
|
configurator: configurator,
|
|
781
|
-
trustedForwarder:
|
|
767
|
+
trustedForwarder: forwarder
|
|
782
768
|
});
|
|
783
769
|
}
|
|
784
770
|
|
|
@@ -797,8 +783,8 @@ contract DeployScript is Script, Sphinx {
|
|
|
797
783
|
permissions: permissions,
|
|
798
784
|
prices: prices,
|
|
799
785
|
feeProjectId: 1,
|
|
800
|
-
registry:
|
|
801
|
-
trustedForwarder:
|
|
786
|
+
registry: registry,
|
|
787
|
+
trustedForwarder: forwarder
|
|
802
788
|
});
|
|
803
789
|
|
|
804
790
|
// Configure the singleton.
|