@0xsequence/catapult 1.3.17 → 1.5.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.
Files changed (232) hide show
  1. package/README.md +276 -0
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +1 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/index.d.ts +1 -0
  6. package/dist/commands/index.d.ts.map +1 -1
  7. package/dist/commands/index.js +1 -0
  8. package/dist/commands/index.js.map +1 -1
  9. package/dist/commands/list.d.ts.map +1 -1
  10. package/dist/commands/list.js +12 -0
  11. package/dist/commands/list.js.map +1 -1
  12. package/dist/commands/provenance.d.ts +3 -0
  13. package/dist/commands/provenance.d.ts.map +1 -0
  14. package/dist/commands/provenance.js +138 -0
  15. package/dist/commands/provenance.js.map +1 -0
  16. package/dist/lib/__tests__/deployer.spec.js +118 -1
  17. package/dist/lib/__tests__/deployer.spec.js.map +1 -1
  18. package/dist/lib/__tests__/network-loader.spec.js.map +1 -1
  19. package/dist/lib/__tests__/provenance.spec.d.ts +2 -0
  20. package/dist/lib/__tests__/provenance.spec.d.ts.map +1 -0
  21. package/dist/lib/__tests__/provenance.spec.js +205 -0
  22. package/dist/lib/__tests__/provenance.spec.js.map +1 -0
  23. package/dist/lib/contracts/__tests__/repository.spec.js +243 -0
  24. package/dist/lib/contracts/__tests__/repository.spec.js.map +1 -1
  25. package/dist/lib/contracts/repository.d.ts +9 -1
  26. package/dist/lib/contracts/repository.d.ts.map +1 -1
  27. package/dist/lib/contracts/repository.js +93 -7
  28. package/dist/lib/contracts/repository.js.map +1 -1
  29. package/dist/lib/core/__tests__/assert-action.spec.d.ts +2 -0
  30. package/dist/lib/core/__tests__/assert-action.spec.d.ts.map +1 -0
  31. package/dist/lib/core/__tests__/assert-action.spec.js +377 -0
  32. package/dist/lib/core/__tests__/assert-action.spec.js.map +1 -0
  33. package/dist/lib/core/__tests__/engine.spec.js +80 -0
  34. package/dist/lib/core/__tests__/engine.spec.js.map +1 -1
  35. package/dist/lib/core/__tests__/loader.spec.js +29 -0
  36. package/dist/lib/core/__tests__/loader.spec.js.map +1 -1
  37. package/dist/lib/core/__tests__/resolver.spec.js +405 -0
  38. package/dist/lib/core/__tests__/resolver.spec.js.map +1 -1
  39. package/dist/lib/core/__tests__/sign-actions.spec.d.ts +2 -0
  40. package/dist/lib/core/__tests__/sign-actions.spec.d.ts.map +1 -0
  41. package/dist/lib/core/__tests__/sign-actions.spec.js +128 -0
  42. package/dist/lib/core/__tests__/sign-actions.spec.js.map +1 -0
  43. package/dist/lib/core/__tests__/signer.spec.d.ts +2 -0
  44. package/dist/lib/core/__tests__/signer.spec.d.ts.map +1 -0
  45. package/dist/lib/core/__tests__/signer.spec.js +40 -0
  46. package/dist/lib/core/__tests__/signer.spec.js.map +1 -0
  47. package/dist/lib/core/context.d.ts +3 -2
  48. package/dist/lib/core/context.d.ts.map +1 -1
  49. package/dist/lib/core/context.js +3 -2
  50. package/dist/lib/core/context.js.map +1 -1
  51. package/dist/lib/core/engine.d.ts +4 -0
  52. package/dist/lib/core/engine.d.ts.map +1 -1
  53. package/dist/lib/core/engine.js +206 -0
  54. package/dist/lib/core/engine.js.map +1 -1
  55. package/dist/lib/core/loader.d.ts +1 -0
  56. package/dist/lib/core/loader.d.ts.map +1 -1
  57. package/dist/lib/core/loader.js +6 -1
  58. package/dist/lib/core/loader.js.map +1 -1
  59. package/dist/lib/core/resolver.d.ts +2 -0
  60. package/dist/lib/core/resolver.d.ts.map +1 -1
  61. package/dist/lib/core/resolver.js +89 -0
  62. package/dist/lib/core/resolver.js.map +1 -1
  63. package/dist/lib/core/signer.d.ts +7 -0
  64. package/dist/lib/core/signer.d.ts.map +1 -0
  65. package/dist/lib/core/signer.js +60 -0
  66. package/dist/lib/core/signer.js.map +1 -0
  67. package/dist/lib/deployer.d.ts.map +1 -1
  68. package/dist/lib/deployer.js +21 -4
  69. package/dist/lib/deployer.js.map +1 -1
  70. package/dist/lib/index.d.ts +1 -0
  71. package/dist/lib/index.d.ts.map +1 -1
  72. package/dist/lib/index.js +1 -0
  73. package/dist/lib/index.js.map +1 -1
  74. package/dist/lib/parsers/__tests__/job.spec.js +77 -0
  75. package/dist/lib/parsers/__tests__/job.spec.js.map +1 -1
  76. package/dist/lib/parsers/__tests__/source.spec.d.ts +2 -0
  77. package/dist/lib/parsers/__tests__/source.spec.d.ts.map +1 -0
  78. package/dist/lib/parsers/__tests__/source.spec.js +158 -0
  79. package/dist/lib/parsers/__tests__/source.spec.js.map +1 -0
  80. package/dist/lib/parsers/index.d.ts +1 -0
  81. package/dist/lib/parsers/index.d.ts.map +1 -1
  82. package/dist/lib/parsers/index.js +1 -0
  83. package/dist/lib/parsers/index.js.map +1 -1
  84. package/dist/lib/parsers/job.d.ts.map +1 -1
  85. package/dist/lib/parsers/job.js +11 -0
  86. package/dist/lib/parsers/job.js.map +1 -1
  87. package/dist/lib/parsers/source.d.ts +4 -0
  88. package/dist/lib/parsers/source.d.ts.map +1 -0
  89. package/dist/lib/parsers/source.js +107 -0
  90. package/dist/lib/parsers/source.js.map +1 -0
  91. package/dist/lib/provenance.d.ts +34 -0
  92. package/dist/lib/provenance.d.ts.map +1 -0
  93. package/dist/lib/provenance.js +694 -0
  94. package/dist/lib/provenance.js.map +1 -0
  95. package/dist/lib/types/actions.d.ts +42 -2
  96. package/dist/lib/types/actions.d.ts.map +1 -1
  97. package/dist/lib/types/actions.js +4 -0
  98. package/dist/lib/types/actions.js.map +1 -1
  99. package/dist/lib/types/contracts.d.ts +3 -0
  100. package/dist/lib/types/contracts.d.ts.map +1 -1
  101. package/dist/lib/types/definitions.d.ts +1 -0
  102. package/dist/lib/types/definitions.d.ts.map +1 -1
  103. package/dist/lib/types/index.d.ts +1 -0
  104. package/dist/lib/types/index.d.ts.map +1 -1
  105. package/dist/lib/types/index.js +1 -0
  106. package/dist/lib/types/index.js.map +1 -1
  107. package/dist/lib/types/source.d.ts +26 -0
  108. package/dist/lib/types/source.d.ts.map +1 -0
  109. package/dist/lib/types/source.js +3 -0
  110. package/dist/lib/types/source.js.map +1 -0
  111. package/dist/lib/types/values.d.ts +33 -1
  112. package/dist/lib/types/values.d.ts.map +1 -1
  113. package/package.json +4 -1
  114. package/.eslintrc.json +0 -29
  115. package/.github/workflows/ci.yml +0 -181
  116. package/CONCEPT.md +0 -24
  117. package/contracts/checked-call.huff +0 -65
  118. package/eslint.config.js +0 -48
  119. package/examples/jobs/guards-v1.yaml +0 -17
  120. package/examples/jobs/sequence-seq-0001-patch.yaml +0 -59
  121. package/examples/jobs/sequence-v1.yaml +0 -59
  122. package/examples/templates/sequence-factory-v1.yaml +0 -56
  123. package/jest.config.js +0 -25
  124. package/src/cli.ts +0 -17
  125. package/src/commands/common.ts +0 -61
  126. package/src/commands/dry.ts +0 -209
  127. package/src/commands/etherscan.ts +0 -360
  128. package/src/commands/index.ts +0 -5
  129. package/src/commands/list.ts +0 -249
  130. package/src/commands/run.ts +0 -146
  131. package/src/commands/utils.ts +0 -215
  132. package/src/index.ts +0 -67
  133. package/src/lib/__tests__/deployer-events.spec.ts +0 -338
  134. package/src/lib/__tests__/deployer.spec.ts +0 -2093
  135. package/src/lib/__tests__/network-loader.spec.ts +0 -150
  136. package/src/lib/__tests__/network-selection.spec.ts +0 -41
  137. package/src/lib/__tests__/network-utils.spec.ts +0 -230
  138. package/src/lib/artifacts/__tests__/fixtures/contract1.json +0 -19
  139. package/src/lib/artifacts/__tests__/fixtures/contract2.json +0 -19
  140. package/src/lib/artifacts/__tests__/fixtures/duplicate-name.json +0 -19
  141. package/src/lib/artifacts/__tests__/fixtures/nested/nested-contract.json +0 -18
  142. package/src/lib/artifacts/__tests__/fixtures/not-an-artifact.json +0 -8
  143. package/src/lib/artifacts/__tests__/fixtures/readme.txt +0 -2
  144. package/src/lib/contracts/__tests__/repository.spec.ts +0 -344
  145. package/src/lib/contracts/repository.ts +0 -313
  146. package/src/lib/core/__tests__/context.spec.ts +0 -37
  147. package/src/lib/core/__tests__/engine.spec.ts +0 -1889
  148. package/src/lib/core/__tests__/graph.spec.ts +0 -125
  149. package/src/lib/core/__tests__/json-integration.spec.ts +0 -425
  150. package/src/lib/core/__tests__/loader.spec.ts +0 -334
  151. package/src/lib/core/__tests__/multi-platform-verification.spec.ts +0 -406
  152. package/src/lib/core/__tests__/resolver.spec.ts +0 -2053
  153. package/src/lib/core/__tests__/static-action.spec.ts +0 -172
  154. package/src/lib/core/context.ts +0 -127
  155. package/src/lib/core/engine.ts +0 -1782
  156. package/src/lib/core/graph.ts +0 -252
  157. package/src/lib/core/loader.ts +0 -247
  158. package/src/lib/core/resolver.ts +0 -757
  159. package/src/lib/deployer.ts +0 -981
  160. package/src/lib/events/__tests__/event-system.spec.ts +0 -392
  161. package/src/lib/events/cli-adapter.ts +0 -369
  162. package/src/lib/events/emitter.ts +0 -62
  163. package/src/lib/events/index.ts +0 -3
  164. package/src/lib/events/types.ts +0 -520
  165. package/src/lib/index.ts +0 -14
  166. package/src/lib/network-loader.ts +0 -90
  167. package/src/lib/network-selection.ts +0 -73
  168. package/src/lib/network-utils.ts +0 -64
  169. package/src/lib/parsers/__tests__/buildinfo.spec.ts +0 -122
  170. package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-bytecode-buildinfo.json +0 -62
  171. package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-json.txt +0 -2
  172. package/src/lib/parsers/__tests__/fixtures/buildinfo/multi-contract-buildinfo.json +0 -89
  173. package/src/lib/parsers/__tests__/fixtures/buildinfo/no-contracts-buildinfo.json +0 -17
  174. package/src/lib/parsers/__tests__/fixtures/buildinfo/simple-buildinfo.json +0 -63
  175. package/src/lib/parsers/__tests__/fixtures/buildinfo/wrong-format.json +0 -4
  176. package/src/lib/parsers/__tests__/job.spec.ts +0 -358
  177. package/src/lib/parsers/__tests__/template.spec.ts +0 -111
  178. package/src/lib/parsers/artifact/__tests__/artifact.spec.ts +0 -117
  179. package/src/lib/parsers/artifact/__tests__/fixtures/empty-bytecode.json +0 -5
  180. package/src/lib/parsers/artifact/__tests__/fixtures/hardhat-artifact.json +0 -67
  181. package/src/lib/parsers/artifact/__tests__/fixtures/invalid-bytecode.json +0 -5
  182. package/src/lib/parsers/artifact/__tests__/fixtures/invalid-json.txt +0 -11
  183. package/src/lib/parsers/artifact/__tests__/fixtures/minimal-artifact.json +0 -5
  184. package/src/lib/parsers/artifact/__tests__/fixtures/missing-abi.json +0 -4
  185. package/src/lib/parsers/artifact/__tests__/fixtures/missing-bytecode.json +0 -11
  186. package/src/lib/parsers/artifact/__tests__/fixtures/missing-contract-name.json +0 -11
  187. package/src/lib/parsers/artifact/__tests__/fixtures/simple-artifact.json +0 -40
  188. package/src/lib/parsers/artifact/__tests__/fixtures/wrong-types.json +0 -7
  189. package/src/lib/parsers/artifact/foundry-1.2.ts +0 -72
  190. package/src/lib/parsers/artifact/index.ts +0 -27
  191. package/src/lib/parsers/artifact/types.ts +0 -9
  192. package/src/lib/parsers/buildinfo.ts +0 -127
  193. package/src/lib/parsers/constants.ts +0 -56
  194. package/src/lib/parsers/index.ts +0 -5
  195. package/src/lib/parsers/job.ts +0 -148
  196. package/src/lib/parsers/template.ts +0 -135
  197. package/src/lib/std/templates/arachnid-deterministic-deployment-proxy.yaml +0 -68
  198. package/src/lib/std/templates/assured-deployment.yaml +0 -46
  199. package/src/lib/std/templates/era-evm-predeploy.yaml +0 -35
  200. package/src/lib/std/templates/erc-2470.yaml +0 -70
  201. package/src/lib/std/templates/min-balance.yaml +0 -35
  202. package/src/lib/std/templates/nano-universal-deployer.yaml +0 -61
  203. package/src/lib/std/templates/raw-erc-2470.yaml +0 -62
  204. package/src/lib/std/templates/raw-nano-universal-deployer.yaml +0 -54
  205. package/src/lib/std/templates/raw-sequence-universal-deployer-2.yaml +0 -52
  206. package/src/lib/std/templates/sequence-universal-deployer-2.yaml +0 -61
  207. package/src/lib/types/__tests__/json-request-action.spec.ts +0 -243
  208. package/src/lib/types/__tests__/read-json-value.spec.ts +0 -278
  209. package/src/lib/types/__tests__/resolve-json-value.spec.ts +0 -769
  210. package/src/lib/types/actions.ts +0 -127
  211. package/src/lib/types/artifacts.ts +0 -21
  212. package/src/lib/types/buildinfo.ts +0 -116
  213. package/src/lib/types/conditions.ts +0 -50
  214. package/src/lib/types/contracts.ts +0 -23
  215. package/src/lib/types/definitions.ts +0 -70
  216. package/src/lib/types/index.ts +0 -8
  217. package/src/lib/types/network.ts +0 -33
  218. package/src/lib/types/project.ts +0 -9
  219. package/src/lib/types/task.ts +0 -9
  220. package/src/lib/types/values.ts +0 -150
  221. package/src/lib/utils/assertion.ts +0 -24
  222. package/src/lib/utils/validation.ts +0 -116
  223. package/src/lib/validation/contract-references.ts +0 -210
  224. package/src/lib/validation/index.ts +0 -1
  225. package/src/lib/verification/__tests__/etherscan.spec.ts +0 -710
  226. package/src/lib/verification/__tests__/sourcify.spec.ts +0 -288
  227. package/src/lib/verification/etherscan.ts +0 -547
  228. package/src/lib/verification/sourcify.ts +0 -248
  229. package/test_validation/artifacts/TestContract.json +0 -9
  230. package/test_validation/jobs/test-missing.yaml +0 -16
  231. package/test_validation/networks.yaml +0 -3
  232. package/tsconfig.json +0 -36
