@safe-global/safe-deployments 1.22.0 → 1.24.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/README.md +2 -0
- package/dist/accessors.d.ts +2 -0
- package/dist/accessors.js +17 -0
- package/dist/assets/v1.3.0/compatibility_fallback_handler.json +5 -0
- package/dist/assets/v1.3.0/create_call.json +5 -0
- package/dist/assets/v1.3.0/gnosis_safe.json +5 -0
- package/dist/assets/v1.3.0/gnosis_safe_l2.json +5 -0
- package/dist/assets/v1.3.0/multi_send.json +5 -0
- package/dist/assets/v1.3.0/multi_send_call_only.json +5 -0
- package/dist/assets/v1.3.0/proxy_factory.json +5 -0
- package/dist/assets/v1.3.0/sign_message_lib.json +5 -0
- package/dist/assets/v1.3.0/simulate_tx_accessor.json +178 -0
- package/dist/assets/v1.4.1/compatibility_fallback_handler.json +334 -0
- package/dist/assets/v1.4.1/create_call.json +81 -0
- package/dist/assets/v1.4.1/multi_send.json +33 -0
- package/dist/assets/v1.4.1/multi_send_call_only.json +28 -0
- package/dist/assets/v1.4.1/safe.json +1010 -0
- package/dist/assets/v1.4.1/safe_l2.json +1115 -0
- package/dist/assets/v1.4.1/safe_proxy_factory.json +152 -0
- package/dist/assets/v1.4.1/sign_message_lib.json +58 -0
- package/dist/assets/v1.4.1/simulate_tx_accessor.json +64 -0
- package/dist/factories.d.ts +1 -1
- package/dist/factories.js +3 -2
- package/dist/handler.d.ts +3 -3
- package/dist/handler.js +6 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/dist/libs.d.ts +4 -4
- package/dist/libs.js +12 -8
- package/dist/safes.d.ts +2 -2
- package/dist/safes.js +6 -4
- package/dist/utils.js +12 -9
- package/package.json +2 -2
- package/src/__tests__/utilts.test.ts +60 -17
- package/src/accessors.ts +14 -0
- package/src/assets/v1.3.0/compatibility_fallback_handler.json +5 -0
- package/src/assets/v1.3.0/create_call.json +5 -0
- package/src/assets/v1.3.0/gnosis_safe.json +5 -0
- package/src/assets/v1.3.0/gnosis_safe_l2.json +5 -0
- package/src/assets/v1.3.0/multi_send.json +5 -0
- package/src/assets/v1.3.0/multi_send_call_only.json +5 -0
- package/src/assets/v1.3.0/proxy_factory.json +5 -0
- package/src/assets/v1.3.0/sign_message_lib.json +5 -0
- package/src/assets/v1.3.0/simulate_tx_accessor.json +6 -1
- package/src/assets/v1.4.1/compatibility_fallback_handler.json +334 -0
- package/src/assets/v1.4.1/create_call.json +81 -0
- package/src/assets/v1.4.1/multi_send.json +33 -0
- package/src/assets/v1.4.1/multi_send_call_only.json +28 -0
- package/src/assets/v1.4.1/safe.json +1010 -0
- package/src/assets/v1.4.1/safe_l2.json +1115 -0
- package/src/assets/v1.4.1/safe_proxy_factory.json +152 -0
- package/src/assets/v1.4.1/sign_message_lib.json +58 -0
- package/src/assets/v1.4.1/simulate_tx_accessor.json +64 -0
- package/src/factories.ts +4 -2
- package/src/handler.ts +5 -4
- package/src/index.ts +2 -1
- package/src/libs.ts +9 -5
- package/src/safes.ts +5 -3
- package/src/utils.ts +10 -6
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultAddress": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
3
|
+
"contractName": "SafeProxyFactory",
|
|
4
|
+
"version": "1.4.1",
|
|
5
|
+
"released": false,
|
|
6
|
+
"networkAddresses": {
|
|
7
|
+
"1": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
8
|
+
"5": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
9
|
+
"56": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
10
|
+
"100": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
11
|
+
"80001": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
12
|
+
},
|
|
13
|
+
"abi": [
|
|
14
|
+
{
|
|
15
|
+
"anonymous": false,
|
|
16
|
+
"inputs": [
|
|
17
|
+
{
|
|
18
|
+
"indexed": true,
|
|
19
|
+
"internalType": "contract SafeProxy",
|
|
20
|
+
"name": "proxy",
|
|
21
|
+
"type": "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"indexed": false,
|
|
25
|
+
"internalType": "address",
|
|
26
|
+
"name": "singleton",
|
|
27
|
+
"type": "address"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"name": "ProxyCreation",
|
|
31
|
+
"type": "event"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"inputs": [
|
|
35
|
+
{
|
|
36
|
+
"internalType": "address",
|
|
37
|
+
"name": "_singleton",
|
|
38
|
+
"type": "address"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"internalType": "bytes",
|
|
42
|
+
"name": "initializer",
|
|
43
|
+
"type": "bytes"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"internalType": "uint256",
|
|
47
|
+
"name": "saltNonce",
|
|
48
|
+
"type": "uint256"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"name": "createChainSpecificProxyWithNonce",
|
|
52
|
+
"outputs": [
|
|
53
|
+
{
|
|
54
|
+
"internalType": "contract SafeProxy",
|
|
55
|
+
"name": "proxy",
|
|
56
|
+
"type": "address"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"stateMutability": "nonpayable",
|
|
60
|
+
"type": "function"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"inputs": [
|
|
64
|
+
{
|
|
65
|
+
"internalType": "address",
|
|
66
|
+
"name": "_singleton",
|
|
67
|
+
"type": "address"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"internalType": "bytes",
|
|
71
|
+
"name": "initializer",
|
|
72
|
+
"type": "bytes"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"internalType": "uint256",
|
|
76
|
+
"name": "saltNonce",
|
|
77
|
+
"type": "uint256"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"internalType": "contract IProxyCreationCallback",
|
|
81
|
+
"name": "callback",
|
|
82
|
+
"type": "address"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"name": "createProxyWithCallback",
|
|
86
|
+
"outputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "contract SafeProxy",
|
|
89
|
+
"name": "proxy",
|
|
90
|
+
"type": "address"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"stateMutability": "nonpayable",
|
|
94
|
+
"type": "function"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"inputs": [
|
|
98
|
+
{
|
|
99
|
+
"internalType": "address",
|
|
100
|
+
"name": "_singleton",
|
|
101
|
+
"type": "address"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"internalType": "bytes",
|
|
105
|
+
"name": "initializer",
|
|
106
|
+
"type": "bytes"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"internalType": "uint256",
|
|
110
|
+
"name": "saltNonce",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"name": "createProxyWithNonce",
|
|
115
|
+
"outputs": [
|
|
116
|
+
{
|
|
117
|
+
"internalType": "contract SafeProxy",
|
|
118
|
+
"name": "proxy",
|
|
119
|
+
"type": "address"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"stateMutability": "nonpayable",
|
|
123
|
+
"type": "function"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"inputs": [],
|
|
127
|
+
"name": "getChainId",
|
|
128
|
+
"outputs": [
|
|
129
|
+
{
|
|
130
|
+
"internalType": "uint256",
|
|
131
|
+
"name": "",
|
|
132
|
+
"type": "uint256"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"stateMutability": "view",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inputs": [],
|
|
140
|
+
"name": "proxyCreationCode",
|
|
141
|
+
"outputs": [
|
|
142
|
+
{
|
|
143
|
+
"internalType": "bytes",
|
|
144
|
+
"name": "",
|
|
145
|
+
"type": "bytes"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"stateMutability": "pure",
|
|
149
|
+
"type": "function"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultAddress": "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",
|
|
3
|
+
"contractName": "SignMessageLib",
|
|
4
|
+
"version": "1.4.1",
|
|
5
|
+
"released": false,
|
|
6
|
+
"networkAddresses": {
|
|
7
|
+
"1": "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",
|
|
8
|
+
"100": "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",
|
|
9
|
+
"80001": "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9"
|
|
10
|
+
},
|
|
11
|
+
"abi": [
|
|
12
|
+
{
|
|
13
|
+
"anonymous": false,
|
|
14
|
+
"inputs": [
|
|
15
|
+
{
|
|
16
|
+
"indexed": true,
|
|
17
|
+
"internalType": "bytes32",
|
|
18
|
+
"name": "msgHash",
|
|
19
|
+
"type": "bytes32"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"name": "SignMsg",
|
|
23
|
+
"type": "event"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"inputs": [
|
|
27
|
+
{
|
|
28
|
+
"internalType": "bytes",
|
|
29
|
+
"name": "message",
|
|
30
|
+
"type": "bytes"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"name": "getMessageHash",
|
|
34
|
+
"outputs": [
|
|
35
|
+
{
|
|
36
|
+
"internalType": "bytes32",
|
|
37
|
+
"name": "",
|
|
38
|
+
"type": "bytes32"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"stateMutability": "view",
|
|
42
|
+
"type": "function"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"inputs": [
|
|
46
|
+
{
|
|
47
|
+
"internalType": "bytes",
|
|
48
|
+
"name": "_data",
|
|
49
|
+
"type": "bytes"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"name": "signMessage",
|
|
53
|
+
"outputs": [],
|
|
54
|
+
"stateMutability": "nonpayable",
|
|
55
|
+
"type": "function"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultAddress": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
|
|
3
|
+
"released": false,
|
|
4
|
+
"contractName": "SimulateTxAccessor",
|
|
5
|
+
"version": "1.4.1",
|
|
6
|
+
"networkAddresses": {
|
|
7
|
+
"1": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
|
|
8
|
+
"5": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
|
|
9
|
+
"56": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
|
|
10
|
+
"100": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
|
|
11
|
+
"80001": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199"
|
|
12
|
+
},
|
|
13
|
+
"abi": [
|
|
14
|
+
{
|
|
15
|
+
"inputs": [],
|
|
16
|
+
"stateMutability": "nonpayable",
|
|
17
|
+
"type": "constructor"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"inputs": [
|
|
21
|
+
{
|
|
22
|
+
"internalType": "address",
|
|
23
|
+
"name": "to",
|
|
24
|
+
"type": "address"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"internalType": "uint256",
|
|
28
|
+
"name": "value",
|
|
29
|
+
"type": "uint256"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"internalType": "bytes",
|
|
33
|
+
"name": "data",
|
|
34
|
+
"type": "bytes"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "enum Enum.Operation",
|
|
38
|
+
"name": "operation",
|
|
39
|
+
"type": "uint8"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": "simulate",
|
|
43
|
+
"outputs": [
|
|
44
|
+
{
|
|
45
|
+
"internalType": "uint256",
|
|
46
|
+
"name": "estimate",
|
|
47
|
+
"type": "uint256"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"internalType": "bool",
|
|
51
|
+
"name": "success",
|
|
52
|
+
"type": "bool"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"internalType": "bytes",
|
|
56
|
+
"name": "returnData",
|
|
57
|
+
"type": "bytes"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"stateMutability": "nonpayable",
|
|
61
|
+
"type": "function"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
package/dist/factories.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentFilter, SingletonDeployment } from './types';
|
|
2
|
-
export declare const getProxyFactoryDeployment: (filter?: DeploymentFilter
|
|
2
|
+
export declare const getProxyFactoryDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
package/dist/factories.js
CHANGED
|
@@ -7,12 +7,13 @@ exports.getProxyFactoryDeployment = void 0;
|
|
|
7
7
|
const proxy_factory_json_1 = __importDefault(require("./assets/v1.0.0/proxy_factory.json"));
|
|
8
8
|
const proxy_factory_json_2 = __importDefault(require("./assets/v1.1.1/proxy_factory.json"));
|
|
9
9
|
const proxy_factory_json_3 = __importDefault(require("./assets/v1.3.0/proxy_factory.json"));
|
|
10
|
+
const safe_proxy_factory_json_1 = __importDefault(require("./assets/v1.4.1/safe_proxy_factory.json"));
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
// This is a sorted array (newest to oldest)
|
|
12
13
|
const factoryDeployments = [
|
|
13
|
-
proxy_factory_json_3.default, proxy_factory_json_2.default, proxy_factory_json_1.default
|
|
14
|
+
safe_proxy_factory_json_1.default, proxy_factory_json_3.default, proxy_factory_json_2.default, proxy_factory_json_1.default
|
|
14
15
|
];
|
|
15
16
|
const getProxyFactoryDeployment = (filter) => {
|
|
16
|
-
return utils_1.findDeployment(filter, factoryDeployments);
|
|
17
|
+
return (0, utils_1.findDeployment)(filter, factoryDeployments);
|
|
17
18
|
};
|
|
18
19
|
exports.getProxyFactoryDeployment = getProxyFactoryDeployment;
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DeploymentFilter, SingletonDeployment } from './types';
|
|
2
|
-
export declare const getDefaultCallbackHandlerDeployment: (filter?: DeploymentFilter
|
|
3
|
-
export declare const getCompatibilityFallbackHandlerDeployment: (filter?: DeploymentFilter
|
|
4
|
-
export declare const getFallbackHandlerDeployment: (filter?: DeploymentFilter
|
|
2
|
+
export declare const getDefaultCallbackHandlerDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
3
|
+
export declare const getCompatibilityFallbackHandlerDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
4
|
+
export declare const getFallbackHandlerDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
package/dist/handler.js
CHANGED
|
@@ -6,28 +6,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getFallbackHandlerDeployment = exports.getCompatibilityFallbackHandlerDeployment = exports.getDefaultCallbackHandlerDeployment = void 0;
|
|
7
7
|
const default_callback_handler_json_1 = __importDefault(require("./assets/v1.1.1/default_callback_handler.json"));
|
|
8
8
|
const compatibility_fallback_handler_json_1 = __importDefault(require("./assets/v1.3.0/compatibility_fallback_handler.json"));
|
|
9
|
+
const compatibility_fallback_handler_json_2 = __importDefault(require("./assets/v1.4.1/compatibility_fallback_handler.json"));
|
|
9
10
|
const utils_1 = require("./utils");
|
|
10
11
|
// This is a sorted array (by preference)
|
|
11
12
|
const defaultCallbackHandlerDeployments = [
|
|
12
13
|
default_callback_handler_json_1.default
|
|
13
14
|
];
|
|
14
15
|
const getDefaultCallbackHandlerDeployment = (filter) => {
|
|
15
|
-
return utils_1.findDeployment(filter, defaultCallbackHandlerDeployments);
|
|
16
|
+
return (0, utils_1.findDeployment)(filter, defaultCallbackHandlerDeployments);
|
|
16
17
|
};
|
|
17
18
|
exports.getDefaultCallbackHandlerDeployment = getDefaultCallbackHandlerDeployment;
|
|
18
19
|
// This is a sorted array (by preference)
|
|
19
20
|
const compatFallbackHandlerDeployments = [
|
|
20
|
-
compatibility_fallback_handler_json_1.default
|
|
21
|
+
compatibility_fallback_handler_json_2.default, compatibility_fallback_handler_json_1.default
|
|
21
22
|
];
|
|
22
23
|
const getCompatibilityFallbackHandlerDeployment = (filter) => {
|
|
23
|
-
return utils_1.findDeployment(filter, compatFallbackHandlerDeployments);
|
|
24
|
+
return (0, utils_1.findDeployment)(filter, compatFallbackHandlerDeployments);
|
|
24
25
|
};
|
|
25
26
|
exports.getCompatibilityFallbackHandlerDeployment = getCompatibilityFallbackHandlerDeployment;
|
|
26
27
|
// This is a sorted array (by preference)
|
|
27
28
|
const fallbackHandlerDeployments = [
|
|
28
|
-
compatibility_fallback_handler_json_1.default, default_callback_handler_json_1.default
|
|
29
|
+
compatibility_fallback_handler_json_2.default, compatibility_fallback_handler_json_1.default, default_callback_handler_json_1.default
|
|
29
30
|
];
|
|
30
31
|
const getFallbackHandlerDeployment = (filter) => {
|
|
31
|
-
return utils_1.findDeployment(filter, fallbackHandlerDeployments);
|
|
32
|
+
return (0, utils_1.findDeployment)(filter, fallbackHandlerDeployments);
|
|
32
33
|
};
|
|
33
34
|
exports.getFallbackHandlerDeployment = getFallbackHandlerDeployment;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -15,3 +19,4 @@ __exportStar(require("./safes"), exports);
|
|
|
15
19
|
__exportStar(require("./factories"), exports);
|
|
16
20
|
__exportStar(require("./libs"), exports);
|
|
17
21
|
__exportStar(require("./handler"), exports);
|
|
22
|
+
__exportStar(require("./accessors"), exports);
|
package/dist/libs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeploymentFilter, SingletonDeployment } from './types';
|
|
2
|
-
export declare const getMultiSendDeployment: (filter?: DeploymentFilter
|
|
3
|
-
export declare const getMultiSendCallOnlyDeployment: (filter?: DeploymentFilter
|
|
4
|
-
export declare const getCreateCallDeployment: (filter?: DeploymentFilter
|
|
5
|
-
export declare const getSignMessageLibDeployment: (filter?: DeploymentFilter
|
|
2
|
+
export declare const getMultiSendDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
3
|
+
export declare const getMultiSendCallOnlyDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
4
|
+
export declare const getCreateCallDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
5
|
+
export declare const getSignMessageLibDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
package/dist/libs.js
CHANGED
|
@@ -5,39 +5,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSignMessageLibDeployment = exports.getCreateCallDeployment = exports.getMultiSendCallOnlyDeployment = exports.getMultiSendDeployment = void 0;
|
|
7
7
|
const create_call_json_1 = __importDefault(require("./assets/v1.3.0/create_call.json"));
|
|
8
|
+
const create_call_json_2 = __importDefault(require("./assets/v1.4.1/create_call.json"));
|
|
8
9
|
const multi_send_json_1 = __importDefault(require("./assets/v1.1.1/multi_send.json"));
|
|
9
10
|
const multi_send_json_2 = __importDefault(require("./assets/v1.3.0/multi_send.json"));
|
|
11
|
+
const multi_send_json_3 = __importDefault(require("./assets/v1.4.1/multi_send.json"));
|
|
10
12
|
const multi_send_call_only_json_1 = __importDefault(require("./assets/v1.3.0/multi_send_call_only.json"));
|
|
13
|
+
const multi_send_call_only_json_2 = __importDefault(require("./assets/v1.4.1/multi_send_call_only.json"));
|
|
11
14
|
const sign_message_lib_json_1 = __importDefault(require("./assets/v1.3.0/sign_message_lib.json"));
|
|
15
|
+
const sign_message_lib_json_2 = __importDefault(require("./assets/v1.4.1/sign_message_lib.json"));
|
|
12
16
|
const utils_1 = require("./utils");
|
|
13
17
|
// This is a sorted array (by preference, currently we use 111 in most cases)
|
|
14
18
|
const multiSendDeployments = [
|
|
15
|
-
multi_send_json_2.default, multi_send_json_1.default
|
|
19
|
+
multi_send_json_3.default, multi_send_json_2.default, multi_send_json_1.default
|
|
16
20
|
];
|
|
17
21
|
const getMultiSendDeployment = (filter) => {
|
|
18
|
-
return utils_1.findDeployment(filter, multiSendDeployments);
|
|
22
|
+
return (0, utils_1.findDeployment)(filter, multiSendDeployments);
|
|
19
23
|
};
|
|
20
24
|
exports.getMultiSendDeployment = getMultiSendDeployment;
|
|
21
25
|
// This is a sorted array (by preference)
|
|
22
26
|
const multiSendCallOnlyDeployments = [
|
|
23
|
-
multi_send_call_only_json_1.default
|
|
27
|
+
multi_send_call_only_json_2.default, multi_send_call_only_json_1.default
|
|
24
28
|
];
|
|
25
29
|
const getMultiSendCallOnlyDeployment = (filter) => {
|
|
26
|
-
return utils_1.findDeployment(filter, multiSendCallOnlyDeployments);
|
|
30
|
+
return (0, utils_1.findDeployment)(filter, multiSendCallOnlyDeployments);
|
|
27
31
|
};
|
|
28
32
|
exports.getMultiSendCallOnlyDeployment = getMultiSendCallOnlyDeployment;
|
|
29
33
|
// This is a sorted array (by preference)
|
|
30
34
|
const createCallDeployments = [
|
|
31
|
-
create_call_json_1.default
|
|
35
|
+
create_call_json_2.default, create_call_json_1.default
|
|
32
36
|
];
|
|
33
37
|
const getCreateCallDeployment = (filter) => {
|
|
34
|
-
return utils_1.findDeployment(filter, createCallDeployments);
|
|
38
|
+
return (0, utils_1.findDeployment)(filter, createCallDeployments);
|
|
35
39
|
};
|
|
36
40
|
exports.getCreateCallDeployment = getCreateCallDeployment;
|
|
37
41
|
const signMessageLibDeployments = [
|
|
38
|
-
sign_message_lib_json_1.default
|
|
42
|
+
sign_message_lib_json_2.default, sign_message_lib_json_1.default
|
|
39
43
|
];
|
|
40
44
|
const getSignMessageLibDeployment = (filter) => {
|
|
41
|
-
return utils_1.findDeployment(filter, signMessageLibDeployments);
|
|
45
|
+
return (0, utils_1.findDeployment)(filter, signMessageLibDeployments);
|
|
42
46
|
};
|
|
43
47
|
exports.getSignMessageLibDeployment = getSignMessageLibDeployment;
|
package/dist/safes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeploymentFilter, SingletonDeployment } from './types';
|
|
2
2
|
export declare const _safeDeployments: SingletonDeployment[];
|
|
3
|
-
export declare const getSafeSingletonDeployment: (filter?: DeploymentFilter
|
|
3
|
+
export declare const getSafeSingletonDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
|
4
4
|
export declare const _safeL2Deployments: SingletonDeployment[];
|
|
5
|
-
export declare const getSafeL2SingletonDeployment: (filter?: DeploymentFilter
|
|
5
|
+
export declare const getSafeL2SingletonDeployment: (filter?: DeploymentFilter) => SingletonDeployment | undefined;
|
package/dist/safes.js
CHANGED
|
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSafeL2SingletonDeployment = exports._safeL2Deployments = exports.getSafeSingletonDeployment = exports._safeDeployments = void 0;
|
|
7
|
+
const safe_l2_json_1 = __importDefault(require("./assets/v1.4.1/safe_l2.json"));
|
|
8
|
+
const safe_json_1 = __importDefault(require("./assets/v1.4.1/safe.json"));
|
|
7
9
|
const gnosis_safe_l2_json_1 = __importDefault(require("./assets/v1.3.0/gnosis_safe_l2.json"));
|
|
8
10
|
const gnosis_safe_json_1 = __importDefault(require("./assets/v1.3.0/gnosis_safe.json"));
|
|
9
11
|
const gnosis_safe_json_2 = __importDefault(require("./assets/v1.2.0/gnosis_safe.json"));
|
|
@@ -12,17 +14,17 @@ const gnosis_safe_json_4 = __importDefault(require("./assets/v1.0.0/gnosis_safe.
|
|
|
12
14
|
const utils_1 = require("./utils");
|
|
13
15
|
// This is a sorted array (newest to oldest), exported for tests
|
|
14
16
|
exports._safeDeployments = [
|
|
15
|
-
gnosis_safe_json_1.default, gnosis_safe_json_2.default, gnosis_safe_json_3.default, gnosis_safe_json_4.default
|
|
17
|
+
safe_json_1.default, gnosis_safe_json_1.default, gnosis_safe_json_2.default, gnosis_safe_json_3.default, gnosis_safe_json_4.default
|
|
16
18
|
];
|
|
17
19
|
const getSafeSingletonDeployment = (filter) => {
|
|
18
|
-
return utils_1.findDeployment(filter, exports._safeDeployments);
|
|
20
|
+
return (0, utils_1.findDeployment)(filter, exports._safeDeployments);
|
|
19
21
|
};
|
|
20
22
|
exports.getSafeSingletonDeployment = getSafeSingletonDeployment;
|
|
21
23
|
// This is a sorted array (newest to oldest), exported for tests
|
|
22
24
|
exports._safeL2Deployments = [
|
|
23
|
-
gnosis_safe_l2_json_1.default
|
|
25
|
+
safe_l2_json_1.default, gnosis_safe_l2_json_1.default
|
|
24
26
|
];
|
|
25
27
|
const getSafeL2SingletonDeployment = (filter) => {
|
|
26
|
-
return utils_1.findDeployment(filter, exports._safeL2Deployments);
|
|
28
|
+
return (0, utils_1.findDeployment)(filter, exports._safeL2Deployments);
|
|
27
29
|
};
|
|
28
30
|
exports.getSafeL2SingletonDeployment = getSafeL2SingletonDeployment;
|
package/dist/utils.js
CHANGED
|
@@ -6,13 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.findDeployment = void 0;
|
|
7
7
|
const satisfies_1 = __importDefault(require("semver/functions/satisfies"));
|
|
8
8
|
const DEFAULT_FILTER = { released: true };
|
|
9
|
-
const findDeployment = (criteria = DEFAULT_FILTER, deployments) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const findDeployment = (criteria = DEFAULT_FILTER, deployments) => {
|
|
10
|
+
const criteriaWithDefaults = Object.assign(Object.assign({}, DEFAULT_FILTER), criteria);
|
|
11
|
+
return deployments.find((deployment) => {
|
|
12
|
+
if (typeof criteriaWithDefaults.version !== 'undefined' && !(0, satisfies_1.default)(deployment.version, criteriaWithDefaults.version))
|
|
13
|
+
return false;
|
|
14
|
+
if (typeof criteriaWithDefaults.released === 'boolean' && deployment.released != criteriaWithDefaults.released)
|
|
15
|
+
return false;
|
|
16
|
+
if (criteriaWithDefaults.network && !deployment.networkAddresses[criteriaWithDefaults.network])
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
18
21
|
exports.findDeployment = findDeployment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safe-global/safe-deployments",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Collection of Safe singleton deployments",
|
|
5
5
|
"homepage": "https://github.com/safe-global/safe-deployments/",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"prettier": "^2.1.2",
|
|
49
49
|
"ts-jest": "^28.0.2",
|
|
50
50
|
"ts-node": "^9.1.1",
|
|
51
|
-
"typescript": "^4.
|
|
51
|
+
"typescript": "^4.9.4"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"semver": "^7.3.7"
|
|
@@ -16,7 +16,7 @@ describe('utils.ts', () => {
|
|
|
16
16
|
defaultAddress: '',
|
|
17
17
|
version: '',
|
|
18
18
|
abi: [],
|
|
19
|
-
networkAddresses: {},
|
|
19
|
+
networkAddresses: { "1": "0xbeef" },
|
|
20
20
|
contractName: '',
|
|
21
21
|
released: false,
|
|
22
22
|
};
|
|
@@ -24,7 +24,7 @@ describe('utils.ts', () => {
|
|
|
24
24
|
defaultAddress: '',
|
|
25
25
|
version: '',
|
|
26
26
|
abi: [],
|
|
27
|
-
networkAddresses: {},
|
|
27
|
+
networkAddresses: { "1": "0xbeef" },
|
|
28
28
|
contractName: '',
|
|
29
29
|
released: true, // Default filter value
|
|
30
30
|
};
|
|
@@ -38,6 +38,11 @@ describe('utils.ts', () => {
|
|
|
38
38
|
expect(findDeployment(undefined, testDeployments)).toBe(
|
|
39
39
|
testReleasedDeployment
|
|
40
40
|
);
|
|
41
|
+
|
|
42
|
+
// should preserve the released flag even if its not explicitly passed
|
|
43
|
+
expect(findDeployment({ network: '1' }, testDeployments)).toBe(
|
|
44
|
+
testReleasedDeployment
|
|
45
|
+
)
|
|
41
46
|
});
|
|
42
47
|
it('should return the correct deployment (filtered by version)', () => {
|
|
43
48
|
// Chronological deployments
|
|
@@ -67,33 +72,48 @@ describe('utils.ts', () => {
|
|
|
67
72
|
findDeployment({ version: '2.0.0+L2' }, _safeL2Deployments)
|
|
68
73
|
).toBeUndefined();
|
|
69
74
|
});
|
|
70
|
-
it('should return the correct deployment (filtered by
|
|
75
|
+
it('should return the correct deployment (filtered by released flag)', () => {
|
|
76
|
+
const testUnreleasedDeployment: SingletonDeployment = {
|
|
77
|
+
defaultAddress: '',
|
|
78
|
+
version: '',
|
|
79
|
+
abi: [],
|
|
80
|
+
networkAddresses: { "1": "0xbeef" },
|
|
81
|
+
contractName: '',
|
|
82
|
+
released: false,
|
|
83
|
+
};
|
|
84
|
+
const testReleasedDeployment: SingletonDeployment = {
|
|
85
|
+
defaultAddress: '',
|
|
86
|
+
version: '',
|
|
87
|
+
abi: [],
|
|
88
|
+
networkAddresses: { "1": "0xbeef" },
|
|
89
|
+
contractName: '',
|
|
90
|
+
released: true, // Default filter value
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const testDeployments = [
|
|
94
|
+
testUnreleasedDeployment,
|
|
95
|
+
testReleasedDeployment,
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
|
|
71
99
|
// Chronological deployments
|
|
72
100
|
expect(findDeployment({ released: true }, _safeDeployments)).toBe(
|
|
73
101
|
GnosisSafe130
|
|
74
102
|
);
|
|
75
|
-
// Incorrect filter:
|
|
76
|
-
expect(
|
|
77
|
-
findDeployment({ released: false }, _safeDeployments)
|
|
78
|
-
).toBeUndefined();
|
|
79
103
|
|
|
80
104
|
// Reverse chronological deployments
|
|
81
105
|
expect(findDeployment({ released: true }, _safeDeploymentsReverse)).toBe(
|
|
82
106
|
GnosisSafe100
|
|
83
107
|
);
|
|
84
|
-
//
|
|
108
|
+
// Released flag set to false:
|
|
85
109
|
expect(
|
|
86
|
-
findDeployment({ released: false },
|
|
87
|
-
).
|
|
110
|
+
findDeployment({ released: false }, testDeployments)
|
|
111
|
+
).toBe(testUnreleasedDeployment);
|
|
88
112
|
|
|
89
113
|
// L2 deployments
|
|
90
114
|
expect(findDeployment({ released: true }, _safeL2Deployments)).toBe(
|
|
91
115
|
GnosisSafeL2130
|
|
92
116
|
);
|
|
93
|
-
// Incorrect filter:
|
|
94
|
-
expect(
|
|
95
|
-
findDeployment({ released: false }, _safeL2Deployments)
|
|
96
|
-
).toBeUndefined();
|
|
97
117
|
});
|
|
98
118
|
|
|
99
119
|
it('should return the correct deployment (filtered by network)', () => {
|
|
@@ -211,6 +231,29 @@ describe('utils.ts', () => {
|
|
|
211
231
|
).toBeUndefined();
|
|
212
232
|
});
|
|
213
233
|
it('should return the correct deployment (filtered by released and network)', () => {
|
|
234
|
+
const testUnreleasedDeployment: SingletonDeployment = {
|
|
235
|
+
defaultAddress: '',
|
|
236
|
+
version: '',
|
|
237
|
+
abi: [],
|
|
238
|
+
networkAddresses: { "1": "0xbeef" },
|
|
239
|
+
contractName: '',
|
|
240
|
+
released: false,
|
|
241
|
+
};
|
|
242
|
+
const testReleasedDeployment: SingletonDeployment = {
|
|
243
|
+
defaultAddress: '',
|
|
244
|
+
version: '',
|
|
245
|
+
abi: [],
|
|
246
|
+
networkAddresses: { "1": "0xbeef" },
|
|
247
|
+
contractName: '',
|
|
248
|
+
released: true, // Default filter value
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const testDeployments = [
|
|
252
|
+
testUnreleasedDeployment,
|
|
253
|
+
testUnreleasedDeployment,
|
|
254
|
+
testReleasedDeployment,
|
|
255
|
+
];
|
|
256
|
+
|
|
214
257
|
// Reverse chronological deployments
|
|
215
258
|
expect(
|
|
216
259
|
findDeployment(
|
|
@@ -240,9 +283,9 @@ describe('utils.ts', () => {
|
|
|
240
283
|
expect(
|
|
241
284
|
findDeployment(
|
|
242
285
|
{ released: false, network: '1' },
|
|
243
|
-
|
|
286
|
+
testDeployments
|
|
244
287
|
)
|
|
245
|
-
).
|
|
288
|
+
).toBe(testUnreleasedDeployment);
|
|
246
289
|
|
|
247
290
|
// L2 deployments
|
|
248
291
|
expect(
|
|
@@ -253,7 +296,7 @@ describe('utils.ts', () => {
|
|
|
253
296
|
findDeployment({ released: true, network: '0' }, _safeL2Deployments)
|
|
254
297
|
).toBeUndefined();
|
|
255
298
|
expect(
|
|
256
|
-
findDeployment({ released: false, network: '100' },
|
|
299
|
+
findDeployment({ released: false, network: '100' }, testDeployments)
|
|
257
300
|
).toBeUndefined();
|
|
258
301
|
});
|
|
259
302
|
it('should return the correct deployment (filtered by version, released and network)', () => {
|