1
+ import { Address } from 'viem' ;
1
2
import {
2
3
LOCAL_FORK_ID ,
3
4
LOCAL_FORK_ID_GNOSIS ,
4
5
LOCAL_FORK_ID_POLYGON ,
5
- } from 'util/constants' ;
6
+ } from '../../ util/constants' ;
6
7
7
- const MAINNET_ADDRESSES = {
8
+ type Addresses = {
9
+ serviceManagerToken : Address ;
10
+ serviceRegistryL2 : Address ;
11
+ serviceRegistryTokenUtility : Address ;
12
+ operatorWhitelist : Address ;
13
+ } ;
14
+
15
+ type L1Addresses = {
16
+ agentRegistry : Address ;
17
+ componentRegistry : Address ;
18
+ registriesManager : Address ;
19
+ serviceManagerToken : Address ;
20
+ serviceRegistry : Address ;
21
+ serviceRegistryTokenUtility : Address ;
22
+ operatorWhitelist : Address ;
23
+ } ;
24
+
25
+ const MAINNET_ADDRESSES : L1Addresses = {
8
26
agentRegistry : '0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112' ,
9
27
componentRegistry : '0x15bd56669F57192a97dF41A2aa8f4403e9491776' ,
10
28
registriesManager : '0x9eC9156dEF5C613B2a7D4c46C383F9B58DfcD6fE' ,
@@ -14,14 +32,14 @@ const MAINNET_ADDRESSES = {
14
32
operatorWhitelist : '0x42042799B0DE38AdD2a70dc996f69f98E1a85260' ,
15
33
} ;
16
34
17
- const GNOSIS_ADDRESSES = {
35
+ const GNOSIS_ADDRESSES : Addresses = {
18
36
serviceManagerToken : '0x04b0007b2aFb398015B76e5f22993a1fddF83644' ,
19
37
serviceRegistryL2 : '0x9338b5153AE39BB89f50468E608eD9d764B755fD' ,
20
38
serviceRegistryTokenUtility : '0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8' ,
21
39
operatorWhitelist : '0x526E064cB694E8f5B7DB299158e17F33055B3943' ,
22
40
} ;
23
41
24
- const POLYGON_ADDRESSES = {
42
+ const POLYGON_ADDRESSES : Addresses = {
25
43
serviceManagerToken : '0x04b0007b2aFb398015B76e5f22993a1fddF83644' ,
26
44
serviceRegistryL2 : '0xE3607b00E75f6405248323A9417ff6b39B244b50' ,
27
45
serviceRegistryTokenUtility : '0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8' ,
@@ -35,7 +53,7 @@ const POLYGON_ADDRESSES = {
35
53
* - optimistic
36
54
* - celo
37
55
*/
38
- const COMMON_TEST_ADDRESSES = {
56
+ const COMMON_TEST_ADDRESSES : Addresses = {
39
57
serviceManagerToken : '0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915' ,
40
58
serviceRegistryL2 : '0x31D3202d8744B16A120117A053459DDFAE93c855' ,
41
59
serviceRegistryTokenUtility : '0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994' ,
@@ -44,8 +62,10 @@ const COMMON_TEST_ADDRESSES = {
44
62
45
63
// TODO: add testcases for all networks
46
64
// get addresses from scripts/deployment folder in autonolas-registries repo
47
- export const ADDRESSES = {
48
- 1 : MAINNET_ADDRESSES ,
65
+ export const ADDRESSES : {
66
+ [ chainId : string ] : L1Addresses | Addresses ;
67
+ } = {
68
+ '1' : MAINNET_ADDRESSES ,
49
69
// goerli
50
70
5 : {
51
71
agentRegistry : '0xEB5638eefE289691EcE01943f768EDBF96258a80' ,
@@ -110,31 +130,25 @@ export const ADDRESSES = {
110
130
11155420 : COMMON_TEST_ADDRESSES ,
111
131
// celo alfajores - testnet for celo
112
132
44787 : COMMON_TEST_ADDRESSES ,
113
- // local
114
- 31337 : {
115
- agentRegistry : '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512' ,
116
- componentRegistry : '0x5FbDB2315678afecb367f032d93F642f64180aa3' ,
117
- registriesManager : '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' ,
118
- serviceRegistry : '0x998abeb3E57409262aE5b751f60747921B33613E' ,
119
- serviceManager : '0x4c5859f0F772848b2D91F1D83E2Fe57935348029' ,
120
- serviceRegistryTokenUtility : '0x36C02dA8a0983159322a80FFE9F24b1acfF8B570' ,
121
- operatorWhitelist : '0x809d550fca64d94Bd9F66E60752A544199cfAC3D' ,
122
- // used for testing - service creation/update token address
123
- ERC20Token : '0x1291Be112d480055DaFd8a610b7d1e203891C274' ,
124
- } ,
125
133
[ LOCAL_FORK_ID ] : MAINNET_ADDRESSES ,
126
134
[ LOCAL_FORK_ID_GNOSIS ] : GNOSIS_ADDRESSES ,
127
135
[ LOCAL_FORK_ID_POLYGON ] : POLYGON_ADDRESSES ,
128
- } ;
136
+ } as const ;
129
137
138
+ type ChainIds = keyof typeof ADDRESSES ;
139
+
140
+ type MultisigAddress = {
141
+ [ chainId in ChainIds ] : Address [ ] ;
142
+ } ;
130
143
// TODO: add testcases for all networks
131
144
/**
132
145
* check addresses here - GnosisSafeMultisig
133
146
* Addresses: https://github.com/valory-xyz/autonolas-registries/blob/main/docs/configuration.json
134
147
*/
135
- export const multisigAddresses = {
148
+ export const multisigAddresses : MultisigAddress = {
136
149
1 : [ '0x46C0D07F55d4F9B5Eed2Fc9680B5953e5fd7b461' ] ,
137
150
5 : [ '0x65dD51b02049ad1B6FF7fa9Ea3322E1D2CAb1176' ] ,
151
+ 10 : [ '0xE43d4F4103b623B61E095E8bEA34e1bc8979e168' ] ,
138
152
100 : [ '0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE' ] ,
139
153
137 : [ '0x3d77596beb0f130a4415df3D2D8232B3d3D31e44' ] ,
140
154
8453 : [ '0xBb7e1D6Cb6F243D6bdE81CE92a9f2aFF7Fbe7eac' ] ,
@@ -152,14 +166,14 @@ export const multisigAddresses = {
152
166
[ LOCAL_FORK_ID_POLYGON ] : [ '0x3d77596beb0f130a4415df3D2D8232B3d3D31e44' ] ,
153
167
} ;
154
168
155
- // TODO: add testcases for all networks
156
169
/**
157
170
* check addresses here - GnosisSafeSameAddressMultisig
158
171
* Addresses: https://github.com/valory-xyz/autonolas-registries/blob/main/docs/configuration.json
159
172
*/
160
- export const multisigSameAddresses = {
173
+ export const multisigSameAddresses : MultisigAddress = {
161
174
1 : [ '0xfa517d01DaA100cB1932FA4345F68874f7E7eF46' ] ,
162
175
5 : [ '0x06467Cb835da623384a22aa902647784C1c9f5Ae' ] ,
176
+ 10 : [ '0xb09CcF0Dbf0C178806Aaee28956c74bd66d21f73' ] ,
163
177
100 : [ '0x6e7f594f680f7aBad18b7a63de50F0FeE47dfD06' ] ,
164
178
137 : [ '0xd8BCC126ff31d2582018715d5291A508530587b0' ] ,
165
179
10200 : [ '0xE16adc7777B7C2a0d35033bd3504C028AB28EE8b' ] ,
@@ -177,14 +191,14 @@ export const multisigSameAddresses = {
177
191
[ LOCAL_FORK_ID_POLYGON ] : [ '0xd8BCC126ff31d2582018715d5291A508530587b0' ] ,
178
192
} ;
179
193
180
- // TODO: add testcases for all networks
181
194
/**
182
195
* check addresses here - MultiSendCallOnly
183
196
* https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.3.0/multi_send_call_only.json
184
197
*/
185
- export const safeMultiSend = {
198
+ export const safeMultiSend : MultisigAddress = {
186
199
1 : [ '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D' ] ,
187
200
5 : [ '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D' ] ,
201
+ 10 : [ '0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B' ] ,
188
202
100 : [ '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D' ] ,
189
203
137 : [ '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D' ] ,
190
204
8453 : [ '0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B' ] ,
@@ -202,14 +216,16 @@ export const safeMultiSend = {
202
216
[ LOCAL_FORK_ID_POLYGON ] : [ '0x40A2aCCbd92BCA938b02010E17A5b8929b49130D' ] ,
203
217
} ;
204
218
205
- // TODO: add testcases for all networks
206
219
/**
207
220
* check addresses here
208
221
* https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.3.0/compatibility_fallback_handler.json
209
222
*/
210
- export const FALLBACK_HANDLER = {
223
+ export const FALLBACK_HANDLER : {
224
+ [ chainId in ChainIds ] : Address ;
225
+ } = {
211
226
1 : '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4' ,
212
227
5 : '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4' ,
228
+ 10 : '0x017062a1dE2FE6b99BE3d9d37841FeD19F573804' ,
213
229
100 : '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4' ,
214
230
137 : '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4' ,
215
231
8453 : '0x017062a1dE2FE6b99BE3d9d37841FeD19F573804' ,
0 commit comments