package/eslint.config.js DELETED
@@ -1,48 +0,0 @@
1
- const typescriptEslint = require('@typescript-eslint/eslint-plugin')
2
- const tsParser = require('@typescript-eslint/parser')
3
-
4
- module.exports = [
5
- {
6
- files: ['src/**/*.ts'],
7
- languageOptions: {
8
- parser: tsParser,
9
- ecmaVersion: 'latest',
10
- sourceType: 'module',
11
- },
12
- plugins: {
13
- '@typescript-eslint': typescriptEslint,
14
- },
15
- rules: {
16
- // Base ESLint rules
17
- 'prefer-const': 'error',
18
- 'no-var': 'error',
19
- 'semi': ['error', 'never'],
20
-
21
- // Unused variables and imports detection
22
- 'no-unused-vars': 'off', // Turn off base rule in favor of TypeScript version
23
- '@typescript-eslint/no-unused-vars': [
24
- 'warn',
25
- {
26
- vars: 'all',
27
- args: 'after-used',
28
- ignoreRestSiblings: true,
29
- argsIgnorePattern: '^_',
30
- varsIgnorePattern: '^_',
31
- caughtErrorsIgnorePattern: '^_',
32
- destructuredArrayIgnorePattern: '^_'
33
- }
34
- ],
35
-
36
- // Additional import/export rules for unused detection
37
- '@typescript-eslint/no-unused-expressions': 'warn',
38
-
39
- // TypeScript ESLint rules
40
- '@typescript-eslint/explicit-function-return-type': 'off',
41
- '@typescript-eslint/no-explicit-any': 'warn',
42
- '@typescript-eslint/no-var-requires': 'off',
43
- },
44
- },
45
- {
46
- ignores: ['dist/', 'node_modules/'],
47
- },
48
- ]
@@ -1,17 +0,0 @@
1
- name: "guards-v1"
2
- version: "1"
3
- description: "Deploy both prod and dev guards for Sequence v1"
4
- depends_on: ["sequence-v1"]
5
-
6
- actions:
7
- - name: "guard-v1-prod"
8
- template: "sequence-factory-v1"
9
- arguments:
10
- salt: "0xc99c1ab359199e4dcbd4603e9b2956d5681241ceb286359cf6a647ca56e6e128"
11
- implementation: "{{sequence-v1.main-module.address}}"
12
-
13
- - name: "guard-v1-dev"
14
- template: "sequence-factory-v1"
15
- arguments:
16
- salt: "6af209e2a5cca04bfdb4839aba939f715b1840930508af89e7692b21ddecd9b6"
17
- implementation: "{{sequence-v1.main-module.address}}"
@@ -1,59 +0,0 @@
1
- name: "sequence-v1-seq-0001-patch"
2
- version: "0001"
3
- description: "Sequence v1/v2 patch (SEQ-0001) for addressing guard signer takeover"
4
- depends_on: ["sequence-v1", "guards-v1"]
5
-
6
- actions:
7
- - name: "main-module-upgradeable-duo-v1"
8
- template: "sequence-universal-deployer-2"
9
- arguments:
10
- salt: "0"
11
- creationCode: "{{creationCode(f5b239d7b2e88a5adae55dea68f83bad)}}"
12
-
13
- - name: "main-module-upgradeable-duo-v2"
14
- template: "sequence-universal-deployer-2"
15
- arguments:
16
- salt: "0"
17
- creationCode: "{{creationCode(10326ce5047a2d596161984f678926c8)}}"
18
-
19
- # Ommited as sending the transaction deploys the migrator contracts
20
- # - name: "migrator-v1"
21
- # template: "sequence-universal-deployer-2"
22
- # arguments:
23
- # salt: "0"
24
- # creationCode:
25
- # type: "constructor-encode"
26
- # arguments:
27
- # - "{{221a4273dd7bb761ca6f3275c28e1d35}}"
28
- # - "0x596aF90CecdBF9A768886E771178fd5561dD27Ab"
29
- # - "0x5ca5d4cb6696df530c26b130a8fd86276a111f6696b3a8f2e76ff5edf94a2d84"
30
- # - "0xc99c1ab359199e4dcbd4603e9b2956d5681241ceb286359cf6a647ca56e6e128"
31
-
32
- # - name: "migrator-v2"
33
- # template: "sequence-universal-deployer-2"
34
- # arguments:
35
- # salt: "0"
36
- # creationCode:
37
- # type: "constructor-encode"
38
- # arguments:
39
- # - "{{7abcec3e347c6024794220b96a854a4e}}"
40
- # - "0x761f5e29944D79d76656323F106CF2efBF5F09e9"
41
- # - "0xacb659ac7f85fbbce197005235ced2d040c7b02942a9dfae647582393d5a4e83"
42
- # - "0x6e2f52838722eda7d569b52db277d0d87d36991a6aa9b9657ef9d8f09b0c33f4"
43
-
44
- - name: "patch-guard-v1-prod"
45
- template: "send-transaction"
46
- skip_condition:
47
- - type: "basic-arithmetic"
48
- arguments:
49
- operation: "eq"
50
- values:
51
- - type: "call"
52
- arguments:
53
- signature: "readNonce(uint256)"
54
- values:
55
- - "100"
56
- - "1"
57
- arguments:
58
- to: "{{guards-v1.guard-v1-prod.address}}"
59
- data: "{{patches/seq-0001/guard-v1-prod}}"
@@ -1,59 +0,0 @@
1
-
2
- name: "sequence-v1"
3
- version: "1.0.0"
4
- description: "The Sequence v1 contracts"
5
-
6
- actions:
7
- - name: "factory"
8
- template: "sequence-universal-deployer-2"
9
- arguments:
10
- creationCode: "{{Contract(sequence/v1/factory).creationCode}}"
11
- salt: "0"
12
-
13
- - name: "main-module"
14
- template: "sequence-universal-deployer-2"
15
- depends_on: ["factory"]
16
- arguments:
17
- salt: "0"
18
- creationCode:
19
- type: "constructor-encode"
20
- arguments:
21
- creationCode: "{{Contract(sequence/v1/main-module).creationCode}}"
22
- types: ["address"]
23
- values: ["{{factory.address}}"]
24
-
25
- - name: "main-module-upgradeable"
26
- template: "sequence-universal-deployer-2"
27
- arguments:
28
- salt: "0"
29
- creationCode: "{{Contract(sequence/v1/main-module-upgradeable).creationCode}}"
30
-
31
- - name: "guest-module"
32
- template: "sequence-universal-deployer-2"
33
- arguments:
34
- salt: "0"
35
- creationCode: "{{Contract(sequence/v1/guest-module).creationCode}}"
36
-
37
- - name: "sequence-utils"
38
- template: "sequence-universal-deployer-2"
39
- depends_on: ["factory", "main-module"]
40
- arguments:
41
- salt: "0"
42
- creationCode:
43
- type: "constructor-encode"
44
- arguments:
45
- creationCode: "{{Contract(sequence/v1/sequence-utils).creationCode}}"
46
- types: ["address", "address"]
47
- values: ["{{factory.address}}", "{{main-module.address}}"]
48
-
49
- - name: "require-fresh-signer-lib"
50
- template: "sequence-universal-deployer-2"
51
- depends_on: ["sequence-utils"]
52
- arguments:
53
- salt: "0"
54
- creationCode:
55
- type: "constructor-encode"
56
- arguments:
57
- creationCode: "{{Contract(sequence/v1/require-fresh-signer-lib).creationCode}}"
58
- types: ["address"]
59
- values: ["{{sequence-utils.address}}"]
@@ -1,56 +0,0 @@
1
- name: "sequence-factory-v1"
2
-
3
- arguments:
4
- implementation:
5
- type: "address"
6
- salt:
7
- type: "bytes32"
8
-
9
- returns:
10
- address:
11
- type: "address"
12
-
13
- setup:
14
- - type: "job-completed"
15
- arguments:
16
- job: "sequence-v1"
17
-
18
- actions:
19
- - type: "send-transaction"
20
- arguments:
21
- to: "{{sequence-v1.factory.address}}"
22
- data:
23
- type: "abi-encode"
24
- arguments:
25
- signature: "deploy(address,address)"
26
- values:
27
- - "{{implementation}}"
28
- - "{{salt}}"
29
-
30
- skip_condition:
31
- - type: "contract-exists"
32
- arguments:
33
- address:
34
- type: "compute-create2"
35
- arguments:
36
- deployerAddress: "{{sequence-v1.factory.address}}"
37
- salt: "{{salt}}"
38
- initCode:
39
- type: "constructor-encode"
40
- arguments:
41
- creationCode: "0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"
42
- types: ["address"]
43
- values: ["{{implementation}}"]
44
-
45
- outputs:
46
- address:
47
- type: "compute-create2"
48
- arguments:
49
- deployerAddress: "{{sequence-v1.factory.address}}"
50
- salt: "{{salt}}"
51
- initCode:
52
- type: "constructor-encode"
53
- arguments:
54
- creationCode: "0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"
55
- types: ["address"]
56
- values: ["{{implementation}}"]
package/jest.config.js DELETED
@@ -1,25 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- roots: ['<rootDir>/src'],
5
- testMatch: [
6
- '**/__tests__/**/*.ts',
7
- '**/?(*.)+(spec|test).ts'
8
- ],
9
- transform: {
10
- '^.+\\.ts$': 'ts-jest',
11
- },
12
- collectCoverageFrom: [
13
- 'src/**/*.ts',
14
- '!src/**/*.d.ts',
15
- '!src/index.ts'
16
- ],
17
- coverageDirectory: 'coverage',
18
- coverageReporters: [
19
- 'text',
20
- 'lcov',
21
- 'html'
22
- ],
23
- // Increase timeout for blockchain tests
24
- testTimeout: 30000
25
- };
package/src/cli.ts DELETED
@@ -1,17 +0,0 @@
1
- import { Command } from 'commander'
2
- import { makeRunCommand, makeDryRunCommand, makeListCommand, makeUtilsCommand } from './commands'
3
- import { makeEtherscanCommand } from './commands/etherscan'
4
-
5
- export function setupCommands(program: Command): void {
6
- // Make run the default command when no subcommand is provided
7
- program.addCommand(makeRunCommand(), {
8
- isDefault: true,
9
- hidden: false // Keep it visible in help
10
- })
11
-
12
- // Add other commands as subcommands
13
- program.addCommand(makeDryRunCommand())
14
- program.addCommand(makeListCommand())
15
- program.addCommand(makeUtilsCommand())
16
- program.addCommand(makeEtherscanCommand())
17
- }
@@ -1,61 +0,0 @@
1
- import { Command } from 'commander'
2
- import * as dotenv from 'dotenv'
3
- import * as path from 'path'
4
- import { ProjectLoader, ProjectLoaderOptions } from '../lib/core/loader'
5
- import { deploymentEvents } from '../lib/events'
6
-
7
- /**
8
- * Adds the --project option to a command.
9
- */
10
- export const projectOption = (cmd: Command): Command =>
11
- cmd.option('-p, --project <path>', 'Project root directory', process.cwd())
12
-
13
- /**
14
- * Adds the --dotenv option to a command.
15
- */
16
- export const dotenvOption = (cmd: Command): Command =>
17
- cmd.option('--dotenv <path>', 'Path to a custom .env file')
18
-
19
- /**
20
- * Adds the --no-std option to a command.
21
- */
22
- export const noStdOption = (cmd: Command): Command =>
23
- cmd.option('--no-std', 'Disable loading built-in standard templates')
24
-
25
- /**
26
- * Adds verbosity options to a command.
27
- */
28
- export const verbosityOption = (cmd: Command): Command =>
29
- cmd.option('-v, --verbose', 'Enable verbose logging (use -vv or -vvv for more detail)', (_, previous) => (previous || 0) + 1, 0)
30
-
31
- /**
32
- * Loads the project using the ProjectLoader and emits corresponding events.
33
- */
34
- export async function loadProject(projectRoot: string, options?: ProjectLoaderOptions): Promise<ProjectLoader> {
35
- deploymentEvents.emitEvent({
36
- type: 'project_loading_started',
37
- level: 'info',
38
- data: { projectRoot }
39
- })
40
-
41
- const loader = new ProjectLoader(projectRoot, options)
42
- await loader.load()
43
-
44
- deploymentEvents.emitEvent({
45
- type: 'project_loaded',
46
- level: 'info',
47
- data: {
48
- jobCount: loader.jobs.size,
49
- templateCount: loader.templates.size
50
- }
51
- })
52
- return loader
53
- }
54
-
55
- /**
56
- * Loads environment variables from the specified .env file path.
57
- */
58
- export function loadDotenv(options: { dotenv?: string }): void {
59
- const dotenvPath = options.dotenv ? path.resolve(options.dotenv) : path.resolve(process.cwd(), '.env')
60
- dotenv.config({ path: dotenvPath })
61
- }
@@ -1,209 +0,0 @@
1
- import { Command } from 'commander'
2
- import chalk from 'chalk'
3
- import { loadProject } from './common'
4
- import { loadNetworks } from '../lib/network-loader'
5
- import { DependencyGraph } from '../lib/core/graph'
6
- import { projectOption, noStdOption, verbosityOption } from './common'
7
- import { validateContractReferences, extractUsedContractReferences } from '../lib/validation/contract-references'
8
- import { setVerbosity } from '../index'
9
- import { resolveSelectedChainIds } from '../lib/network-selection'
10
- import { Template } from '../lib/types'
11
-
12
- interface DryRunOptions {
13
- project: string
14
- std: boolean
15
- network?: string
16
- verbose: number
17
- }
18
-
19
- /**
20
- * Extract only constant-like placeholders from a value, using template metadata when available.
21
- * A placeholder is treated as a constant candidate if:
22
- * - It is a bare identifier (no dot, no parentheses), AND
23
- * - It is NOT declared as a template argument in the current template (when template context provided)
24
- */
25
- function extractConstantRefs(value: unknown, refs: string[], templateCtx?: Template) {
26
- if (typeof value === 'string') {
27
- const m = value.match(/^{{(.*)}}$/)
28
- if (m) {
29
- const expr = m[1].trim()
30
-
31
- // Skip outputs or function-like references
32
- if (expr.includes('.') || expr.includes('(') || expr.includes(')')) return
33
-
34
- // If we have a template context, and the expr matches a declared argument, it's NOT a constant
35
- if (templateCtx?.arguments && Object.prototype.hasOwnProperty.call(templateCtx.arguments, expr)) {
36
- return
37
- }
38
-
39
- // Otherwise, treat as a constant candidate
40
- refs.push(expr)
41
- }
42
- } else if (Array.isArray(value)) {
43
- for (const v of value) extractConstantRefs(v, refs, templateCtx)
44
- } else if (value && typeof value === 'object') {
45
- for (const v of Object.values(value)) extractConstantRefs(v, refs, templateCtx)
46
- }
47
- }
48
-
49
- export function makeDryRunCommand(): Command {
50
- const dryRun = new Command('dry-run')
51
- .description('Validate project configuration and show execution plan without running transactions')
52
- .argument('[jobs...]', 'Specific job names to validate (and their dependencies).')
53
- .option('-n, --network <selectors>', 'Comma-separated network selectors (by chain ID or name).')
54
-
55
- projectOption(dryRun)
56
- noStdOption(dryRun)
57
- verbosityOption(dryRun)
58
-
59
- dryRun.action(async (jobs: string[], options: DryRunOptions) => {
60
- try {
61
- // Set verbosity level for logging
62
- setVerbosity(options.verbose as 0 | 1 | 2 | 3)
63
-
64
- console.log(chalk.bold.inverse(' DRY-RUN MODE '))
65
- const projectRoot = options.project
66
- const loader = await loadProject(projectRoot, {
67
- loadStdTemplates: options.std !== false
68
- })
69
- const allNetworks = await loadNetworks(projectRoot)
70
-
71
- console.log(chalk.blue('\nBuilding dependency graph...'))
72
- const graph = new DependencyGraph(loader.jobs, loader.templates)
73
- const fullOrder = graph.getExecutionOrder()
74
- console.log(chalk.green(' - Dependency graph built successfully.'))
75
-
76
- console.log(chalk.blue('\nContract Repository:'))
77
- console.log(chalk.green(` - Found ${loader.contractRepository.getAll().length} unique contracts.`))
78
-
79
- // Check for ambiguous references that are actually being used
80
- const usedRefs = await extractUsedContractReferences(loader)
81
- const allAmbiguousRefs = loader.contractRepository.getAmbiguousReferences()
82
- const usedRefNames = usedRefs.map(ref => ref.reference)
83
- const usedAmbiguousRefs = allAmbiguousRefs.filter(ref => usedRefNames.includes(ref))
84
-
85
- if (usedAmbiguousRefs.length > 0) {
86
- console.log(chalk.red('\n - Found ambiguous contract references being used:'))
87
- for (const ref of usedAmbiguousRefs) {
88
- console.log(chalk.red(` ✗ "${ref}" could refer to multiple contracts`))
89
- }
90
- throw new Error(`Found ${usedAmbiguousRefs.length} ambiguous contract reference(s) being used. Please use more specific references to resolve ambiguity.`)
91
- }
92
- console.log(chalk.green(' - All used contract references are unambiguous.'))
93
-
94
- // Validate that all Contract() references point to existing contracts
95
- console.log(chalk.blue('\nValidating contract references...'))
96
- const missingRefs = await validateContractReferences(loader)
97
- if (missingRefs.length > 0) {
98
- console.log(chalk.red('\n - Found missing contract references:'))
99
- for (const ref of missingRefs) {
100
- console.log(chalk.red(` ✗ ${ref.reference} in ${ref.location}`))
101
- }
102
- throw new Error(`Found ${missingRefs.length} missing contract reference(s). Please ensure all referenced contracts exist.`)
103
- }
104
- console.log(chalk.green(' - All contract references are valid.'))
105
-
106
- // Validate constant references exist
107
- console.log(chalk.blue('\nValidating constant references...'))
108
- const topLevelConstants = loader.constants
109
- const missingConstantRefs: Array<{ ref: string; location: string }> = []
110
-
111
- // Check jobs (arguments and outputs within templates are resolved at runtime; here we just check expressions)
112
- for (const [jobName, job] of loader.jobs.entries()) {
113
- // Collect refs in job actions
114
- for (let i = 0; i < job.actions.length; i++) {
115
- const action = job.actions[i]
116
- const refs: string[] = []
117
- extractConstantRefs(action.arguments, refs)
118
- const jobConstants = job.constants || {}
119
- for (const r of refs) {
120
- if (!(r in jobConstants) && !topLevelConstants.has(r)) {
121
- missingConstantRefs.push({ ref: r, location: `job '${jobName}', action ${i + 1}${action.name ? ` '${action.name}'` : ''}` })
122
- }
123
- }
124
- }
125
- }
126
-
127
- // Check templates (setup/actions/outputs)
128
- for (const [templateName, template] of loader.templates.entries()) {
129
- // actions
130
- for (let i = 0; i < template.actions.length; i++) {
131
- const action = template.actions[i]
132
- const refs: string[] = []
133
- extractConstantRefs(action.arguments, refs, template)
134
- for (const r of refs) {
135
- if (!topLevelConstants.has(r)) {
136
- missingConstantRefs.push({ ref: r, location: `template '${templateName}', action ${i + 1}${action.name ? ` '${action.name}'` : ''}` })
137
- }
138
- }
139
- }
140
- // setup actions
141
- if (template.setup?.actions) {
142
- for (let i = 0; i < (template.setup.actions?.length || 0); i++) {
143
- const action = template.setup.actions![i]
144
- const refs: string[] = []
145
- extractConstantRefs(action.arguments, refs, template)
146
- for (const r of refs) {
147
- if (!topLevelConstants.has(r)) {
148
- missingConstantRefs.push({ ref: r, location: `template '${templateName}' setup, action ${i + 1}${action.name ? ` '${action.name}'` : ''}` })
149
- }
150
- }
151
- }
152
- }
153
- // outputs
154
- if (template.outputs) {
155
- const refs: string[] = []
156
- extractConstantRefs(template.outputs, refs, template)
157
- for (const r of refs) {
158
- if (!topLevelConstants.has(r)) {
159
- missingConstantRefs.push({ ref: r, location: `template '${templateName}' outputs` })
160
- }
161
- }
162
- }
163
- }
164
-
165
- if (missingConstantRefs.length > 0) {
166
- console.log(chalk.red('\n - Found missing constant references:'))
167
- for (const m of missingConstantRefs) {
168
- console.log(chalk.red(` ✗ ${m.ref} in ${m.location}`))
169
- }
170
- throw new Error(`Found ${missingConstantRefs.length} missing constant reference(s). Ensure they are defined at top-level or in the job's constants.`)
171
- }
172
- console.log(chalk.green(' - All constant references are valid.'))
173
-
174
- const runJobs = jobs.length > 0 ? jobs : undefined
175
- const runOnNetworks = resolveSelectedChainIds(options.network, allNetworks)
176
-
177
- const jobsToRun = new Set<string>()
178
- if (runJobs) {
179
- for (const jobName of runJobs) {
180
- if (!loader.jobs.has(jobName)) {
181
- throw new Error(`Specified job "${jobName}" not found in project.`)
182
- }
183
- jobsToRun.add(jobName)
184
- graph.getDependencies(jobName).forEach(dep => jobsToRun.add(dep))
185
- }
186
- } else {
187
- fullOrder.forEach(j => jobsToRun.add(j))
188
- }
189
-
190
- const jobExecutionPlan = fullOrder.filter(jobName => jobsToRun.has(jobName))
191
- const targetNetworks = runOnNetworks
192
- ? allNetworks.filter(n => runOnNetworks.includes(n.chainId))
193
- : allNetworks
194
-
195
- console.log(chalk.blue('\nExecution Plan:'))
196
- console.log(chalk.gray(` - Target Networks: ${targetNetworks.map(n => `${n.name} (ChainID: ${n.chainId})`).join(', ')}`))
197
- console.log(chalk.gray(` - Job Execution Order: ${jobExecutionPlan.join(' -> ')}`))
198
-
199
- console.log(chalk.green.bold('\n✅ Dry run successful. All job and template definitions appear to be valid.'))
200
-
201
- } catch (error) {
202
- console.error(chalk.red.bold('\n💥 DRY RUN FAILED!'))
203
- console.error(chalk.red(error instanceof Error ? error.message : String(error)))
204
- process.exit(1)
205
- }
206
- })
207
-
208
- return dryRun
209
- }