@safe-global/safe-deployments 1.37.0 → 1.37.2

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 (112) hide show
  1. package/README.md +150 -31
  2. package/dist/accessors.d.ts +14 -1
  3. package/dist/accessors.js +19 -11
  4. package/dist/assets/v1.0.0/gnosis_safe.json +479 -103
  5. package/dist/assets/v1.0.0/proxy_factory.json +11 -6
  6. package/dist/assets/v1.1.1/default_callback_handler.json +14 -9
  7. package/dist/assets/v1.1.1/gnosis_safe.json +14 -9
  8. package/dist/assets/v1.1.1/multi_send.json +14 -9
  9. package/dist/assets/v1.1.1/proxy_factory.json +14 -9
  10. package/dist/assets/v1.2.0/gnosis_safe.json +14 -9
  11. package/dist/assets/v1.3.0/compatibility_fallback_handler.json +259 -235
  12. package/dist/assets/v1.3.0/create_call.json +259 -235
  13. package/dist/assets/v1.3.0/gnosis_safe.json +259 -235
  14. package/dist/assets/v1.3.0/gnosis_safe_l2.json +259 -235
  15. package/dist/assets/v1.3.0/multi_send.json +259 -235
  16. package/dist/assets/v1.3.0/multi_send_call_only.json +259 -235
  17. package/dist/assets/v1.3.0/proxy_factory.json +259 -235
  18. package/dist/assets/v1.3.0/sign_message_lib.json +260 -236
  19. package/dist/assets/v1.3.0/simulate_tx_accessor.json +259 -235
  20. package/dist/assets/v1.4.1/compatibility_fallback_handler.json +119 -108
  21. package/dist/assets/v1.4.1/create_call.json +119 -108
  22. package/dist/assets/v1.4.1/multi_send.json +119 -108
  23. package/dist/assets/v1.4.1/multi_send_call_only.json +119 -108
  24. package/dist/assets/v1.4.1/safe.json +119 -108
  25. package/dist/assets/v1.4.1/safe_l2.json +119 -108
  26. package/dist/assets/v1.4.1/safe_proxy_factory.json +120 -109
  27. package/dist/assets/v1.4.1/sign_message_lib.json +120 -109
  28. package/dist/assets/v1.4.1/simulate_tx_accessor.json +119 -108
  29. package/dist/deployments.d.ts +12 -0
  30. package/dist/deployments.js +71 -0
  31. package/dist/factories.d.ts +12 -1
  32. package/dist/factories.js +17 -13
  33. package/dist/handler.d.ts +29 -1
  34. package/dist/handler.js +55 -24
  35. package/dist/libs.d.ts +45 -1
  36. package/dist/libs.js +62 -32
  37. package/dist/safes.d.ts +23 -3
  38. package/dist/safes.js +32 -21
  39. package/dist/types.d.ts +37 -2
  40. package/dist/utils.d.ts +12 -2
  41. package/dist/utils.js +61 -9
  42. package/package.json +18 -19
  43. package/src/__tests__/assets/v1/v1.0.0/gnosis_safe.json +796 -0
  44. package/src/__tests__/assets/v1/v1.0.0/proxy_factory.json +111 -0
  45. package/src/__tests__/assets/v1/v1.1.1/create_and_add_modules.json +59 -0
  46. package/src/__tests__/assets/v1/v1.1.1/create_call.json +90 -0
  47. package/src/__tests__/assets/v1/v1.1.1/default_callback_handler.json +212 -0
  48. package/src/__tests__/assets/v1/v1.1.1/gnosis_safe.json +1001 -0
  49. package/src/__tests__/assets/v1/v1.1.1/multi_send.json +45 -0
  50. package/src/__tests__/assets/v1/v1.1.1/proxy_factory.json +191 -0
  51. package/src/__tests__/assets/v1/v1.2.0/gnosis_safe.json +1022 -0
  52. package/src/__tests__/assets/v1/v1.3.0/compatibility_fallback_handler.json +588 -0
  53. package/src/__tests__/assets/v1/v1.3.0/create_call.json +331 -0
  54. package/src/__tests__/assets/v1/v1.3.0/gnosis_safe.json +1296 -0
  55. package/src/__tests__/assets/v1/v1.3.0/gnosis_safe_l2.json +1401 -0
  56. package/src/__tests__/assets/v1/v1.3.0/multi_send.json +283 -0
  57. package/src/__tests__/assets/v1/v1.3.0/multi_send_call_only.json +278 -0
  58. package/src/__tests__/assets/v1/v1.3.0/proxy_factory.json +426 -0
  59. package/src/__tests__/assets/v1/v1.3.0/sign_message_lib.json +310 -0
  60. package/src/__tests__/assets/v1/v1.3.0/simulate_tx_accessor.json +314 -0
  61. package/src/__tests__/assets/v1/v1.4.1/compatibility_fallback_handler.json +447 -0
  62. package/src/__tests__/assets/v1/v1.4.1/create_call.json +192 -0
  63. package/src/__tests__/assets/v1/v1.4.1/multi_send.json +144 -0
  64. package/src/__tests__/assets/v1/v1.4.1/multi_send_call_only.json +139 -0
  65. package/src/__tests__/assets/v1/v1.4.1/safe.json +1123 -0
  66. package/src/__tests__/assets/v1/v1.4.1/safe_l2.json +1228 -0
  67. package/src/__tests__/assets/v1/v1.4.1/safe_proxy_factory.json +263 -0
  68. package/src/__tests__/assets/v1/v1.4.1/sign_message_lib.json +171 -0
  69. package/src/__tests__/assets/v1/v1.4.1/simulate_tx_accessor.json +175 -0
  70. package/src/__tests__/assets.test.ts +101 -38
  71. package/src/__tests__/factories.test.ts +3 -3
  72. package/src/__tests__/handler.test.ts +5 -5
  73. package/src/__tests__/libs.test.ts +9 -9
  74. package/src/__tests__/safes.test.ts +9 -12
  75. package/src/__tests__/utils.test.ts +421 -0
  76. package/src/accessors.ts +21 -12
  77. package/src/assets/v1.0.0/gnosis_safe.json +479 -103
  78. package/src/assets/v1.0.0/proxy_factory.json +11 -6
  79. package/src/assets/v1.1.1/create_and_add_modules.json +19 -10
  80. package/src/assets/v1.1.1/create_call.json +14 -9
  81. package/src/assets/v1.1.1/default_callback_handler.json +14 -9
  82. package/src/assets/v1.1.1/gnosis_safe.json +14 -9
  83. package/src/assets/v1.1.1/multi_send.json +14 -9
  84. package/src/assets/v1.1.1/proxy_factory.json +14 -9
  85. package/src/assets/v1.2.0/gnosis_safe.json +14 -9
  86. package/src/assets/v1.3.0/compatibility_fallback_handler.json +259 -235
  87. package/src/assets/v1.3.0/create_call.json +259 -235
  88. package/src/assets/v1.3.0/gnosis_safe.json +259 -235
  89. package/src/assets/v1.3.0/gnosis_safe_l2.json +259 -235
  90. package/src/assets/v1.3.0/multi_send.json +259 -235
  91. package/src/assets/v1.3.0/multi_send_call_only.json +259 -235
  92. package/src/assets/v1.3.0/proxy_factory.json +259 -235
  93. package/src/assets/v1.3.0/sign_message_lib.json +260 -236
  94. package/src/assets/v1.3.0/simulate_tx_accessor.json +259 -235
  95. package/src/assets/v1.4.1/compatibility_fallback_handler.json +119 -108
  96. package/src/assets/v1.4.1/create_call.json +119 -108
  97. package/src/assets/v1.4.1/multi_send.json +119 -108
  98. package/src/assets/v1.4.1/multi_send_call_only.json +119 -108
  99. package/src/assets/v1.4.1/safe.json +119 -108
  100. package/src/assets/v1.4.1/safe_l2.json +119 -108
  101. package/src/assets/v1.4.1/safe_proxy_factory.json +120 -109
  102. package/src/assets/v1.4.1/sign_message_lib.json +120 -109
  103. package/src/assets/v1.4.1/simulate_tx_accessor.json +119 -108
  104. package/src/deployments.ts +90 -0
  105. package/src/factories.ts +19 -14
  106. package/src/handler.ts +62 -26
  107. package/src/index.ts +6 -6
  108. package/src/libs.ts +69 -35
  109. package/src/safes.ts +34 -22
  110. package/src/types.ts +86 -10
  111. package/src/utils.ts +105 -12
  112. package/src/__tests__/utilts.test.ts +0 -385
