@safe-global/safe-modules-deployments 1.1.0 → 1.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.
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getAddModulesLibDeployment = exports.getSafe4337ModuleDeployment = void 0;
7
+ const safe_4337_module_json_1 = __importDefault(require("./assets/safe-4337-module/v0.1.0/safe-4337-module.json"));
8
+ const add_modules_lib_json_1 = __importDefault(require("./assets/safe-4337-module/v0.1.0/add-modules-lib.json"));
9
+ const utils_1 = require("./utils");
10
+ // The array should be sorted from the latest version to the oldest.
11
+ const SAFE_4337_MODULE_DEPLOYMENTS = [safe_4337_module_json_1.default];
12
+ const ADD_MODULES_LIB_DEPLOYMENTS = [add_modules_lib_json_1.default];
13
+ const getSafe4337ModuleDeployment = (filter) => {
14
+ return (0, utils_1.findDeployment)((0, utils_1.applyFilterDefaults)(filter), SAFE_4337_MODULE_DEPLOYMENTS);
15
+ };
16
+ exports.getSafe4337ModuleDeployment = getSafe4337ModuleDeployment;
17
+ const getAddModulesLibDeployment = (filter) => {
18
+ return (0, utils_1.findDeployment)((0, utils_1.applyFilterDefaults)(filter), ADD_MODULES_LIB_DEPLOYMENTS);
19
+ };
20
+ exports.getAddModulesLibDeployment = getAddModulesLibDeployment;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface SingletonDeployment {
1
+ export interface Deployment {
2
2
  version: string;
3
3
  abi: any[];
4
4
  networkAddresses: Record<string, string>;
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { DeploymentFilter, SingletonDeployment } from './types';
2
- export declare const findDeployment: (criteria: DeploymentFilter, deployments: SingletonDeployment[]) => SingletonDeployment | undefined;
1
+ import { DeploymentFilter, Deployment } from './types';
2
+ export declare const findDeployment: (criteria: DeploymentFilter, deployments: Deployment[]) => Deployment | undefined;
3
3
  export declare const applyFilterDefaults: (filter?: DeploymentFilter | undefined) => DeploymentFilter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safe-global/safe-modules-deployments",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Collection of Safe Modules singleton deployments",
5
5
  "homepage": "https://github.com/safe-global/safe-modules-deployments/",
6
6
  "license": "MIT",
@@ -1,10 +1,10 @@
1
1
  import AllowanceModule010 from './assets/allowance-module/v0.1.0/allowance-module.json';
2
- import { DeploymentFilter, SingletonDeployment } from './types';
2
+ import { DeploymentFilter, Deployment } from './types';
3
3
  import { applyFilterDefaults, findDeployment } from './utils';
4
4
 
5
5
  // The array should be sorted from the latest version to the oldest.
6
- const ALLOWANCE_MODULE_DEPLOYMENTS: SingletonDeployment[] = [AllowanceModule010];
6
+ const ALLOWANCE_MODULE_DEPLOYMENTS: Deployment[] = [AllowanceModule010];
7
7
 
8
- export const getAllowanceModuleDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
8
+ export const getAllowanceModuleDeployment = (filter?: DeploymentFilter): Deployment | undefined => {
9
9
  return findDeployment(applyFilterDefaults(filter), ALLOWANCE_MODULE_DEPLOYMENTS);
10
10
  };
@@ -13,7 +13,8 @@
13
13
  "246": "0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134",
14
14
  "42220": "0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134",
15
15
  "43114": "0x1Fb403834C911eB98d56E74F5182b0d64C3b3b4D",
16
- "73799": "0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134"
16
+ "73799": "0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134",
17
+ "11155111": "0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134"
17
18
  },
18
19
  "abi": [
19
20
  {
@@ -0,0 +1,25 @@
1
+ {
2
+ "released": true,
3
+ "contractName": "AddModulesLib",
4
+ "version": "0.1.0",
5
+ "networkAddresses": {
6
+ "5": "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
7
+ "137": "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
8
+ "11155111": "0x191EFDC03615B575922289DC339F4c70aC5C30Af"
9
+ },
10
+ "abi": [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "address[]",
15
+ "name": "modules",
16
+ "type": "address[]"
17
+ }
18
+ ],
19
+ "name": "enableModules",
20
+ "outputs": [],
21
+ "stateMutability": "nonpayable",
22
+ "type": "function"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,571 @@
1
+ {
2
+ "released": true,
3
+ "contractName": "Safe4337Module",
4
+ "version": "0.1.0",
5
+ "networkAddresses": {
6
+ "5": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
7
+ "137": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
8
+ "11155111": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38"
9
+ },
10
+ "abi": [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "address",
15
+ "name": "entryPoint",
16
+ "type": "address"
17
+ }
18
+ ],
19
+ "stateMutability": "nonpayable",
20
+ "type": "constructor"
21
+ },
22
+ {
23
+ "inputs": [],
24
+ "name": "SUPPORTED_ENTRYPOINT",
25
+ "outputs": [
26
+ {
27
+ "internalType": "address",
28
+ "name": "",
29
+ "type": "address"
30
+ }
31
+ ],
32
+ "stateMutability": "view",
33
+ "type": "function"
34
+ },
35
+ {
36
+ "inputs": [],
37
+ "name": "domainSeparator",
38
+ "outputs": [
39
+ {
40
+ "internalType": "bytes32",
41
+ "name": "",
42
+ "type": "bytes32"
43
+ }
44
+ ],
45
+ "stateMutability": "view",
46
+ "type": "function"
47
+ },
48
+ {
49
+ "inputs": [
50
+ {
51
+ "internalType": "contract Safe",
52
+ "name": "safe",
53
+ "type": "address"
54
+ },
55
+ {
56
+ "internalType": "bytes",
57
+ "name": "message",
58
+ "type": "bytes"
59
+ }
60
+ ],
61
+ "name": "encodeMessageDataForSafe",
62
+ "outputs": [
63
+ {
64
+ "internalType": "bytes",
65
+ "name": "",
66
+ "type": "bytes"
67
+ }
68
+ ],
69
+ "stateMutability": "view",
70
+ "type": "function"
71
+ },
72
+ {
73
+ "inputs": [
74
+ {
75
+ "internalType": "address",
76
+ "name": "to",
77
+ "type": "address"
78
+ },
79
+ {
80
+ "internalType": "uint256",
81
+ "name": "value",
82
+ "type": "uint256"
83
+ },
84
+ {
85
+ "internalType": "bytes",
86
+ "name": "data",
87
+ "type": "bytes"
88
+ },
89
+ {
90
+ "internalType": "uint8",
91
+ "name": "operation",
92
+ "type": "uint8"
93
+ }
94
+ ],
95
+ "name": "executeUserOp",
96
+ "outputs": [],
97
+ "stateMutability": "nonpayable",
98
+ "type": "function"
99
+ },
100
+ {
101
+ "inputs": [
102
+ {
103
+ "internalType": "address",
104
+ "name": "to",
105
+ "type": "address"
106
+ },
107
+ {
108
+ "internalType": "uint256",
109
+ "name": "value",
110
+ "type": "uint256"
111
+ },
112
+ {
113
+ "internalType": "bytes",
114
+ "name": "data",
115
+ "type": "bytes"
116
+ },
117
+ {
118
+ "internalType": "uint8",
119
+ "name": "operation",
120
+ "type": "uint8"
121
+ }
122
+ ],
123
+ "name": "executeUserOpWithErrorString",
124
+ "outputs": [],
125
+ "stateMutability": "nonpayable",
126
+ "type": "function"
127
+ },
128
+ {
129
+ "inputs": [
130
+ {
131
+ "internalType": "bytes",
132
+ "name": "message",
133
+ "type": "bytes"
134
+ }
135
+ ],
136
+ "name": "getMessageHash",
137
+ "outputs": [
138
+ {
139
+ "internalType": "bytes32",
140
+ "name": "",
141
+ "type": "bytes32"
142
+ }
143
+ ],
144
+ "stateMutability": "view",
145
+ "type": "function"
146
+ },
147
+ {
148
+ "inputs": [
149
+ {
150
+ "internalType": "contract Safe",
151
+ "name": "safe",
152
+ "type": "address"
153
+ },
154
+ {
155
+ "internalType": "bytes",
156
+ "name": "message",
157
+ "type": "bytes"
158
+ }
159
+ ],
160
+ "name": "getMessageHashForSafe",
161
+ "outputs": [
162
+ {
163
+ "internalType": "bytes32",
164
+ "name": "",
165
+ "type": "bytes32"
166
+ }
167
+ ],
168
+ "stateMutability": "view",
169
+ "type": "function"
170
+ },
171
+ {
172
+ "inputs": [],
173
+ "name": "getModules",
174
+ "outputs": [
175
+ {
176
+ "internalType": "address[]",
177
+ "name": "",
178
+ "type": "address[]"
179
+ }
180
+ ],
181
+ "stateMutability": "view",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [
186
+ {
187
+ "internalType": "address",
188
+ "name": "safe",
189
+ "type": "address"
190
+ },
191
+ {
192
+ "internalType": "bytes",
193
+ "name": "callData",
194
+ "type": "bytes"
195
+ },
196
+ {
197
+ "internalType": "uint256",
198
+ "name": "nonce",
199
+ "type": "uint256"
200
+ },
201
+ {
202
+ "internalType": "uint256",
203
+ "name": "preVerificationGas",
204
+ "type": "uint256"
205
+ },
206
+ {
207
+ "internalType": "uint256",
208
+ "name": "verificationGasLimit",
209
+ "type": "uint256"
210
+ },
211
+ {
212
+ "internalType": "uint256",
213
+ "name": "callGasLimit",
214
+ "type": "uint256"
215
+ },
216
+ {
217
+ "internalType": "uint256",
218
+ "name": "maxFeePerGas",
219
+ "type": "uint256"
220
+ },
221
+ {
222
+ "internalType": "uint256",
223
+ "name": "maxPriorityFeePerGas",
224
+ "type": "uint256"
225
+ },
226
+ {
227
+ "internalType": "address",
228
+ "name": "entryPoint",
229
+ "type": "address"
230
+ }
231
+ ],
232
+ "name": "getOperationHash",
233
+ "outputs": [
234
+ {
235
+ "internalType": "bytes32",
236
+ "name": "",
237
+ "type": "bytes32"
238
+ }
239
+ ],
240
+ "stateMutability": "view",
241
+ "type": "function"
242
+ },
243
+ {
244
+ "inputs": [
245
+ {
246
+ "internalType": "bytes32",
247
+ "name": "_dataHash",
248
+ "type": "bytes32"
249
+ },
250
+ {
251
+ "internalType": "bytes",
252
+ "name": "_signature",
253
+ "type": "bytes"
254
+ }
255
+ ],
256
+ "name": "isValidSignature",
257
+ "outputs": [
258
+ {
259
+ "internalType": "bytes4",
260
+ "name": "",
261
+ "type": "bytes4"
262
+ }
263
+ ],
264
+ "stateMutability": "view",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "inputs": [
269
+ {
270
+ "internalType": "bytes",
271
+ "name": "_data",
272
+ "type": "bytes"
273
+ },
274
+ {
275
+ "internalType": "bytes",
276
+ "name": "_signature",
277
+ "type": "bytes"
278
+ }
279
+ ],
280
+ "name": "isValidSignature",
281
+ "outputs": [
282
+ {
283
+ "internalType": "bytes4",
284
+ "name": "",
285
+ "type": "bytes4"
286
+ }
287
+ ],
288
+ "stateMutability": "view",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [
293
+ {
294
+ "internalType": "address",
295
+ "name": "",
296
+ "type": "address"
297
+ },
298
+ {
299
+ "internalType": "address",
300
+ "name": "",
301
+ "type": "address"
302
+ },
303
+ {
304
+ "internalType": "uint256[]",
305
+ "name": "",
306
+ "type": "uint256[]"
307
+ },
308
+ {
309
+ "internalType": "uint256[]",
310
+ "name": "",
311
+ "type": "uint256[]"
312
+ },
313
+ {
314
+ "internalType": "bytes",
315
+ "name": "",
316
+ "type": "bytes"
317
+ }
318
+ ],
319
+ "name": "onERC1155BatchReceived",
320
+ "outputs": [
321
+ {
322
+ "internalType": "bytes4",
323
+ "name": "",
324
+ "type": "bytes4"
325
+ }
326
+ ],
327
+ "stateMutability": "pure",
328
+ "type": "function"
329
+ },
330
+ {
331
+ "inputs": [
332
+ {
333
+ "internalType": "address",
334
+ "name": "",
335
+ "type": "address"
336
+ },
337
+ {
338
+ "internalType": "address",
339
+ "name": "",
340
+ "type": "address"
341
+ },
342
+ {
343
+ "internalType": "uint256",
344
+ "name": "",
345
+ "type": "uint256"
346
+ },
347
+ {
348
+ "internalType": "uint256",
349
+ "name": "",
350
+ "type": "uint256"
351
+ },
352
+ {
353
+ "internalType": "bytes",
354
+ "name": "",
355
+ "type": "bytes"
356
+ }
357
+ ],
358
+ "name": "onERC1155Received",
359
+ "outputs": [
360
+ {
361
+ "internalType": "bytes4",
362
+ "name": "",
363
+ "type": "bytes4"
364
+ }
365
+ ],
366
+ "stateMutability": "pure",
367
+ "type": "function"
368
+ },
369
+ {
370
+ "inputs": [
371
+ {
372
+ "internalType": "address",
373
+ "name": "",
374
+ "type": "address"
375
+ },
376
+ {
377
+ "internalType": "address",
378
+ "name": "",
379
+ "type": "address"
380
+ },
381
+ {
382
+ "internalType": "uint256",
383
+ "name": "",
384
+ "type": "uint256"
385
+ },
386
+ {
387
+ "internalType": "bytes",
388
+ "name": "",
389
+ "type": "bytes"
390
+ }
391
+ ],
392
+ "name": "onERC721Received",
393
+ "outputs": [
394
+ {
395
+ "internalType": "bytes4",
396
+ "name": "",
397
+ "type": "bytes4"
398
+ }
399
+ ],
400
+ "stateMutability": "pure",
401
+ "type": "function"
402
+ },
403
+ {
404
+ "inputs": [
405
+ {
406
+ "internalType": "address",
407
+ "name": "targetContract",
408
+ "type": "address"
409
+ },
410
+ {
411
+ "internalType": "bytes",
412
+ "name": "calldataPayload",
413
+ "type": "bytes"
414
+ }
415
+ ],
416
+ "name": "simulate",
417
+ "outputs": [
418
+ {
419
+ "internalType": "bytes",
420
+ "name": "response",
421
+ "type": "bytes"
422
+ }
423
+ ],
424
+ "stateMutability": "nonpayable",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "inputs": [
429
+ {
430
+ "internalType": "bytes4",
431
+ "name": "interfaceId",
432
+ "type": "bytes4"
433
+ }
434
+ ],
435
+ "name": "supportsInterface",
436
+ "outputs": [
437
+ {
438
+ "internalType": "bool",
439
+ "name": "",
440
+ "type": "bool"
441
+ }
442
+ ],
443
+ "stateMutability": "view",
444
+ "type": "function"
445
+ },
446
+ {
447
+ "inputs": [
448
+ {
449
+ "internalType": "address",
450
+ "name": "",
451
+ "type": "address"
452
+ },
453
+ {
454
+ "internalType": "address",
455
+ "name": "",
456
+ "type": "address"
457
+ },
458
+ {
459
+ "internalType": "address",
460
+ "name": "",
461
+ "type": "address"
462
+ },
463
+ {
464
+ "internalType": "uint256",
465
+ "name": "",
466
+ "type": "uint256"
467
+ },
468
+ {
469
+ "internalType": "bytes",
470
+ "name": "",
471
+ "type": "bytes"
472
+ },
473
+ {
474
+ "internalType": "bytes",
475
+ "name": "",
476
+ "type": "bytes"
477
+ }
478
+ ],
479
+ "name": "tokensReceived",
480
+ "outputs": [],
481
+ "stateMutability": "pure",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [
486
+ {
487
+ "components": [
488
+ {
489
+ "internalType": "address",
490
+ "name": "sender",
491
+ "type": "address"
492
+ },
493
+ {
494
+ "internalType": "uint256",
495
+ "name": "nonce",
496
+ "type": "uint256"
497
+ },
498
+ {
499
+ "internalType": "bytes",
500
+ "name": "initCode",
501
+ "type": "bytes"
502
+ },
503
+ {
504
+ "internalType": "bytes",
505
+ "name": "callData",
506
+ "type": "bytes"
507
+ },
508
+ {
509
+ "internalType": "uint256",
510
+ "name": "callGasLimit",
511
+ "type": "uint256"
512
+ },
513
+ {
514
+ "internalType": "uint256",
515
+ "name": "verificationGasLimit",
516
+ "type": "uint256"
517
+ },
518
+ {
519
+ "internalType": "uint256",
520
+ "name": "preVerificationGas",
521
+ "type": "uint256"
522
+ },
523
+ {
524
+ "internalType": "uint256",
525
+ "name": "maxFeePerGas",
526
+ "type": "uint256"
527
+ },
528
+ {
529
+ "internalType": "uint256",
530
+ "name": "maxPriorityFeePerGas",
531
+ "type": "uint256"
532
+ },
533
+ {
534
+ "internalType": "bytes",
535
+ "name": "paymasterAndData",
536
+ "type": "bytes"
537
+ },
538
+ {
539
+ "internalType": "bytes",
540
+ "name": "signature",
541
+ "type": "bytes"
542
+ }
543
+ ],
544
+ "internalType": "struct UserOperation",
545
+ "name": "userOp",
546
+ "type": "tuple"
547
+ },
548
+ {
549
+ "internalType": "bytes32",
550
+ "name": "",
551
+ "type": "bytes32"
552
+ },
553
+ {
554
+ "internalType": "uint256",
555
+ "name": "missingAccountFunds",
556
+ "type": "uint256"
557
+ }
558
+ ],
559
+ "name": "validateUserOp",
560
+ "outputs": [
561
+ {
562
+ "internalType": "uint256",
563
+ "name": "validationData",
564
+ "type": "uint256"
565
+ }
566
+ ],
567
+ "stateMutability": "nonpayable",
568
+ "type": "function"
569
+ }
570
+ ]
571
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './allowance-module';
2
+ export * from './safe-4337-module';
2
3
  export * from './types';
@@ -0,0 +1,16 @@
1
+ import Safe4337Module010 from './assets/safe-4337-module/v0.1.0/safe-4337-module.json';
2
+ import AddModulesLib010 from './assets/safe-4337-module/v0.1.0/add-modules-lib.json';
3
+ import { DeploymentFilter, Deployment } from './types';
4
+ import { applyFilterDefaults, findDeployment } from './utils';
5
+
6
+ // The array should be sorted from the latest version to the oldest.
7
+ const SAFE_4337_MODULE_DEPLOYMENTS: Deployment[] = [Safe4337Module010];
8
+ const ADD_MODULES_LIB_DEPLOYMENTS: Deployment[] = [AddModulesLib010];
9
+
10
+ export const getSafe4337ModuleDeployment = (filter?: DeploymentFilter): Deployment | undefined => {
11
+ return findDeployment(applyFilterDefaults(filter), SAFE_4337_MODULE_DEPLOYMENTS);
12
+ };
13
+
14
+ export const getAddModulesLibDeployment = (filter?: DeploymentFilter): Deployment | undefined => {
15
+ return findDeployment(applyFilterDefaults(filter), ADD_MODULES_LIB_DEPLOYMENTS);
16
+ };
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface SingletonDeployment {
1
+ export interface Deployment {
2
2
  version: string;
3
3
  abi: any[];
4
4
  networkAddresses: Record<string, string>;