@safe-global/safe-deployments 1.20.1

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.
Files changed (62) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +91 -0
  3. package/dist/assets/v1.0.0/gnosis_safe.json +419 -0
  4. package/dist/assets/v1.0.0/proxy_factory.json +105 -0
  5. package/dist/assets/v1.1.1/default_callback_handler.json +206 -0
  6. package/dist/assets/v1.1.1/gnosis_safe.json +995 -0
  7. package/dist/assets/v1.1.1/multi_send.json +39 -0
  8. package/dist/assets/v1.1.1/proxy_factory.json +185 -0
  9. package/dist/assets/v1.2.0/gnosis_safe.json +1016 -0
  10. package/dist/assets/v1.3.0/compatibility_fallback_handler.json +436 -0
  11. package/dist/assets/v1.3.0/create_call.json +179 -0
  12. package/dist/assets/v1.3.0/gnosis_safe.json +1144 -0
  13. package/dist/assets/v1.3.0/gnosis_safe_l2.json +1249 -0
  14. package/dist/assets/v1.3.0/multi_send.json +130 -0
  15. package/dist/assets/v1.3.0/multi_send_call_only.json +126 -0
  16. package/dist/assets/v1.3.0/proxy_factory.json +274 -0
  17. package/dist/assets/v1.3.0/sign_message_lib.json +157 -0
  18. package/dist/factories.d.ts +2 -0
  19. package/dist/factories.js +18 -0
  20. package/dist/handler.d.ts +4 -0
  21. package/dist/handler.js +33 -0
  22. package/dist/index.d.ts +5 -0
  23. package/dist/index.js +17 -0
  24. package/dist/libs.d.ts +5 -0
  25. package/dist/libs.js +43 -0
  26. package/dist/safes.d.ts +5 -0
  27. package/dist/safes.js +28 -0
  28. package/dist/types.d.ts +13 -0
  29. package/dist/types.js +2 -0
  30. package/dist/utils.d.ts +2 -0
  31. package/dist/utils.js +18 -0
  32. package/package.json +56 -0
  33. package/src/__tests__/factories.test.ts +13 -0
  34. package/src/__tests__/handler.test.ts +31 -0
  35. package/src/__tests__/libs.test.ts +39 -0
  36. package/src/__tests__/safes.test.ts +27 -0
  37. package/src/__tests__/utilts.test.ts +339 -0
  38. package/src/assets/v1.0.0/gnosis_safe.json +419 -0
  39. package/src/assets/v1.0.0/proxy_factory.json +105 -0
  40. package/src/assets/v1.1.1/create_and_add_modules.json +49 -0
  41. package/src/assets/v1.1.1/create_call.json +84 -0
  42. package/src/assets/v1.1.1/default_callback_handler.json +206 -0
  43. package/src/assets/v1.1.1/gnosis_safe.json +995 -0
  44. package/src/assets/v1.1.1/multi_send.json +39 -0
  45. package/src/assets/v1.1.1/proxy_factory.json +185 -0
  46. package/src/assets/v1.2.0/gnosis_safe.json +1016 -0
  47. package/src/assets/v1.3.0/compatibility_fallback_handler.json +436 -0
  48. package/src/assets/v1.3.0/create_call.json +179 -0
  49. package/src/assets/v1.3.0/gnosis_safe.json +1144 -0
  50. package/src/assets/v1.3.0/gnosis_safe_l2.json +1249 -0
  51. package/src/assets/v1.3.0/multi_send.json +130 -0
  52. package/src/assets/v1.3.0/multi_send_call_only.json +126 -0
  53. package/src/assets/v1.3.0/proxy_factory.json +274 -0
  54. package/src/assets/v1.3.0/sign_message_lib.json +157 -0
  55. package/src/assets/v1.3.0/simulate_tx_accessor.json +162 -0
  56. package/src/factories.ts +14 -0
  57. package/src/handler.ts +31 -0
  58. package/src/index.ts +5 -0
  59. package/src/libs.ts +42 -0
  60. package/src/safes.ts +25 -0
  61. package/src/types.ts +14 -0
  62. package/src/utils.ts +12 -0