@@ -1,116 +1,127 @@
1
1
  {
2
- "defaultAddress": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
3
2
  "released": true,
4
3
  "contractName": "SimulateTxAccessor",
5
4
  "version": "1.4.1",
5
+ "deployments": {
6
+ "canonical": {
7
+ "address": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
8
+ "codeHash": "0x91f82615581fc73b190b83d72e883608b25e392f72322035df1b13d51766cf8d"
9
+ }
10
+ },
6
11
  "networkAddresses": {
7
- "1": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
8
- "5": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
9
- "10": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
10
- "25": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
11
- "31": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
12
- "40": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
13
- "41": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
14
- "56": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
15
- "71": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
16
- "97": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
17
- "100": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
18
- "137": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
19
- "155": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
20
- "169": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
21
- "250": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
22
- "252": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
23
- "255": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
24
- "336": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
25
- "338": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
26
- "369": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
27
- "690": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
28
- "919": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
29
- "1030": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
30
- "1101": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
31
- "1111": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
32
- "1112": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
33
- "1135": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
34
- "1284": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
35
- "1285": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
36
- "1287": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
37
- "1329": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
38
- "1442": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
39
- "1625": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
40
- "1729": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
41
- "2000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
42
- "2039": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
43
- "2358": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
44
- "2810": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
45
- "3636": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
46
- "3776": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
47
- "4002": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
48
- "4157": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
49
- "4202": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
50
- "4337": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
51
- "4653": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
52
- "5000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
53
- "5003": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
54
- "6001": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
55
- "7000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
56
- "7001": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
57
- "7171": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
58
- "7560": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
59
- "7771": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
60
- "8192": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
61
- "8194": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
62
- "8453": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
63
- "9001": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
64
- "10242": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
65
- "10243": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
66
- "11235": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
67
- "13337": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
68
- "17000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
69
- "17069": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
70
- "18233": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
71
- "23294": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
72
- "23295": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
73
- "32769": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
74
- "33101": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
75
- "34443": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
76
- "42161": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
77
- "42220": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
78
- "43114": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
79
- "54211": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
80
- "59140": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
81
- "59141": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
82
- "59144": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
83
- "80001": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
84
- "80085": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
85
- "81457": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
86
- "84531": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
87
- "84532": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
88
- "105105": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
89
- "111188": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
90
- "167000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
91
- "167009": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
92
- "205205": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
93
- "444444": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
94
- "534351": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
95
- "534352": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
96
- "555666": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
97
- "713715": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
98
- "6038361": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
99
- "7225878": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
100
- "7777777": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
101
- "11155111": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
102
- "11155420": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
103
- "94204209": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
104
- "111557560": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
105
- "123420111": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
106
- "168587773": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
107
- "666666666": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
108
- "999999999": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
109
- "1313161554": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
110
- "1313161555": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
111
- "1666600000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
112
- "1666700000": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",
113
- "88153591557": "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199"
12
+ "1": "canonical",
13
+ "5": "canonical",
14
+ "10": "canonical",
15
+ "25": "canonical",
16
+ "31": "canonical",
17
+ "40": "canonical",
18
+ "41": "canonical",
19
+ "56": "canonical",
20
+ "71": "canonical",
21
+ "97": "canonical",
22
+ "100": "canonical",
23
+ "137": "canonical",
24
+ "155": "canonical",
25
+ "169": "canonical",
26
+ "250": "canonical",
27
+ "252": "canonical",
28
+ "255": "canonical",
29
+ "336": "canonical",
30
+ "338": "canonical",
31
+ "369": "canonical",
32
+ "480": "canonical",
33
+ "530": "canonical",
34
+ "592": "canonical",
35
+ "690": "canonical",
36
+ "919": "canonical",
37
+ "1030": "canonical",
38
+ "1101": "canonical",
39
+ "1111": "canonical",
40
+ "1112": "canonical",
41
+ "1135": "canonical",
42
+ "1284": "canonical",
43
+ "1285": "canonical",
44
+ "1287": "canonical",
45
+ "1329": "canonical",
46
+ "1337": "canonical",
47
+ "1442": "canonical",
48
+ "1625": "canonical",
49
+ "1729": "canonical",
50
+ "2000": "canonical",
51
+ "2039": "canonical",
52
+ "2358": "canonical",
53
+ "2810": "canonical",
54
+ "3636": "canonical",
55
+ "3776": "canonical",
56
+ "4002": "canonical",
57
+ "4157": "canonical",
58
+ "4202": "canonical",
59
+ "4337": "canonical",
60
+ "4653": "canonical",
61
+ "5000": "canonical",
62
+ "5003": "canonical",
63
+ "6001": "canonical",
64
+ "6322": "canonical",
65
+ "7000": "canonical",
66
+ "7001": "canonical",
67
+ "7171": "canonical",
68
+ "7560": "canonical",
69
+ "7771": "canonical",
70
+ "8192": "canonical",
71
+ "8194": "canonical",
72
+ "8453": "canonical",
73
+ "9001": "canonical",
74
+ "10242": "canonical",
75
+ "10243": "canonical",
76
+ "11235": "canonical",
77
+ "13337": "canonical",
78
+ "17000": "canonical",
79
+ "17069": "canonical",
80
+ "18233": "canonical",
81
+ "23294": "canonical",
82
+ "23295": "canonical",
83
+ "32769": "canonical",
84
+ "33101": "canonical",
85
+ "34443": "canonical",
86
+ "42161": "canonical",
87
+ "42220": "canonical",
88
+ "43114": "canonical",
89
+ "54211": "canonical",
90
+ "59140": "canonical",
91
+ "59141": "canonical",
92
+ "59144": "canonical",
93
+ "80001": "canonical",
94
+ "80085": "canonical",
95
+ "81457": "canonical",
96
+ "84531": "canonical",
97
+ "84532": "canonical",
98
+ "90001": "canonical",
99
+ "105105": "canonical",
100
+ "111188": "canonical",
101
+ "167000": "canonical",
102
+ "167009": "canonical",
103
+ "205205": "canonical",
104
+ "444444": "canonical",
105
+ "534351": "canonical",
106
+ "534352": "canonical",
107
+ "555666": "canonical",
108
+ "713715": "canonical",
109
+ "6038361": "canonical",
110
+ "7225878": "canonical",
111
+ "7777777": "canonical",
112
+ "11155111": "canonical",
113
+ "11155420": "canonical",
114
+ "94204209": "canonical",
115
+ "111557560": "canonical",
116
+ "123420111": "canonical",
117
+ "168587773": "canonical",
118
+ "666666666": "canonical",
119
+ "999999999": "canonical",
120
+ "1313161554": "canonical",
121
+ "1313161555": "canonical",
122
+ "1666600000": "canonical",
123
+ "1666700000": "canonical",
124
+ "88153591557": "canonical"
114
125
  },
115
126
  "abi": [
116
127
  {
@@ -0,0 +1,90 @@
1
+ import { SingletonDeploymentJSON } from './types';
2
+
3
+ // This is a file where all the deployments are consolidated
4
+ // We do it in a separate file so we don't have to repeat comments about the array order and the type casting.
5
+ // We use some specific types (like `AddressType`) in the `SingletonDeploymentJSON` type, but the TypeScript cannot infer that from the JSON files.
6
+ // So we need to cast them to `SingletonDeploymentJSON` manually. The casting is valid because we have a test in `__tests__/assets.test.ts` that checks that the JSON files are valid.
7
+ // The arrays are sorted by preference, which at the moment means from the most recent version to the oldest.
8
+ // The arrays are prefixed with an underscore because they are not meant to be imported directly.
9
+
10
+ import SimulateTxAccessor130 from './assets/v1.3.0/simulate_tx_accessor.json';
11
+ import SimulateTxAccessor141 from './assets/v1.4.1/simulate_tx_accessor.json';
12
+
13
+ const _ACCESSOR_DEPLOYMENTS = [SimulateTxAccessor141, SimulateTxAccessor130] as SingletonDeploymentJSON[];
14
+
15
+ import ProxyFactory100 from './assets/v1.0.0/proxy_factory.json';
16
+ import ProxyFactory111 from './assets/v1.1.1/proxy_factory.json';
17
+ import ProxyFactory130 from './assets/v1.3.0/proxy_factory.json';
18
+ import SafeProxyFactory141 from './assets/v1.4.1/safe_proxy_factory.json';
19
+
20
+ const _FACTORY_DEPLOYMENTS = [
21
+ SafeProxyFactory141,
22
+ ProxyFactory130,
23
+ ProxyFactory111,
24
+ ProxyFactory100,
25
+ ] as SingletonDeploymentJSON[];
26
+
27
+ import DefaultCallbackHandler130 from './assets/v1.1.1/default_callback_handler.json';
28
+
29
+ const _DEFAULT_CALLBACK_HANDLER_DEPLOYMENTS = [DefaultCallbackHandler130] as SingletonDeploymentJSON[];
30
+
31
+ import CompatibilityFallbackHandler130 from './assets/v1.3.0/compatibility_fallback_handler.json';
32
+ import CompatibilityFallbackHandler141 from './assets/v1.4.1/compatibility_fallback_handler.json';
33
+
34
+ const _COMPAT_FALLBACK_HANDLER_DEPLOYMENTS = [
35
+ CompatibilityFallbackHandler141,
36
+ CompatibilityFallbackHandler130,
37
+ ] as SingletonDeploymentJSON[];
38
+
39
+ import Safe141 from './assets/v1.4.1/safe.json';
40
+ import GnosisSafe130 from './assets/v1.3.0/gnosis_safe.json';
41
+ import GnosisSafe120 from './assets/v1.2.0/gnosis_safe.json';
42
+ import GnosisSafe111 from './assets/v1.1.1/gnosis_safe.json';
43
+ import GnosisSafe100 from './assets/v1.0.0/gnosis_safe.json';
44
+
45
+ const _SAFE_DEPLOYMENTS = [
46
+ Safe141,
47
+ GnosisSafe130,
48
+ GnosisSafe120,
49
+ GnosisSafe111,
50
+ GnosisSafe100,
51
+ ] as SingletonDeploymentJSON[];
52
+
53
+ import SafeL2141 from './assets/v1.4.1/safe_l2.json';
54
+ import GnosisSafeL2130 from './assets/v1.3.0/gnosis_safe_l2.json';
55
+
56
+ const _SAFE_L2_DEPLOYMENTS = [SafeL2141, GnosisSafeL2130] as SingletonDeploymentJSON[];
57
+
58
+ import MultiSend111 from './assets/v1.1.1/multi_send.json';
59
+ import MultiSend130 from './assets/v1.3.0/multi_send.json';
60
+ import MultiSend141 from './assets/v1.4.1/multi_send.json';
61
+
62
+ const _MULTI_SEND_DEPLOYMENTS = [MultiSend141, MultiSend130, MultiSend111] as SingletonDeploymentJSON[];
63
+
64
+ import MultiSendCallOnly130 from './assets/v1.3.0/multi_send_call_only.json';
65
+ import MultiSendCallOnly141 from './assets/v1.4.1/multi_send_call_only.json';
66
+
67
+ const _MULTI_SEND_CALL_ONLY_DEPLOYMENTS = [MultiSendCallOnly141, MultiSendCallOnly130] as SingletonDeploymentJSON[];
68
+
69
+ import CreateCall130 from './assets/v1.3.0/create_call.json';
70
+ import CreateCall141 from './assets/v1.4.1/create_call.json';
71
+
72
+ const _CREATE_CALL_DEPLOYMENTS = [CreateCall141, CreateCall130] as SingletonDeploymentJSON[];
73
+
74
+ import SignMessageLib130 from './assets/v1.3.0/sign_message_lib.json';
75
+ import SignMessageLib141 from './assets/v1.4.1/sign_message_lib.json';
76
+
77
+ const _SIGN_MESSAGE_LIB_DEPLOYMENTS = [SignMessageLib141, SignMessageLib130] as SingletonDeploymentJSON[];
78
+
79
+ export {
80
+ _ACCESSOR_DEPLOYMENTS,
81
+ _FACTORY_DEPLOYMENTS,
82
+ _DEFAULT_CALLBACK_HANDLER_DEPLOYMENTS,
83
+ _COMPAT_FALLBACK_HANDLER_DEPLOYMENTS,
84
+ _SAFE_DEPLOYMENTS,
85
+ _SAFE_L2_DEPLOYMENTS,
86
+ _MULTI_SEND_DEPLOYMENTS,
87
+ _MULTI_SEND_CALL_ONLY_DEPLOYMENTS,
88
+ _CREATE_CALL_DEPLOYMENTS,
89
+ _SIGN_MESSAGE_LIB_DEPLOYMENTS,
90
+ };
package/src/factories.ts CHANGED
@@ -1,16 +1,21 @@
1
- import ProxyFactory100 from './assets/v1.0.0/proxy_factory.json'
2
- import ProxyFactory111 from './assets/v1.1.1/proxy_factory.json'
3
- import ProxyFactory130 from './assets/v1.3.0/proxy_factory.json'
4
- import SafeProxyFactory141 from './assets/v1.4.1/safe_proxy_factory.json'
5
-
6
- import { DeploymentFilter, SingletonDeployment } from './types'
7
- import { findDeployment } from './utils'
8
-
9
- // This is a sorted array (newest to oldest)
10
- const factoryDeployments: SingletonDeployment[] = [
11
- SafeProxyFactory141, ProxyFactory130, ProxyFactory111, ProxyFactory100
12
- ]
1
+ import { DeploymentFilter, DeploymentFormats, SingletonDeployment, SingletonDeploymentV2 } from './types';
2
+ import { findDeployment } from './utils';
3
+ import { _FACTORY_DEPLOYMENTS } from './deployments';
13
4
 
5
+ /**
6
+ * Finds the latest proxy factory deployment that matches the given filter.
7
+ * @param {DeploymentFilter} [filter] - The filter to apply when searching for the deployment.
8
+ * @returns {SingletonDeployment | undefined} - The found deployment or undefined if no deployment matches the filter.
9
+ */
14
10
  export const getProxyFactoryDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
15
- return findDeployment(filter, factoryDeployments)
16
- }
11
+ return findDeployment(filter, _FACTORY_DEPLOYMENTS);
12
+ };
13
+
14
+ /**
15
+ * Finds all proxy factory deployments that match the given filter.
16
+ * @param {DeploymentFilter} [filter] - The filter to apply when searching for the deployments.
17
+ * @returns {SingletonDeploymentV2 | undefined} - The found deployments or undefined if no deployments match the filter.
18
+ */
19
+ export const getProxyFactoryDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
20
+ return findDeployment(filter, _FACTORY_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
21
+ };
package/src/handler.ts CHANGED
@@ -1,32 +1,68 @@
1
- import DefaultCallbackHandler130 from './assets/v1.1.1/default_callback_handler.json'
2
- import CompatibilityFallbackHandler130 from './assets/v1.3.0/compatibility_fallback_handler.json'
3
- import CompatibilityFallbackHandler141 from './assets/v1.4.1/compatibility_fallback_handler.json'
4
- import { DeploymentFilter, SingletonDeployment } from './types'
5
- import { findDeployment } from './utils'
6
-
7
- // This is a sorted array (by preference)
8
- const defaultCallbackHandlerDeployments: SingletonDeployment[] = [
9
- DefaultCallbackHandler130
10
- ]
1
+ import { DeploymentFilter, DeploymentFormats, SingletonDeployment, SingletonDeploymentV2 } from './types';
2
+ import { findDeployment } from './utils';
3
+ import { _DEFAULT_CALLBACK_HANDLER_DEPLOYMENTS, _COMPAT_FALLBACK_HANDLER_DEPLOYMENTS } from './deployments';
11
4
 
5
+ /**
6
+ * Get the default callback handler deployment based on the provided filter.
7
+ * @param {DeploymentFilter} [filter] - Optional filter to apply to the deployment search.
8
+ * @returns {SingletonDeployment | undefined} - The found deployment or undefined if not found.
9
+ */
12
10
  export const getDefaultCallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
13
- return findDeployment(filter, defaultCallbackHandlerDeployments)
14
- }
11
+ return findDeployment(filter, _DEFAULT_CALLBACK_HANDLER_DEPLOYMENTS);
12
+ };
15
13
 
