@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/src/factories.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import ProxyFactory100 from './assets/v1.0.0/proxy_factory.json'
|
|
2
2
|
import ProxyFactory111 from './assets/v1.1.1/proxy_factory.json'
|
|
3
3
|
import ProxyFactory130 from './assets/v1.3.0/proxy_factory.json'
|
|
4
|
+
import SafeProxyFactory141 from './assets/v1.4.1/safe_proxy_factory.json'
|
|
5
|
+
|
|
4
6
|
import { DeploymentFilter, SingletonDeployment } from './types'
|
|
5
7
|
import { findDeployment } from './utils'
|
|
6
8
|
|
|
7
9
|
// This is a sorted array (newest to oldest)
|
|
8
10
|
const factoryDeployments: SingletonDeployment[] = [
|
|
9
|
-
ProxyFactory130, ProxyFactory111, ProxyFactory100
|
|
11
|
+
SafeProxyFactory141, ProxyFactory130, ProxyFactory111, ProxyFactory100
|
|
10
12
|
]
|
|
11
13
|
|
|
12
14
|
export const getProxyFactoryDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
13
15
|
return findDeployment(filter, factoryDeployments)
|
|
14
|
-
}
|
|
16
|
+
}
|
package/src/handler.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import DefaultCallbackHandler130 from './assets/v1.1.1/default_callback_handler.json'
|
|
2
|
-
import
|
|
2
|
+
import CompatibilityFallbackHandler130 from './assets/v1.3.0/compatibility_fallback_handler.json'
|
|
3
|
+
import CompatibilityFallbackHandler141 from './assets/v1.4.1/compatibility_fallback_handler.json'
|
|
3
4
|
import { DeploymentFilter, SingletonDeployment } from './types'
|
|
4
5
|
import { findDeployment } from './utils'
|
|
5
6
|
|
|
@@ -14,7 +15,7 @@ export const getDefaultCallbackHandlerDeployment = (filter?: DeploymentFilter):
|
|
|
14
15
|
|
|
15
16
|
// This is a sorted array (by preference)
|
|
16
17
|
const compatFallbackHandlerDeployments: SingletonDeployment[] = [
|
|
17
|
-
|
|
18
|
+
CompatibilityFallbackHandler141, CompatibilityFallbackHandler130
|
|
18
19
|
]
|
|
19
20
|
|
|
20
21
|
export const getCompatibilityFallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
@@ -23,9 +24,9 @@ export const getCompatibilityFallbackHandlerDeployment = (filter?: DeploymentFil
|
|
|
23
24
|
|
|
24
25
|
// This is a sorted array (by preference)
|
|
25
26
|
const fallbackHandlerDeployments: SingletonDeployment[] = [
|
|
26
|
-
|
|
27
|
+
CompatibilityFallbackHandler141, CompatibilityFallbackHandler130, DefaultCallbackHandler130
|
|
27
28
|
]
|
|
28
29
|
|
|
29
30
|
export const getFallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
30
31
|
return findDeployment(filter, fallbackHandlerDeployments)
|
|
31
|
-
}
|
|
32
|
+
}
|
package/src/index.ts
CHANGED
package/src/libs.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import CreateCall130 from './assets/v1.3.0/create_call.json'
|
|
2
|
+
import CreateCall141 from './assets/v1.4.1/create_call.json'
|
|
2
3
|
import MultiSend111 from './assets/v1.1.1/multi_send.json'
|
|
3
4
|
import MultiSend130 from './assets/v1.3.0/multi_send.json'
|
|
5
|
+
import MultiSend141 from './assets/v1.4.1/multi_send.json'
|
|
4
6
|
import MultiSendCallOnly130 from './assets/v1.3.0/multi_send_call_only.json'
|
|
7
|
+
import MultiSendCallOnly141 from './assets/v1.4.1/multi_send_call_only.json'
|
|
5
8
|
import SignMessageLib130 from './assets/v1.3.0/sign_message_lib.json'
|
|
9
|
+
import SignMessageLib141 from './assets/v1.4.1/sign_message_lib.json'
|
|
6
10
|
import { DeploymentFilter, SingletonDeployment } from './types'
|
|
7
11
|
import { findDeployment } from './utils'
|
|
8
12
|
|
|
9
13
|
// This is a sorted array (by preference, currently we use 111 in most cases)
|
|
10
14
|
const multiSendDeployments: SingletonDeployment[] = [
|
|
11
|
-
MultiSend130, MultiSend111
|
|
15
|
+
MultiSend141, MultiSend130, MultiSend111
|
|
12
16
|
]
|
|
13
17
|
|
|
14
18
|
export const getMultiSendDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
@@ -17,7 +21,7 @@ export const getMultiSendDeployment = (filter?: DeploymentFilter): SingletonDepl
|
|
|
17
21
|
|
|
18
22
|
// This is a sorted array (by preference)
|
|
19
23
|
const multiSendCallOnlyDeployments: SingletonDeployment[] = [
|
|
20
|
-
MultiSendCallOnly130
|
|
24
|
+
MultiSendCallOnly141, MultiSendCallOnly130
|
|
21
25
|
]
|
|
22
26
|
|
|
23
27
|
export const getMultiSendCallOnlyDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
@@ -26,7 +30,7 @@ export const getMultiSendCallOnlyDeployment = (filter?: DeploymentFilter): Singl
|
|
|
26
30
|
|
|
27
31
|
// This is a sorted array (by preference)
|
|
28
32
|
const createCallDeployments: SingletonDeployment[] = [
|
|
29
|
-
CreateCall130
|
|
33
|
+
CreateCall141, CreateCall130
|
|
30
34
|
]
|
|
31
35
|
|
|
32
36
|
export const getCreateCallDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
@@ -34,9 +38,9 @@ export const getCreateCallDeployment = (filter?: DeploymentFilter): SingletonDep
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
const signMessageLibDeployments: SingletonDeployment[] = [
|
|
37
|
-
SignMessageLib130
|
|
41
|
+
SignMessageLib141, SignMessageLib130
|
|
38
42
|
]
|
|
39
43
|
|
|
40
44
|
export const getSignMessageLibDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
41
45
|
return findDeployment(filter, signMessageLibDeployments)
|
|
42
|
-
}
|
|
46
|
+
}
|
package/src/safes.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import SafeL2141 from './assets/v1.4.1/safe_l2.json'
|
|
2
|
+
import Safe141 from './assets/v1.4.1/safe.json'
|
|
1
3
|
import GnosisSafeL2130 from './assets/v1.3.0/gnosis_safe_l2.json'
|
|
2
4
|
import GnosisSafe130 from './assets/v1.3.0/gnosis_safe.json'
|
|
3
5
|
import GnosisSafe120 from './assets/v1.2.0/gnosis_safe.json'
|
|
@@ -8,7 +10,7 @@ import { findDeployment } from './utils'
|
|
|
8
10
|
|
|
9
11
|
// This is a sorted array (newest to oldest), exported for tests
|
|
10
12
|
export const _safeDeployments: SingletonDeployment[] = [
|
|
11
|
-
GnosisSafe130, GnosisSafe120, GnosisSafe111, GnosisSafe100
|
|
13
|
+
Safe141, GnosisSafe130, GnosisSafe120, GnosisSafe111, GnosisSafe100
|
|
12
14
|
]
|
|
13
15
|
|
|
14
16
|
export const getSafeSingletonDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
@@ -17,9 +19,9 @@ export const getSafeSingletonDeployment = (filter?: DeploymentFilter): Singleton
|
|
|
17
19
|
|
|
18
20
|
// This is a sorted array (newest to oldest), exported for tests
|
|
19
21
|
export const _safeL2Deployments: SingletonDeployment[] = [
|
|
20
|
-
GnosisSafeL2130
|
|
22
|
+
SafeL2141, GnosisSafeL2130
|
|
21
23
|
]
|
|
22
24
|
|
|
23
25
|
export const getSafeL2SingletonDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
|
|
24
26
|
return findDeployment(filter, _safeL2Deployments)
|
|
25
|
-
}
|
|
27
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -3,10 +3,14 @@ import semverSatisfies from 'semver/functions/satisfies'
|
|
|
3
3
|
|
|
4
4
|
const DEFAULT_FILTER: DeploymentFilter = { released: true }
|
|
5
5
|
|
|
6
|
-
export const findDeployment = (criteria: DeploymentFilter = DEFAULT_FILTER, deployments: SingletonDeployment[]): SingletonDeployment | undefined =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (
|
|
6
|
+
export const findDeployment = (criteria: DeploymentFilter = DEFAULT_FILTER, deployments: SingletonDeployment[]): SingletonDeployment | undefined => {
|
|
7
|
+
const criteriaWithDefaults: DeploymentFilter = { ...DEFAULT_FILTER, ...criteria }
|
|
8
|
+
|
|
9
|
+
return deployments.find((deployment) => {
|
|
10
|
+
if (typeof criteriaWithDefaults.version !== 'undefined' && !semverSatisfies(deployment.version, criteriaWithDefaults.version)) return false
|
|
11
|
+
if (typeof criteriaWithDefaults.released === 'boolean' && deployment.released != criteriaWithDefaults.released) return false
|
|
12
|
+
if (criteriaWithDefaults.network && !deployment.networkAddresses[criteriaWithDefaults.network]) return false
|
|
13
|
+
|
|
11
14
|
return true
|
|
12
|
-
})
|
|
15
|
+
})
|
|
16
|
+
}
|