@0xsequence/catapult 1.4.0 → 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 (163) hide show
  1. package/README.md +27 -0
  2. package/dist/lib/__tests__/network-loader.spec.js.map +1 -1
  3. package/dist/lib/core/__tests__/resolver.spec.js +22 -0
  4. package/dist/lib/core/__tests__/resolver.spec.js.map +1 -1
  5. package/dist/lib/core/__tests__/sign-actions.spec.d.ts +2 -0
  6. package/dist/lib/core/__tests__/sign-actions.spec.d.ts.map +1 -0
  7. package/dist/lib/core/__tests__/sign-actions.spec.js +128 -0
  8. package/dist/lib/core/__tests__/sign-actions.spec.js.map +1 -0
  9. package/dist/lib/core/__tests__/signer.spec.d.ts +2 -0
  10. package/dist/lib/core/__tests__/signer.spec.d.ts.map +1 -0
  11. package/dist/lib/core/__tests__/signer.spec.js +40 -0
  12. package/dist/lib/core/__tests__/signer.spec.js.map +1 -0
  13. package/dist/lib/core/context.d.ts +3 -2
  14. package/dist/lib/core/context.d.ts.map +1 -1
  15. package/dist/lib/core/context.js +3 -2
  16. package/dist/lib/core/context.js.map +1 -1
  17. package/dist/lib/core/engine.d.ts +4 -0
  18. package/dist/lib/core/engine.d.ts.map +1 -1
  19. package/dist/lib/core/engine.js +173 -0
  20. package/dist/lib/core/engine.js.map +1 -1
  21. package/dist/lib/core/signer.d.ts +7 -0
  22. package/dist/lib/core/signer.d.ts.map +1 -0
  23. package/dist/lib/core/signer.js +60 -0
  24. package/dist/lib/core/signer.js.map +1 -0
  25. package/dist/lib/parsers/__tests__/source.spec.js +37 -0
  26. package/dist/lib/parsers/__tests__/source.spec.js.map +1 -1
  27. package/dist/lib/parsers/source.js +1 -1
  28. package/dist/lib/parsers/source.js.map +1 -1
  29. package/dist/lib/provenance.js +51 -2
  30. package/dist/lib/provenance.js.map +1 -1
  31. package/dist/lib/types/actions.d.ts +26 -2
  32. package/dist/lib/types/actions.d.ts.map +1 -1
  33. package/dist/lib/types/actions.js +3 -0
  34. package/dist/lib/types/actions.js.map +1 -1
  35. package/dist/lib/types/source.d.ts +2 -0
  36. package/dist/lib/types/source.d.ts.map +1 -1
  37. package/package.json +4 -1
  38. package/.eslintrc.json +0 -29
  39. package/.github/workflows/ci.yml +0 -181
  40. package/CONCEPT.md +0 -24
  41. package/contracts/checked-call.huff +0 -65
  42. package/eslint.config.js +0 -48
  43. package/examples/jobs/guards-v1.yaml +0 -17
  44. package/examples/jobs/sequence-seq-0001-patch.yaml +0 -59
  45. package/examples/jobs/sequence-v1.yaml +0 -59
  46. package/examples/templates/sequence-factory-v1.yaml +0 -56
  47. package/jest.config.js +0 -25
  48. package/src/cli.ts +0 -18
  49. package/src/commands/common.ts +0 -61
  50. package/src/commands/dry.ts +0 -209
  51. package/src/commands/etherscan.ts +0 -360
  52. package/src/commands/index.ts +0 -6
  53. package/src/commands/list.ts +0 -262
  54. package/src/commands/provenance.ts +0 -120
  55. package/src/commands/run.ts +0 -146
  56. package/src/commands/utils.ts +0 -215
  57. package/src/index.ts +0 -67
  58. package/src/lib/__tests__/deployer-events.spec.ts +0 -338
  59. package/src/lib/__tests__/deployer.spec.ts +0 -2269
  60. package/src/lib/__tests__/network-loader.spec.ts +0 -150
  61. package/src/lib/__tests__/network-selection.spec.ts +0 -41
  62. package/src/lib/__tests__/network-utils.spec.ts +0 -230
  63. package/src/lib/__tests__/provenance.spec.ts +0 -208
  64. package/src/lib/artifacts/__tests__/fixtures/contract1.json +0 -19
  65. package/src/lib/artifacts/__tests__/fixtures/contract2.json +0 -19
  66. package/src/lib/artifacts/__tests__/fixtures/duplicate-name.json +0 -19
  67. package/src/lib/artifacts/__tests__/fixtures/nested/nested-contract.json +0 -18
  68. package/src/lib/artifacts/__tests__/fixtures/not-an-artifact.json +0 -8
  69. package/src/lib/artifacts/__tests__/fixtures/readme.txt +0 -2
  70. package/src/lib/contracts/__tests__/repository.spec.ts +0 -612
  71. package/src/lib/contracts/repository.ts +0 -411
  72. package/src/lib/core/__tests__/assert-action.spec.ts +0 -474
  73. package/src/lib/core/__tests__/context.spec.ts +0 -37
  74. package/src/lib/core/__tests__/engine.spec.ts +0 -2005
  75. package/src/lib/core/__tests__/graph.spec.ts +0 -125
  76. package/src/lib/core/__tests__/json-integration.spec.ts +0 -425
  77. package/src/lib/core/__tests__/loader.spec.ts +0 -367
  78. package/src/lib/core/__tests__/multi-platform-verification.spec.ts +0 -406
  79. package/src/lib/core/__tests__/resolver.spec.ts +0 -2496
  80. package/src/lib/core/__tests__/static-action.spec.ts +0 -172
  81. package/src/lib/core/context.ts +0 -127
  82. package/src/lib/core/engine.ts +0 -1834
  83. package/src/lib/core/graph.ts +0 -252
  84. package/src/lib/core/loader.ts +0 -253
  85. package/src/lib/core/resolver.ts +0 -873
  86. package/src/lib/deployer.ts +0 -1005
  87. package/src/lib/events/__tests__/event-system.spec.ts +0 -392
  88. package/src/lib/events/cli-adapter.ts +0 -369
  89. package/src/lib/events/emitter.ts +0 -62
  90. package/src/lib/events/index.ts +0 -3
  91. package/src/lib/events/types.ts +0 -520
  92. package/src/lib/index.ts +0 -17
  93. package/src/lib/network-loader.ts +0 -90
  94. package/src/lib/network-selection.ts +0 -73
  95. package/src/lib/network-utils.ts +0 -64
  96. package/src/lib/parsers/__tests__/buildinfo.spec.ts +0 -122
  97. package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-bytecode-buildinfo.json +0 -62
  98. package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-json.txt +0 -2
  99. package/src/lib/parsers/__tests__/fixtures/buildinfo/multi-contract-buildinfo.json +0 -89
  100. package/src/lib/parsers/__tests__/fixtures/buildinfo/no-contracts-buildinfo.json +0 -17
  101. package/src/lib/parsers/__tests__/fixtures/buildinfo/simple-buildinfo.json +0 -63
  102. package/src/lib/parsers/__tests__/fixtures/buildinfo/wrong-format.json +0 -4
  103. package/src/lib/parsers/__tests__/job.spec.ts +0 -439
  104. package/src/lib/parsers/__tests__/source.spec.ts +0 -134
  105. package/src/lib/parsers/__tests__/template.spec.ts +0 -111
  106. package/src/lib/parsers/artifact/__tests__/artifact.spec.ts +0 -117
  107. package/src/lib/parsers/artifact/__tests__/fixtures/empty-bytecode.json +0 -5
  108. package/src/lib/parsers/artifact/__tests__/fixtures/hardhat-artifact.json +0 -67
  109. package/src/lib/parsers/artifact/__tests__/fixtures/invalid-bytecode.json +0 -5
  110. package/src/lib/parsers/artifact/__tests__/fixtures/invalid-json.txt +0 -11
  111. package/src/lib/parsers/artifact/__tests__/fixtures/minimal-artifact.json +0 -5
  112. package/src/lib/parsers/artifact/__tests__/fixtures/missing-abi.json +0 -4
  113. package/src/lib/parsers/artifact/__tests__/fixtures/missing-bytecode.json +0 -11
  114. package/src/lib/parsers/artifact/__tests__/fixtures/missing-contract-name.json +0 -11
  115. package/src/lib/parsers/artifact/__tests__/fixtures/simple-artifact.json +0 -40
  116. package/src/lib/parsers/artifact/__tests__/fixtures/wrong-types.json +0 -7
  117. package/src/lib/parsers/artifact/foundry-1.2.ts +0 -72
  118. package/src/lib/parsers/artifact/index.ts +0 -27
  119. package/src/lib/parsers/artifact/types.ts +0 -9
  120. package/src/lib/parsers/buildinfo.ts +0 -127
  121. package/src/lib/parsers/constants.ts +0 -56
  122. package/src/lib/parsers/index.ts +0 -6
  123. package/src/lib/parsers/job.ts +0 -160
  124. package/src/lib/parsers/source.ts +0 -129
  125. package/src/lib/parsers/template.ts +0 -135
  126. package/src/lib/provenance.ts +0 -785
  127. package/src/lib/std/templates/arachnid-deterministic-deployment-proxy.yaml +0 -68
  128. package/src/lib/std/templates/assured-deployment.yaml +0 -46
  129. package/src/lib/std/templates/era-evm-predeploy.yaml +0 -35
  130. package/src/lib/std/templates/erc-2470.yaml +0 -70
  131. package/src/lib/std/templates/min-balance.yaml +0 -35
  132. package/src/lib/std/templates/nano-universal-deployer.yaml +0 -61
  133. package/src/lib/std/templates/raw-erc-2470.yaml +0 -62
  134. package/src/lib/std/templates/raw-nano-universal-deployer.yaml +0 -54
  135. package/src/lib/std/templates/raw-sequence-universal-deployer-2.yaml +0 -52
  136. package/src/lib/std/templates/sequence-universal-deployer-2.yaml +0 -61
  137. package/src/lib/types/__tests__/json-request-action.spec.ts +0 -243
  138. package/src/lib/types/__tests__/read-json-value.spec.ts +0 -278
  139. package/src/lib/types/__tests__/resolve-json-value.spec.ts +0 -769
  140. package/src/lib/types/actions.ts +0 -148
  141. package/src/lib/types/artifacts.ts +0 -21
  142. package/src/lib/types/buildinfo.ts +0 -116
  143. package/src/lib/types/conditions.ts +0 -50
  144. package/src/lib/types/contracts.ts +0 -26
  145. package/src/lib/types/definitions.ts +0 -77
  146. package/src/lib/types/index.ts +0 -9
  147. package/src/lib/types/network.ts +0 -33
  148. package/src/lib/types/project.ts +0 -9
  149. package/src/lib/types/source.ts +0 -26
  150. package/src/lib/types/task.ts +0 -9
  151. package/src/lib/types/values.ts +0 -221
  152. package/src/lib/utils/assertion.ts +0 -24
  153. package/src/lib/utils/validation.ts +0 -116
  154. package/src/lib/validation/contract-references.ts +0 -210
  155. package/src/lib/validation/index.ts +0 -1
  156. package/src/lib/verification/__tests__/etherscan.spec.ts +0 -710
  157. package/src/lib/verification/__tests__/sourcify.spec.ts +0 -288
  158. package/src/lib/verification/etherscan.ts +0 -547
  159. package/src/lib/verification/sourcify.ts +0 -248
  160. package/test_validation/artifacts/TestContract.json +0 -9
  161. package/test_validation/jobs/test-missing.yaml +0 -16
  162. package/test_validation/networks.yaml +0 -3
  163. package/tsconfig.json +0 -36