16
- // This is a sorted array (by preference)
17
- const compatFallbackHandlerDeployments: SingletonDeployment[] = [
18
- CompatibilityFallbackHandler141, CompatibilityFallbackHandler130
19
- ]
14
+ /**
15
+ * Get all default callback handler deployments based on the provided filter.
16
+ * @param {DeploymentFilter} [filter] - Optional filter to apply to the deployment search.
17
+ * @returns {SingletonDeploymentV2 | undefined} - The found deployments in version 2 format or undefined if not found.
18
+ */
19
+ export const getDefaultCallbackHandlerDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
20
+ return findDeployment(filter, _DEFAULT_CALLBACK_HANDLER_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
21
+ };
20
22
 
21
- export const getCompatibilityFallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
22
- return findDeployment(filter, compatFallbackHandlerDeployments)
23
- }
23
+ /**
24
+ * Get the compatibility fallback handler deployment based on the provided filter.
25
+ * @param {DeploymentFilter} [filter] - Optional filter to apply to the deployment search.
26
+ * @returns {SingletonDeployment | undefined} - The found deployment or undefined if not found.
27
+ */
28
+ export const getCompatibilityFallbackHandlerDeployment = (
29
+ filter?: DeploymentFilter,
30
+ ): SingletonDeployment | undefined => {
31
+ return findDeployment(filter, _COMPAT_FALLBACK_HANDLER_DEPLOYMENTS);
32
+ };
24
33
 