@@ -0,0 +1,157 @@
1
+ {
2
+ "defaultAddress": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
3
+ "contractName": "SignMessageLib",
4
+ "version": "1.3.0",
5
+ "released": true,
6
+ "networkAddresses": {
7
+ "1": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
8
+ "3": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
9
+ "4": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
10
+ "5": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
11
+ "10": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
12
+ "11": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
13
+ "12": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
14
+ "25": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
15
+ "28": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
16
+ "40": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
17
+ "41": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
18
+ "42": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
19
+ "50": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
20
+ "51": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
21
+ "56": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
22
+ "61": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
23
+ "63": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
24
+ "69": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
25
+ "82": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
26
+ "83": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
27
+ "97": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
28
+ "100": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
29
+ "106": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
30
+ "108": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
31
+ "111": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
32
+ "122": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
33
+ "123": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
34
+ "137": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
35
+ "246": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
36
+ "250": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
37
+ "288": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
38
+ "300": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
39
+ "321": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
40
+ "322": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
41
+ "336": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
42
+ "338": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
43
+ "420": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
44
+ "588": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
45
+ "592": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
46
+ "595": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
47
+ "599": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
48
+ "686": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
49
+ "787": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
50
+ "1001": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
51
+ "1008": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
52
+ "1088": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
53
+ "1284": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
54
+ "1285": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
55
+ "1287": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
56
+ "1294": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
57
+ "1807": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
58
+ "1984": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
59
+ "2001": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
60
+ "2002": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
61
+ "2008": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
62
+ "2019": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
63
+ "2020": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
64
+ "2221": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
65
+ "2222": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
66
+ "4002": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
67
+ "4689": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
68
+ "4918": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
69
+ "4919": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
70
+ "7341": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
71
+ "7700": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
72
+ "8217": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
73
+ "9000": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
74
+ "9001": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
75
+ "9728": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
76
+ "10000": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
77
+ "10001": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
78
+ "10200": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
79
+ "11235": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
80
+ "11437": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
81
+ "12357": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
82
+ "42161": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
83
+ "42170": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
84
+ "42220": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
85
+ "43113": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
86
+ "43114": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
87
+ "43288": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
88
+ "44787": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
89
+ "45000": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
90
+ "47805": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
91
+ "54211": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
92
+ "56288": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
93
+ "71401": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
94
+ "71402": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
95
+ "73799": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
96
+ "80001": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
97
+ "84531": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
98
+ "200101": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
99
+ "200202": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
100
+ "421611": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
101
+ "421613": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
102
+ "11155111": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
103
+ "1313161554": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
104
+ "1313161555": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
105
+ "1666600000": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
106
+ "1666700000": "0x98FFBBF51bb33A056B08ddf711f289936AafF717",
107
+ "11297108099": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2",
108
+ "11297108109": "0xA65387F16B013cf2Af4605Ad8aA5ec25a2cbA3a2"
109
+ },
110
+ "abi": [
111
+ {
112
+ "anonymous": false,
113
+ "inputs": [
114
+ {
115
+ "indexed": true,
116
+ "internalType": "bytes32",
117
+ "name": "msgHash",
118
+ "type": "bytes32"
119
+ }
120
+ ],
121
+ "name": "SignMsg",
122
+ "type": "event"
123
+ },
124
+ {
125
+ "inputs": [
126
+ {
127
+ "internalType": "bytes",
128
+ "name": "message",
129
+ "type": "bytes"
130
+ }
131
+ ],
132
+ "name": "getMessageHash",
133
+ "outputs": [
134
+ {
135
+ "internalType": "bytes32",
136
+ "name": "",
137
+ "type": "bytes32"
138
+ }
139
+ ],
140
+ "stateMutability": "view",
141
+ "type": "function"
142
+ },
143
+ {
144
+ "inputs": [
145
+ {
146
+ "internalType": "bytes",
147
+ "name": "_data",
148
+ "type": "bytes"
149
+ }
150
+ ],
151
+ "name": "signMessage",
152
+ "outputs": [],
153
+ "stateMutability": "nonpayable",
154
+ "type": "function"
155
+ }
156
+ ]
157
+ }
@@ -0,0 +1,2 @@
1
+ import { DeploymentFilter, SingletonDeployment } from './types';
2
+ export declare const getProxyFactoryDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
@@ -0,0 +1,18 @@
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.getProxyFactoryDeployment = void 0;
7
+ const proxy_factory_json_1 = __importDefault(require("./assets/v1.0.0/proxy_factory.json"));
8
+ const proxy_factory_json_2 = __importDefault(require("./assets/v1.1.1/proxy_factory.json"));
9
+ const proxy_factory_json_3 = __importDefault(require("./assets/v1.3.0/proxy_factory.json"));
10
+ const utils_1 = require("./utils");
11
+ // This is a sorted array (newest to oldest)
12
+ const factoryDeployments = [
13
+ proxy_factory_json_3.default, proxy_factory_json_2.default, proxy_factory_json_1.default
14
+ ];
15
+ const getProxyFactoryDeployment = (filter) => {
16
+ return utils_1.findDeployment(filter, factoryDeployments);
17
+ };
18
+ exports.getProxyFactoryDeployment = getProxyFactoryDeployment;
@@ -0,0 +1,4 @@
1
+ import { DeploymentFilter, SingletonDeployment } from './types';
2
+ export declare const getDefaultCallbackHandlerDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
3
+ export declare const getCompatibilityFallbackHandlerDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
4
+ export declare const getFallbackHandlerDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
@@ -0,0 +1,33 @@
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.getFallbackHandlerDeployment = exports.getCompatibilityFallbackHandlerDeployment = exports.getDefaultCallbackHandlerDeployment = void 0;
7
+ const default_callback_handler_json_1 = __importDefault(require("./assets/v1.1.1/default_callback_handler.json"));
8
+ const compatibility_fallback_handler_json_1 = __importDefault(require("./assets/v1.3.0/compatibility_fallback_handler.json"));
9
+ const utils_1 = require("./utils");
10
+ // This is a sorted array (by preference)
11
+ const defaultCallbackHandlerDeployments = [
12
+ default_callback_handler_json_1.default
13
+ ];
14
+ const getDefaultCallbackHandlerDeployment = (filter) => {
15
+ return utils_1.findDeployment(filter, defaultCallbackHandlerDeployments);
16
+ };
17
+ exports.getDefaultCallbackHandlerDeployment = getDefaultCallbackHandlerDeployment;
18
+ // This is a sorted array (by preference)
19
+ const compatFallbackHandlerDeployments = [
20
+ compatibility_fallback_handler_json_1.default
21
+ ];
22
+ const getCompatibilityFallbackHandlerDeployment = (filter) => {
23
+ return utils_1.findDeployment(filter, compatFallbackHandlerDeployments);
24
+ };
25
+ exports.getCompatibilityFallbackHandlerDeployment = getCompatibilityFallbackHandlerDeployment;
26
+ // This is a sorted array (by preference)
27
+ const fallbackHandlerDeployments = [
28
+ compatibility_fallback_handler_json_1.default, default_callback_handler_json_1.default
29
+ ];
30
+ const getFallbackHandlerDeployment = (filter) => {
31
+ return utils_1.findDeployment(filter, fallbackHandlerDeployments);
32
+ };
33
+ exports.getFallbackHandlerDeployment = getFallbackHandlerDeployment;
@@ -0,0 +1,5 @@
1
+ export * from './types';
2
+ export * from './safes';
3
+ export * from './factories';
4
+ export * from './libs';
5
+ export * from './handler';
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./types"), exports);
14
+ __exportStar(require("./safes"), exports);
15
+ __exportStar(require("./factories"), exports);
16
+ __exportStar(require("./libs"), exports);
17
+ __exportStar(require("./handler"), exports);
package/dist/libs.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { DeploymentFilter, SingletonDeployment } from './types';
2
+ export declare const getMultiSendDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
3
+ export declare const getMultiSendCallOnlyDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
4
+ export declare const getCreateCallDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
5
+ export declare const getSignMessageLibDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
package/dist/libs.js ADDED
@@ -0,0 +1,43 @@
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.getSignMessageLibDeployment = exports.getCreateCallDeployment = exports.getMultiSendCallOnlyDeployment = exports.getMultiSendDeployment = void 0;
7
+ const create_call_json_1 = __importDefault(require("./assets/v1.3.0/create_call.json"));
8
+ const multi_send_json_1 = __importDefault(require("./assets/v1.1.1/multi_send.json"));
9
+ const multi_send_json_2 = __importDefault(require("./assets/v1.3.0/multi_send.json"));
10
+ const multi_send_call_only_json_1 = __importDefault(require("./assets/v1.3.0/multi_send_call_only.json"));
11
+ const sign_message_lib_json_1 = __importDefault(require("./assets/v1.3.0/sign_message_lib.json"));
12
+ const utils_1 = require("./utils");
13
+ // This is a sorted array (by preference, currently we use 111 in most cases)
14
+ const multiSendDeployments = [
15
+ multi_send_json_2.default, multi_send_json_1.default
16
+ ];
17
+ const getMultiSendDeployment = (filter) => {
18
+ return utils_1.findDeployment(filter, multiSendDeployments);
19
+ };
20
+ exports.getMultiSendDeployment = getMultiSendDeployment;
21
+ // This is a sorted array (by preference)
22
+ const multiSendCallOnlyDeployments = [
23
+ multi_send_call_only_json_1.default
24
+ ];
25
+ const getMultiSendCallOnlyDeployment = (filter) => {
26
+ return utils_1.findDeployment(filter, multiSendCallOnlyDeployments);
27
+ };
28
+ exports.getMultiSendCallOnlyDeployment = getMultiSendCallOnlyDeployment;
29
+ // This is a sorted array (by preference)
30
+ const createCallDeployments = [
31
+ create_call_json_1.default
32
+ ];
33
+ const getCreateCallDeployment = (filter) => {
34
+ return utils_1.findDeployment(filter, createCallDeployments);
35
+ };
36
+ exports.getCreateCallDeployment = getCreateCallDeployment;
37
+ const signMessageLibDeployments = [
38
+ sign_message_lib_json_1.default
39
+ ];
40
+ const getSignMessageLibDeployment = (filter) => {
41
+ return utils_1.findDeployment(filter, signMessageLibDeployments);
42
+ };
43
+ exports.getSignMessageLibDeployment = getSignMessageLibDeployment;
@@ -0,0 +1,5 @@
1
+ import { DeploymentFilter, SingletonDeployment } from './types';
2
+ export declare const _safeDeployments: SingletonDeployment[];
3
+ export declare const getSafeSingletonDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
4
+ export declare const _safeL2Deployments: SingletonDeployment[];
5
+ export declare const getSafeL2SingletonDeployment: (filter?: DeploymentFilter | undefined) => SingletonDeployment | undefined;
package/dist/safes.js ADDED
@@ -0,0 +1,28 @@
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.getSafeL2SingletonDeployment = exports._safeL2Deployments = exports.getSafeSingletonDeployment = exports._safeDeployments = void 0;
7
+ const gnosis_safe_l2_json_1 = __importDefault(require("./assets/v1.3.0/gnosis_safe_l2.json"));
8
+ const gnosis_safe_json_1 = __importDefault(require("./assets/v1.3.0/gnosis_safe.json"));
9
+ const gnosis_safe_json_2 = __importDefault(require("./assets/v1.2.0/gnosis_safe.json"));
10
+ const gnosis_safe_json_3 = __importDefault(require("./assets/v1.1.1/gnosis_safe.json"));
11
+ const gnosis_safe_json_4 = __importDefault(require("./assets/v1.0.0/gnosis_safe.json"));
12
+ const utils_1 = require("./utils");
13
+ // This is a sorted array (newest to oldest), exported for tests
14
+ exports._safeDeployments = [
15
+ gnosis_safe_json_1.default, gnosis_safe_json_2.default, gnosis_safe_json_3.default, gnosis_safe_json_4.default
16
+ ];
17
+ const getSafeSingletonDeployment = (filter) => {
18
+ return utils_1.findDeployment(filter, exports._safeDeployments);
19
+ };
20
+ exports.getSafeSingletonDeployment = getSafeSingletonDeployment;
21
+ // This is a sorted array (newest to oldest), exported for tests
22
+ exports._safeL2Deployments = [
23
+ gnosis_safe_l2_json_1.default
24
+ ];
25
+ const getSafeL2SingletonDeployment = (filter) => {
26
+ return utils_1.findDeployment(filter, exports._safeL2Deployments);
27
+ };
28
+ exports.getSafeL2SingletonDeployment = getSafeL2SingletonDeployment;
@@ -0,0 +1,13 @@
1
+ export interface SingletonDeployment {
2
+ defaultAddress: string;
3
+ version: string;
4
+ abi: any[];
5
+ networkAddresses: Record<string, string>;
6
+ contractName: string;
7
+ released: boolean;
8
+ }
9
+ export interface DeploymentFilter {
10
+ version?: string;
11
+ released?: boolean;
12
+ network?: string;
13
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { DeploymentFilter, SingletonDeployment } from './types';
2
+ export declare const findDeployment: (criteria: DeploymentFilter | undefined, deployments: SingletonDeployment[]) => SingletonDeployment | undefined;
package/dist/utils.js ADDED
@@ -0,0 +1,18 @@
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.findDeployment = void 0;
7
+ const satisfies_1 = __importDefault(require("semver/functions/satisfies"));
8
+ const DEFAULT_FILTER = { released: true };
9
+ const findDeployment = (criteria = DEFAULT_FILTER, deployments) => deployments.find((deployment) => {
10
+ if (criteria.version && !satisfies_1.default(deployment.version, criteria.version))
11
+ return false;
12
+ if (typeof criteria.released === 'boolean' && deployment.released != criteria.released)
13
+ return false;
14
+ if (criteria.network && !deployment.networkAddresses[criteria.network])
15
+ return false;
16
+ return true;
17
+ });
18
+ exports.findDeployment = findDeployment;
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@safe-global/safe-deployments",
3
+ "version": "1.20.1",
4
+ "description": "Collection of Safe singleton deployments",
5
+ "homepage": "https://github.com/safe-global/safe-deployments/",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "typings": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "src",
12
+ "test",
13
+ "build"
14
+ ],
15
+ "scripts": {
16
+ "build": "yarn rimraf dist && tsc",
17
+ "lint": "eslint --max-warnings 0 .",
18
+ "prepack": "yarn build",
19
+ "prepare": "husky install",
20
+ "test": "jest"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/safe-global/safe-deployments.git"
25
+ },
26
+ "keywords": [
27
+ "Ethereum",
28
+ "Wallet",
29
+ "Safe"
30
+ ],
31
+ "author": "richard@gnosis.io",
32
+ "bugs": {
33
+ "url": "https://github.com/safe-global/safe-deployments/issues"
34
+ },
35
+ "devDependencies": {
36
+ "@types/jest": "^27.5.1",
37
+ "@types/node": "^14.14.21",
38
+ "@types/semver": "^7.3.9",
39
+ "@typescript-eslint/eslint-plugin": "^4.7.0",
40
+ "@typescript-eslint/parser": "^4.7.0",
41
+ "eslint": "^7.13.0",
42
+ "eslint-config-prettier": "^6.15.0",
43
+ "eslint-plugin-import": "^2.22.1",
44
+ "eslint-plugin-no-only-tests": "^2.4.0",
45
+ "eslint-plugin-prettier": "^3.1.4",
46
+ "husky": "^5.1.3",
47
+ "jest": "^28.1.0",
48
+ "prettier": "^2.1.2",
49
+ "ts-jest": "^28.0.2",
50
+ "ts-node": "^9.1.1",
51
+ "typescript": "^4.2.4"
52
+ },
53
+ "dependencies": {
54
+ "semver": "^7.3.7"
55
+ }
56
+ }
@@ -0,0 +1,13 @@
1
+ import ProxyFactory130 from '../assets/v1.3.0/proxy_factory.json';
2
+ import ProxyFactory111 from '../assets/v1.1.1/proxy_factory.json';
3
+ import { getProxyFactoryDeployment } from '../factories';
4
+
5
+ describe('factories.ts', () => {
6
+ describe('getProxyFactoryDeployment', () => {
7
+ it('should find the latest deployment first', () => {
8
+ const result = getProxyFactoryDeployment();
9
+ expect(result).toBe(ProxyFactory130);
10
+ expect(result).not.toBe(ProxyFactory111);
11
+ });
12
+ });
13
+ });
@@ -0,0 +1,31 @@
1
+ import DefaultCallbackHandler130 from '../assets/v1.1.1/default_callback_handler.json';
2
+ import CompatibilityFallbackHandler from '../assets/v1.3.0/compatibility_fallback_handler.json';
3
+ import {
4
+ getDefaultCallbackHandlerDeployment,
5
+ getCompatibilityFallbackHandlerDeployment,
6
+ getFallbackHandlerDeployment,
7
+ } from '../handler';
8
+
9
+ describe('handler.ts', () => {
10
+ describe('getDefaultCallbackHandlerDeployment', () => {
11
+ it('should find the preferred deployment first', () => {
12
+ const result = getDefaultCallbackHandlerDeployment();
13
+ expect(result).toBe(DefaultCallbackHandler130);
14
+ });
15
+ });
16
+
17
+ describe('getCompatibilityFallbackHandlerDeployment', () => {
18
+ it('should find the preferred deployment first', () => {
19
+ const result = getCompatibilityFallbackHandlerDeployment();
20
+ expect(result).toBe(CompatibilityFallbackHandler);
21
+ });
22
+ });
23
+
24
+ describe('getFallbackHandlerDeployment', () => {
25
+ it('should find the preferred deployment first', () => {
26
+ const result = getFallbackHandlerDeployment();
27
+ expect(result).toBe(CompatibilityFallbackHandler);
28
+ expect(result).not.toBe(DefaultCallbackHandler130);
29
+ });
30
+ });
31
+ });
@@ -0,0 +1,39 @@
1
+ import CreateCall130 from '../assets/v1.3.0/create_call.json';
2
+ import MultiSend111 from '../assets/v1.1.1/multi_send.json';
3
+ import MultiSend130 from '../assets/v1.3.0/multi_send.json';
4
+ import MultiSendCallOnly130 from '../assets/v1.3.0/multi_send_call_only.json';
5
+ import SignMessageLib130 from '../assets/v1.3.0/sign_message_lib.json';
6
+ import {
7
+ getMultiSendDeployment,
8
+ getMultiSendCallOnlyDeployment,
9
+ getCreateCallDeployment,
10
+ getSignMessageLibDeployment,
11
+ } from '../libs';
12
+
13
+ describe('libs.ts', () => {
14
+ describe('getMultiSendDeployment', () => {
15
+ it('should find the preferred deployment first', () => {
16
+ const result = getMultiSendDeployment();
17
+ expect(result).toBe(MultiSend130);
18
+ expect(result).not.toBe(MultiSend111);
19
+ });
20
+ });
21
+ describe('getMultiSendCallOnlyDeployment', () => {
22
+ it('should find the preferred deployment first', () => {
23
+ const result = getMultiSendCallOnlyDeployment();
24
+ expect(result).toBe(MultiSendCallOnly130);
25
+ });
26
+ });
27
+ describe('getCreateCallDeployment', () => {
28
+ it('should find the preferred deployment first', () => {
29
+ const result = getCreateCallDeployment();
30
+ expect(result).toBe(CreateCall130);
31
+ });
32
+ });
33
+ describe('getSignMessageLibDeployment', () => {
34
+ it('should find the preferred deployment first', () => {
35
+ const result = getSignMessageLibDeployment();
36
+ expect(result).toBe(SignMessageLib130);
37
+ });
38
+ });
39
+ });
@@ -0,0 +1,27 @@
1
+ import GnosisSafeL2130 from '../assets/v1.3.0/gnosis_safe_l2.json';
2
+ import GnosisSafe130 from '../assets/v1.3.0/gnosis_safe.json';
3
+ import GnosisSafe120 from '../assets/v1.2.0/gnosis_safe.json';
4
+ import GnosisSafe111 from '../assets/v1.1.1/gnosis_safe.json';
5
+ import GnosisSafe100 from '../assets/v1.0.0/gnosis_safe.json';
6
+ import {
7
+ getSafeSingletonDeployment,
8
+ getSafeL2SingletonDeployment,
9
+ } from '../safes';
10
+
11
+ describe('safes.ts', () => {
12
+ describe('getSafeSingletonDeployment', () => {
13
+ it('should find the latest deployment first', () => {
14
+ const result = getSafeSingletonDeployment();
15
+ expect(result).toBe(GnosisSafe130);
16
+ [GnosisSafe120, GnosisSafe111, GnosisSafe100].forEach((version) => {
17
+ expect(result).not.toBe(version);
18
+ });
19
+ });
20
+ });
21
+ describe('getSafeL2SingletonDeployment', () => {
22
+ it('should find the latest deployment first', () => {
23
+ const result = getSafeL2SingletonDeployment();
24
+ expect(result).toBe(GnosisSafeL2130);
25
+ });
26
+ });
27
+ });