@@ -1,181 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
8
-
9
- jobs:
10
- install:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v4
15
-
16
- - name: Setup Node.js
17
- uses: actions/setup-node@v4
18
- with:
19
- node-version: '18'
20
-
21
- - name: Install pnpm
22
- uses: pnpm/action-setup@v2
23
- with:
24
- version: 9
25
-
26
- - name: Cache pnpm store
27
- uses: actions/cache@v4
28
- with:
29
- path: ~/.pnpm-store
30
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
31
- restore-keys: |
32
- ${{ runner.os }}-pnpm-store-
33
-
34
- - name: Cache node_modules
35
- uses: actions/cache@v4
36
- with:
37
- path: node_modules
38
- key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
39
- restore-keys: |
40
- ${{ runner.os }}-node-modules-
41
-
42
- - name: Install dependencies
43
- run: pnpm install --frozen-lockfile
44
-
45
- build:
46
- runs-on: ubuntu-latest
47
- needs: install
48
- steps:
49
- - name: Checkout code
50
- uses: actions/checkout@v4
51
-
52
- - name: Setup Node.js
53
- uses: actions/setup-node@v4
54
- with:
55
- node-version: '18'
56
-
57
- - name: Install pnpm
58
- uses: pnpm/action-setup@v2
59
- with:
60
- version: 9
61
-
62
- - name: Restore node_modules cache
63
- uses: actions/cache@v4
64
- with:
65
- path: node_modules
66
- key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
67
- restore-keys: |
68
- ${{ runner.os }}-node-modules-
69
-
70
- - name: Install dependencies (if cache miss)
71
- run: pnpm install --frozen-lockfile
72
-
73
- - name: Run build
74
- run: pnpm run build
75
-
76
- - name: Cache build artifacts
77
- uses: actions/cache@v4
78
- with:
79
- path: dist
80
- key: ${{ runner.os }}-build-${{ github.sha }}
81
-
82
- lint:
83
- runs-on: ubuntu-latest
84
- needs: install
85
- steps:
86
- - name: Checkout code
87
- uses: actions/checkout@v4
88
-
89
- - name: Setup Node.js
90
- uses: actions/setup-node@v4
91
- with:
92
- node-version: '18'
93
-
94
- - name: Install pnpm
95
- uses: pnpm/action-setup@v2
96
- with:
97
- version: 9
98
-
99
- - name: Restore node_modules cache
100
- uses: actions/cache@v4
101
- with:
102
- path: node_modules
103
- key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
104
- restore-keys: |
105
- ${{ runner.os }}-node-modules-
106
-
107
- - name: Install dependencies (if cache miss)
108
- run: pnpm install --frozen-lockfile
109
-
110
- - name: Run lint
111
- run: pnpm run lint
112
-
113
- test:
114
- runs-on: ubuntu-latest
115
- needs: [install, build]
116
- steps:
117
- - name: Checkout code
118
- uses: actions/checkout@v4
119
-
120
- - name: Setup Node.js
121
- uses: actions/setup-node@v4
122
- with:
123
- node-version: '18'
124
-
125
- - name: Install pnpm
126
- uses: pnpm/action-setup@v2
127
- with:
128
- version: 9
129
-
130
- - name: Restore node_modules cache
131
- uses: actions/cache@v4
132
- with:
133
- path: node_modules
134
- key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
135
- restore-keys: |
136
- ${{ runner.os }}-node-modules-
137
-
138
- - name: Restore build artifacts
139
- uses: actions/cache@v4
140
- with:
141
- path: dist
142
- key: ${{ runner.os }}-build-${{ github.sha }}
143
-
144
- - name: Install dependencies (if cache miss)
145
- run: pnpm install --frozen-lockfile
146
-
147
- - name: Install Foundry
148
- uses: foundry-rs/foundry-toolchain@v1
149
- with:
150
- version: nightly
151
-
152
- - name: Start Anvil
153
- run: |
154
- anvil --host 0.0.0.0 --accounts 10 --balance 1000 &
155
- # Wait for Anvil to be ready by checking if it responds to requests
156
- echo "Waiting for Anvil to be ready..."
157
- for i in {1..30}; do
158
- if curl -s -X POST -H "Content-Type: application/json" \
159
- --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \
160
- http://localhost:8545 > /dev/null 2>&1; then
161
- echo "Anvil is ready!"
162
- break
163
- fi
164
- echo "Attempt $i/30: Anvil not ready yet, waiting 1 second..."
165
- sleep 1
166
- done
167
-
168
- # Final check to ensure Anvil is responding
169
- if ! curl -s -X POST -H "Content-Type: application/json" \
170
- --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \
171
- http://localhost:8545 > /dev/null 2>&1; then
172
- echo "ERROR: Anvil failed to start properly!"
173
- exit 1
174
- fi
175
- env:
176
- ANVIL_IP_ADDR: 0.0.0.0
177
-
178
- - name: Run tests
179
- run: pnpm run test
180
- env:
181
- NODE_ENV: test
package/CONCEPT.md DELETED
@@ -1,24 +0,0 @@
1
- # Concept document - loosely defined idea
2
-
3
- The idea of this project is to create a contract deployment and management framework. It is not intended to be authenticated; it is intended to replay contract deployments or pre-signed transactions, and more generally unauthenticated actions. The need for this project is that Sequence has a multitude of contracts, migrations, factories, etc., that need to be deployed every time a new chain pops up (or local testing is needed), and keeping track of all these chains and their current deployment status is tricky. This project allows for the creation of a single repository of YAML files that define what needs to be deployed, in what order, and what depends on what.
4
-
5
- There should be two kinds of “actions” that can be defined for a deployment. One kind is “built-in” actions; these are defined by code. They include things like sending a transaction, sending a pre-signed transaction, calling the key machine, verifying a contract, calling a service, etc. They should be basic and primitive. Actions may return values—for example, a transaction hash when sending a transaction, or an ok/not-ok when verifying a contract, etc.
6
-
7
- Another primitive should be “modifiers” or “composite values.” These are also implemented with code in the project. They include doing ABI encode, constructor-arg encode, comparing whether a value is high enough, performing math, etc. These are required because sometimes operations depend on a formula derived from another operation (let’s say a universal deployer needs to have X funds to deploy the factory using Nick’s method; you need to compute how much you have to transfer to reach the threshold, etc.). A more common scenario is having to do ABI.encode or constructors.
8
-
9
- Ideally, these methods are pretty low-level, and most of the heavy lifting is done by “templates.” Templates are also actions, but they can be reused by other actions. For example, Sequence has its own factory contracts and deployers; we don’t want to define them in the project one by one. Instead, it would be best if these could be defined as templates and later reused, so adding more factory kinds does not require modifying this project and doing another release. It should be noted that sometimes factories themselves have to be deployed—for example, when we deploy the Sequence v1 factory we first have to deploy the universal deployer 2, and when we deploy the universal deployer 2 we first need the nano deployer, etc. So templates by themselves have a sort of “setup” factory.
10
-
11
- Jobs are a collection of actions. Some jobs may depend on other jobs; some actions within a job may depend on actions from within the same job, but no actions from one job can depend on actions from another job (the whole job has to depend). Actions can reference output values from other jobs as long as they depend on them. This defines a sort of order graph on which jobs and actions need to be executed. Some jobs and some actions may be 100% independent of each other.
12
-
13
- Networks can be defined in a `networks.yaml` file (or a directory with many networks; I am not sure yet). Each network has a name, explorer, chainId, and RPC. Networks may have modifiers, like how much gas has to be sent, etc., but by default the program should try to “guess it” by looking at past blocks. Jobs run by default on all networks unless some networks are excluded (`skip_networks`) or only some networks are requested (`only_networks`). These are arrays of chainIds in the YAML file.
14
-
15
- Signers are abstracted with the idea that eventually this can run in a browser and a MetaMask-like wallet could perform the transactions (acting as the relayer or the sender), but for now we just implement an EOA signer, a private key that has to be passed, and it is expected to have the funds needed to execute all the transactions and fund everything that needs to be funded. The CLI just takes that as an ENV variable or a CLI argument.
16
-
17
- One important aspect of the project is that it should simplify dealing with build artifacts, so it does not require too much manual work. The project should be able to reference any build artifact either by using the hash of the artifact (a hash that can be obtained with the command `bin artifacts hashes`) or by using the path to the artifact. Ideally, artifacts can be provided in different formats and the program just takes care of it; they could be JSON files, nested directories, JS files, etc. It should try to be as smart as possible in the sense that it just figures out the format.
18
-
19
- Running the CLI generates an `output` directory with job results. This contains the latest run date, the list of chainIds where everything has been successful, and the outputs of all actions and templates that ran on those jobs; each job has its own file. If there have been any errors, no output is generated, and instead the CLI fails. The CLI can run any number of jobs at the same time, and it just figures it out.
20
-
21
- The CLI also has methods to:
22
-
23
- * dry-run and verify the correctness of the YAML definitions of a project
24
- * obtain all the artifacts detected and their hashes
@@ -1,65 +0,0 @@
1
- #define macro MAIN() = takes(0) returns(0) {
2
- // Check if a contract is already deployed at the target address.
3
- // The target address is derived from arguments in bytecode (this is a constructor).
4
-
5
- // Initial Stack: []
6
- // copy all code to memory
7
- codesize // [<codesize>]
8
- returndatasize // [0x00, <codesize>]
9
- dup1 // [0x00, 0x00, <codesize>]
10
- codecopy // [<codesize>]
11
-
12
- contract_start // [<contract_start>]
13
- mload // [<contract_start_word>]
14
- 0x60 // [0x60, <contract_start_word>]
15
- shr // [<contract>] (Extracts the 160-bit address)
16
- returndatasize // [0x00, <contract>]
17
- dup2 // [<contract>, 0x00, <contract>]
18
- extcodesize // [size, 0x00, <contract>]
19
- done // [<done_pc>, size, 0x00, <contract>]
20
- jumpi // Jumps to 'done' if size > 0. Stack becomes: [0x00, <contract>]
21
-
22
- // --- If code continues, contract does not exist. Deploy it. ---
23
-
24
- // Do call to factory to deploy the contract
25
- dup1 // [0x00, 0x00, <contract>]
26
- dup1 // [0x00, 0x00, 0x00, <contract>]
27
- data_start // [<data_start>, 0x00, 0x00, 0x00, <contract>]
28
- codesize // [<codesize>, <data_start>, 0x00, 0x00, 0x00, <contract>]
29
- sub // [<creation_code_size>, 0x00, 0x00, 0x00, <contract>]
30
- data_start // [<data_start>, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
31
- dup3 // [0x00, <data_start>, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
32
- factory_start // [<factory_start>, 0x00, 0x00, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
33
- mload // [<factory_word>, 0x00, 0x00, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
34
- 0x60 // [0x60, <salt_word>, 0x00, 0x00, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
35
- shr // [<factory>, 0x00, 0x00, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
36
- gas // [gas, <factory>, 0x00, 0x00, <creation_code_size>, 0x00, 0x00, 0x00, <contract>]
37
-
38
- call // Pops 7 items, pushes 1. Stack: [<success_flag>, 0x00, <contract>]
39
- pop // [0x00, <contract>]
40
-
41
- // Check if the deployment call was successful
42
- swap1 // [<contract>, 0x00]
43
- extcodesize // [size, 0x00]
44
- done // [<done_pc>, size, 0x00]
45
- jumpi // Jumps to 'done' if size > 0. Stack becomes: [0x00]
46
-
47
- // If the contract is not deployed at this stage, revert
48
- dup1 // [0x00, 0x00]
49
- revert // Halts execution, reverting all state changes.
50
-
51
- done:
52
- // Path 1 (already deployed): [0x00, <contract>]
53
- // Path 2 (just deployed): [0x00]
54
- dup1 // Path 1 stack: [0x00, 0x00...]
55
- return
56
-
57
- // The contract ends here, this is a placeholder for the arguments
58
- contract_start:
59
- pc pc pc pc pc pc pc pc pc pc
60
- pc pc pc pc pc pc pc pc pc
61
- factory_start:
62
- pc pc pc pc pc pc pc pc pc pc
63
- pc pc pc pc pc pc pc pc pc
64
- data_start:
65
- }
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,18 +0,0 @@
1
- import { Command } from 'commander'
2
- import { makeRunCommand, makeDryRunCommand, makeListCommand, makeUtilsCommand, makeProvenanceCommand } 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
- program.addCommand(makeProvenanceCommand())
18
- }
@@ -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
- }