25
- // This is a sorted array (by preference)
26
- const fallbackHandlerDeployments: SingletonDeployment[] = [
27
- CompatibilityFallbackHandler141, CompatibilityFallbackHandler130, DefaultCallbackHandler130
28
- ]
34
+ /**
35
+ * Get all compatibility fallback handler deployments based on the provided filter.
36
+ * @param {DeploymentFilter} [filter] - Optional filter to apply to the deployment search.
37
+ * @returns {SingletonDeploymentV2 | undefined} - The found deployments in version 2 format or undefined if not found.
38
+ */
39
+ export const getCompatibilityFallbackHandlerDeployments = (
40
+ filter?: DeploymentFilter,
41
+ ): SingletonDeploymentV2 | undefined => {
42
+ return findDeployment(filter, _COMPAT_FALLBACK_HANDLER_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
43
+ };
29
44
 
30
- export const getFallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
31
- return findDeployment(filter, fallbackHandlerDeployments)
32
- }
45
+ /**
46
+ * Get the fallback handler deployment based on the provided filter. This method is an alias for `getCompatibilityFallbackHandlerDeployment`.
47
+ * Kept for backwards compatibility.
48
+ * @param {DeploymentFilter} [filter] - Optional filter to apply to the deployment search.
49
+ * @returns {SingletonDeployment | undefined} - The found deployment or undefined if not found.
50
+ */
51
+ export const getFallbackHandlerDeployment = getCompatibilityFallbackHandlerDeployment;
52
+ // Leaving the comment here so it's not a part of the JSDoc
53
+ // Previously, the function code was this:
54
+ // // This is a sorted array (by preference)
55
+ // const fallbackHandlerDeployments: SingletonDeploymentJSON[] = [
56
+ // CompatibilityFallbackHandler141,
57
+ // CompatibilityFallbackHandler130,
58
+ // DefaultCallbackHandler130,
59
+ // ];
60
+ // export const getFallbackHandlerDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
61
+ // return findDeployment(filter, fallbackHandlerDeployments);
62
+ // };
63
+ // The problem with the function is that there’s no possible filter that would make the function return the last element of the array
64
+ // (DefaultCallbackHandler130 ), since we only allow to filter by version, networks and released flag. The only possible way is to have
65
+ // the default callback handler deployed to a network where the compatibility fallback handler isn’t deployed, but we require the whole
66
+ // suite of the contracts be deployed to a network.
67
+ // Since we didn't want to enforce a preferred fallback handler on the deployments package level,
68
+ // we decided to alias it to getCompatibilityFallbackHandlerDeployment (previously returned value)
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from './types'
2
- export * from './safes'
3
- export * from './factories'
4
- export * from './libs'
5
- export * from './handler'
6
- export * from './accessors'
1
+ export * from './types';
2
+ export * from './safes';
3
+ export * from './factories';
4
+ export * from './libs';
5
+ export * from './handler';
6
+ export * from './accessors';
package/src/libs.ts CHANGED
@@ -1,46 +1,80 @@
1
- import CreateCall130 from './assets/v1.3.0/create_call.json'
2
- import CreateCall141 from './assets/v1.4.1/create_call.json'
3
- import MultiSend111 from './assets/v1.1.1/multi_send.json'
4
- import MultiSend130 from './assets/v1.3.0/multi_send.json'
5
- import MultiSend141 from './assets/v1.4.1/multi_send.json'
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'
8
- import SignMessageLib130 from './assets/v1.3.0/sign_message_lib.json'
9
- import SignMessageLib141 from './assets/v1.4.1/sign_message_lib.json'
10
- import { DeploymentFilter, SingletonDeployment } from './types'
11
- import { findDeployment } from './utils'
12
-
13
- // This is a sorted array (by preference, currently we use 111 in most cases)
14
- const multiSendDeployments: SingletonDeployment[] = [
15
- MultiSend141, MultiSend130, MultiSend111
16
- ]
1
+ import {
2
+ _CREATE_CALL_DEPLOYMENTS,
3
+ _MULTI_SEND_CALL_ONLY_DEPLOYMENTS,
4
+ _MULTI_SEND_DEPLOYMENTS,
5
+ _SIGN_MESSAGE_LIB_DEPLOYMENTS,
6
+ } from './deployments';
7
+ import { DeploymentFilter, DeploymentFormats, SingletonDeployment, SingletonDeploymentV2 } from './types';
8
+ import { findDeployment } from './utils';
17
9
 
10
+ /**
11
+ * Get the MultiSend deployment based on the provided filter.
12
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployment.
13
+ * @returns {SingletonDeployment | undefined} - The matched deployment or undefined if not found.
14
+ */
18
15
  export const getMultiSendDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
19
- return findDeployment(filter, multiSendDeployments)
20
- }
16
+ return findDeployment(filter, _MULTI_SEND_DEPLOYMENTS);
17
+ };
21
18
 
22
- // This is a sorted array (by preference)
23
- const multiSendCallOnlyDeployments: SingletonDeployment[] = [
24
- MultiSendCallOnly141, MultiSendCallOnly130
25
- ]
19
+ /**
20
+ * Get all MultiSend deployments based on the provided filter.
21
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployments.
22
+ * @returns {SingletonDeploymentV2 | undefined} - The matched deployments or undefined if not found.
23
+ */
24
+ export const getMultiSendDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
25
+ return findDeployment(filter, _MULTI_SEND_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
26
+ };
26
27
 
28
+ /**
29
+ * Get the MultiSendCallOnly deployment based on the provided filter.
30
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployment.
31
+ * @returns {SingletonDeployment | undefined} - The matched deployment or undefined if not found.
32
+ */
27
33
  export const getMultiSendCallOnlyDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
28
- return findDeployment(filter, multiSendCallOnlyDeployments)
29
- }
34
+ return findDeployment(filter, _MULTI_SEND_CALL_ONLY_DEPLOYMENTS);
35
+ };
30
36
 
31
- // This is a sorted array (by preference)
32
- const createCallDeployments: SingletonDeployment[] = [
33
- CreateCall141, CreateCall130
34
- ]
37
+ /**
38
+ * Get all MultiSendCallOnly deployments based on the provided filter.
39
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployments.
40
+ * @returns {SingletonDeploymentV2 | undefined} - The matched deployments or undefined if not found.
41
+ */
42
+ export const getMultiSendCallOnlyDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
43
+ return findDeployment(filter, _MULTI_SEND_CALL_ONLY_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
44
+ };
35
45
 
46
+ /**
47
+ * Get the CreateCall deployment based on the provided filter.
48
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployment.
49
+ * @returns {SingletonDeployment | undefined} - The matched deployment or undefined if not found.
50
+ */
36
51
  export const getCreateCallDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
37
- return findDeployment(filter, createCallDeployments)
38
- }
52
+ return findDeployment(filter, _CREATE_CALL_DEPLOYMENTS);
53
+ };
39
54
 
40
- const signMessageLibDeployments: SingletonDeployment[] = [
41
- SignMessageLib141, SignMessageLib130
42
- ]
55
+ /**
56
+ * Get all CreateCall deployments based on the provided filter.
57
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployments.
58
+ * @returns {SingletonDeploymentV2 | undefined} - The matched deployments or undefined if not found.
59
+ */
60
+ export const getCreateCallDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
61
+ return findDeployment(filter, _CREATE_CALL_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
62
+ };
43
63
 
64
+ /**
65
+ * Get the SignMessageLib deployment based on the provided filter.
66
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployment.
67
+ * @returns {SingletonDeployment | undefined} - The matched deployment or undefined if not found.
68
+ */
44
69
  export const getSignMessageLibDeployment = (filter?: DeploymentFilter): SingletonDeployment | undefined => {
45
- return findDeployment(filter, signMessageLibDeployments)
46
- }
70
+ return findDeployment(filter, _SIGN_MESSAGE_LIB_DEPLOYMENTS);
71
+ };
72
+
73
+ /**
74
+ * Get all SignMessageLib deployments based on the provided filter.
75
+ * @param {DeploymentFilter} [filter] - The filter criteria for the deployments.
76
+ * @returns {SingletonDeploymentV2 | undefined} - The matched deployments or undefined if not found.
77
+ */
78
+ export const getSignMessageLibDeployments = (filter?: DeploymentFilter): SingletonDeploymentV2 | undefined => {
79
+ return findDeployment(filter, _SIGN_MESSAGE_LIB_DEPLOYMENTS, DeploymentFormats.MULTIPLE);
80
+ };