@0xsequence/catapult 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +29 -0
- package/.github/workflows/ci.yml +181 -0
- package/CONCEPT.md +24 -0
- package/README.md +772 -0
- package/contracts/checked-call.huff +65 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +16 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/common.d.ts +11 -0
- package/dist/commands/common.d.ts.map +1 -0
- package/dist/commands/common.js +73 -0
- package/dist/commands/common.js.map +1 -0
- package/dist/commands/dry.d.ts +3 -0
- package/dist/commands/dry.d.ts.map +1 -0
- package/dist/commands/dry.js +171 -0
- package/dist/commands/dry.js.map +1 -0
- package/dist/commands/etherscan.d.ts +3 -0
- package/dist/commands/etherscan.d.ts.map +1 -0
- package/dist/commands/etherscan.js +323 -0
- package/dist/commands/etherscan.js.map +1 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +22 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +259 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +96 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/utils.d.ts +3 -0
- package/dist/commands/utils.d.ts.map +1 -0
- package/dist/commands/utils.js +46 -0
- package/dist/commands/utils.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/__tests__/deployer-events.spec.d.ts +2 -0
- package/dist/lib/__tests__/deployer-events.spec.d.ts.map +1 -0
- package/dist/lib/__tests__/deployer-events.spec.js +260 -0
- package/dist/lib/__tests__/deployer-events.spec.js.map +1 -0
- package/dist/lib/__tests__/deployer.spec.d.ts +2 -0
- package/dist/lib/__tests__/deployer.spec.d.ts.map +1 -0
- package/dist/lib/__tests__/deployer.spec.js +884 -0
- package/dist/lib/__tests__/deployer.spec.js.map +1 -0
- package/dist/lib/__tests__/network-utils.spec.d.ts +2 -0
- package/dist/lib/__tests__/network-utils.spec.d.ts.map +1 -0
- package/dist/lib/__tests__/network-utils.spec.js +140 -0
- package/dist/lib/__tests__/network-utils.spec.js.map +1 -0
- package/dist/lib/contracts/__tests__/repository.spec.d.ts +2 -0
- package/dist/lib/contracts/__tests__/repository.spec.d.ts.map +1 -0
- package/dist/lib/contracts/__tests__/repository.spec.js +321 -0
- package/dist/lib/contracts/__tests__/repository.spec.js.map +1 -0
- package/dist/lib/contracts/repository.d.ts +27 -0
- package/dist/lib/contracts/repository.d.ts.map +1 -0
- package/dist/lib/contracts/repository.js +241 -0
- package/dist/lib/contracts/repository.js.map +1 -0
- package/dist/lib/core/__tests__/engine.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/engine.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/engine.spec.js +1212 -0
- package/dist/lib/core/__tests__/engine.spec.js.map +1 -0
- package/dist/lib/core/__tests__/graph.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/graph.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/graph.spec.js +116 -0
- package/dist/lib/core/__tests__/graph.spec.js.map +1 -0
- package/dist/lib/core/__tests__/json-integration.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/json-integration.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/json-integration.spec.js +300 -0
- package/dist/lib/core/__tests__/json-integration.spec.js.map +1 -0
- package/dist/lib/core/__tests__/loader.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/loader.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/loader.spec.js +288 -0
- package/dist/lib/core/__tests__/loader.spec.js.map +1 -0
- package/dist/lib/core/__tests__/multi-platform-verification.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/multi-platform-verification.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/multi-platform-verification.spec.js +342 -0
- package/dist/lib/core/__tests__/multi-platform-verification.spec.js.map +1 -0
- package/dist/lib/core/__tests__/resolver.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/resolver.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/resolver.spec.js +1367 -0
- package/dist/lib/core/__tests__/resolver.spec.js.map +1 -0
- package/dist/lib/core/__tests__/static-action.spec.d.ts +2 -0
- package/dist/lib/core/__tests__/static-action.spec.d.ts.map +1 -0
- package/dist/lib/core/__tests__/static-action.spec.js +136 -0
- package/dist/lib/core/__tests__/static-action.spec.js.map +1 -0
- package/dist/lib/core/context.d.ts +29 -0
- package/dist/lib/core/context.d.ts.map +1 -0
- package/dist/lib/core/context.js +88 -0
- package/dist/lib/core/context.js.map +1 -0
- package/dist/lib/core/engine.d.ts +25 -0
- package/dist/lib/core/engine.d.ts.map +1 -0
- package/dist/lib/core/engine.js +1191 -0
- package/dist/lib/core/engine.js.map +1 -0
- package/dist/lib/core/graph.d.ts +18 -0
- package/dist/lib/core/graph.d.ts.map +1 -0
- package/dist/lib/core/graph.js +158 -0
- package/dist/lib/core/graph.js.map +1 -0
- package/dist/lib/core/loader.d.ts +25 -0
- package/dist/lib/core/loader.d.ts.map +1 -0
- package/dist/lib/core/loader.js +248 -0
- package/dist/lib/core/loader.js.map +1 -0
- package/dist/lib/core/resolver.d.ts +20 -0
- package/dist/lib/core/resolver.d.ts.map +1 -0
- package/dist/lib/core/resolver.js +307 -0
- package/dist/lib/core/resolver.js.map +1 -0
- package/dist/lib/deployer.d.ts +39 -0
- package/dist/lib/deployer.d.ts.map +1 -0
- package/dist/lib/deployer.js +533 -0
- package/dist/lib/deployer.js.map +1 -0
- package/dist/lib/events/__tests__/event-system.spec.d.ts +2 -0
- package/dist/lib/events/__tests__/event-system.spec.d.ts.map +1 -0
- package/dist/lib/events/__tests__/event-system.spec.js +256 -0
- package/dist/lib/events/__tests__/event-system.spec.js.map +1 -0
- package/dist/lib/events/cli-adapter.d.ts +13 -0
- package/dist/lib/events/cli-adapter.d.ts.map +1 -0
- package/dist/lib/events/cli-adapter.js +244 -0
- package/dist/lib/events/cli-adapter.js.map +1 -0
- package/dist/lib/events/emitter.d.ts +11 -0
- package/dist/lib/events/emitter.d.ts.map +1 -0
- package/dist/lib/events/emitter.js +29 -0
- package/dist/lib/events/emitter.js.map +1 -0
- package/dist/lib/events/index.d.ts +4 -0
- package/dist/lib/events/index.d.ts.map +1 -0
- package/dist/lib/events/index.js +20 -0
- package/dist/lib/events/index.js.map +1 -0
- package/dist/lib/events/types.d.ts +368 -0
- package/dist/lib/events/types.d.ts.map +1 -0
- package/dist/lib/events/types.js +3 -0
- package/dist/lib/events/types.js.map +1 -0
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +44 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/network-loader.d.ts +3 -0
- package/dist/lib/network-loader.d.ts.map +1 -0
- package/dist/lib/network-loader.js +80 -0
- package/dist/lib/network-loader.js.map +1 -0
- package/dist/lib/network-match.d.ts +3 -0
- package/dist/lib/network-match.d.ts.map +1 -0
- package/dist/lib/network-match.js +62 -0
- package/dist/lib/network-match.js.map +1 -0
- package/dist/lib/network-utils.d.ts +4 -0
- package/dist/lib/network-utils.d.ts.map +1 -0
- package/dist/lib/network-utils.js +39 -0
- package/dist/lib/network-utils.js.map +1 -0
- package/dist/lib/parsers/__tests__/buildinfo.spec.d.ts +2 -0
- package/dist/lib/parsers/__tests__/buildinfo.spec.d.ts.map +1 -0
- package/dist/lib/parsers/__tests__/buildinfo.spec.js +132 -0
- package/dist/lib/parsers/__tests__/buildinfo.spec.js.map +1 -0
- package/dist/lib/parsers/__tests__/job.spec.d.ts +2 -0
- package/dist/lib/parsers/__tests__/job.spec.d.ts.map +1 -0
- package/dist/lib/parsers/__tests__/job.spec.js +318 -0
- package/dist/lib/parsers/__tests__/job.spec.js.map +1 -0
- package/dist/lib/parsers/__tests__/template.spec.d.ts +2 -0
- package/dist/lib/parsers/__tests__/template.spec.d.ts.map +1 -0
- package/dist/lib/parsers/__tests__/template.spec.js +126 -0
- package/dist/lib/parsers/__tests__/template.spec.js.map +1 -0
- package/dist/lib/parsers/artifact/__tests__/artifact.spec.d.ts +2 -0
- package/dist/lib/parsers/artifact/__tests__/artifact.spec.d.ts.map +1 -0
- package/dist/lib/parsers/artifact/__tests__/artifact.spec.js +128 -0
- package/dist/lib/parsers/artifact/__tests__/artifact.spec.js.map +1 -0
- package/dist/lib/parsers/artifact/foundry-1.2.d.ts +3 -0
- package/dist/lib/parsers/artifact/foundry-1.2.d.ts.map +1 -0
- package/dist/lib/parsers/artifact/foundry-1.2.js +82 -0
- package/dist/lib/parsers/artifact/foundry-1.2.js.map +1 -0
- package/dist/lib/parsers/artifact/index.d.ts +3 -0
- package/dist/lib/parsers/artifact/index.d.ts.map +1 -0
- package/dist/lib/parsers/artifact/index.js +17 -0
- package/dist/lib/parsers/artifact/index.js.map +1 -0
- package/dist/lib/parsers/artifact/types.d.ts +3 -0
- package/dist/lib/parsers/artifact/types.d.ts.map +1 -0
- package/dist/lib/parsers/artifact/types.js +3 -0
- package/dist/lib/parsers/artifact/types.js.map +1 -0
- package/dist/lib/parsers/buildinfo.d.ts +5 -0
- package/dist/lib/parsers/buildinfo.d.ts.map +1 -0
- package/dist/lib/parsers/buildinfo.js +85 -0
- package/dist/lib/parsers/buildinfo.js.map +1 -0
- package/dist/lib/parsers/constants.d.ts +4 -0
- package/dist/lib/parsers/constants.d.ts.map +1 -0
- package/dist/lib/parsers/constants.js +45 -0
- package/dist/lib/parsers/constants.js.map +1 -0
- package/dist/lib/parsers/index.d.ts +5 -0
- package/dist/lib/parsers/index.d.ts.map +1 -0
- package/dist/lib/parsers/index.js +21 -0
- package/dist/lib/parsers/index.js.map +1 -0
- package/dist/lib/parsers/job.d.ts +3 -0
- package/dist/lib/parsers/job.d.ts.map +1 -0
- package/dist/lib/parsers/job.js +74 -0
- package/dist/lib/parsers/job.js.map +1 -0
- package/dist/lib/parsers/template.d.ts +3 -0
- package/dist/lib/parsers/template.d.ts.map +1 -0
- package/dist/lib/parsers/template.js +91 -0
- package/dist/lib/parsers/template.js.map +1 -0
- package/dist/lib/std/templates/assured-deployment.yaml +45 -0
- package/dist/lib/std/templates/erc-2470.yaml +67 -0
- package/dist/lib/std/templates/min-balance.yaml +32 -0
- package/dist/lib/std/templates/nano-universal-deployer.yaml +59 -0
- package/dist/lib/std/templates/raw-erc-2470.yaml +59 -0
- package/dist/lib/std/templates/raw-nano-universal-deployer.yaml +51 -0
- package/dist/lib/std/templates/raw-sequence-universal-deployer-2.yaml +48 -0
- package/dist/lib/std/templates/sequence-universal-deployer-2.yaml +57 -0
- package/dist/lib/types/__tests__/json-request-action.spec.d.ts +2 -0
- package/dist/lib/types/__tests__/json-request-action.spec.d.ts.map +1 -0
- package/dist/lib/types/__tests__/json-request-action.spec.js +219 -0
- package/dist/lib/types/__tests__/json-request-action.spec.js.map +1 -0
- package/dist/lib/types/__tests__/read-json-value.spec.d.ts +2 -0
- package/dist/lib/types/__tests__/read-json-value.spec.d.ts.map +1 -0
- package/dist/lib/types/__tests__/read-json-value.spec.js +233 -0
- package/dist/lib/types/__tests__/read-json-value.spec.js.map +1 -0
- package/dist/lib/types/actions.d.ts +74 -0
- package/dist/lib/types/actions.d.ts.map +1 -0
- package/dist/lib/types/actions.js +18 -0
- package/dist/lib/types/actions.js.map +1 -0
- package/dist/lib/types/artifacts.d.ts +15 -0
- package/dist/lib/types/artifacts.d.ts.map +1 -0
- package/dist/lib/types/artifacts.js +3 -0
- package/dist/lib/types/artifacts.js.map +1 -0
- package/dist/lib/types/buildinfo.d.ts +112 -0
- package/dist/lib/types/buildinfo.d.ts.map +1 -0
- package/dist/lib/types/buildinfo.js +3 -0
- package/dist/lib/types/buildinfo.js.map +1 -0
- package/dist/lib/types/conditions.d.ts +17 -0
- package/dist/lib/types/conditions.d.ts.map +1 -0
- package/dist/lib/types/conditions.js +21 -0
- package/dist/lib/types/conditions.js.map +1 -0
- package/dist/lib/types/contracts.d.ts +14 -0
- package/dist/lib/types/contracts.d.ts.map +1 -0
- package/dist/lib/types/contracts.js +3 -0
- package/dist/lib/types/contracts.js.map +1 -0
- package/dist/lib/types/definitions.d.ts +51 -0
- package/dist/lib/types/definitions.d.ts.map +1 -0
- package/dist/lib/types/definitions.js +3 -0
- package/dist/lib/types/definitions.js.map +1 -0
- package/dist/lib/types/index.d.ts +9 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/index.js +25 -0
- package/dist/lib/types/index.js.map +1 -0
- package/dist/lib/types/network.d.ts +9 -0
- package/dist/lib/types/network.d.ts.map +1 -0
- package/dist/lib/types/network.js +3 -0
- package/dist/lib/types/network.js.map +1 -0
- package/dist/lib/types/project.d.ts +5 -0
- package/dist/lib/types/project.d.ts.map +1 -0
- package/dist/lib/types/project.js +3 -0
- package/dist/lib/types/project.js.map +1 -0
- package/dist/lib/types/task.d.ts +9 -0
- package/dist/lib/types/task.d.ts.map +1 -0
- package/dist/lib/types/task.js +3 -0
- package/dist/lib/types/task.js.map +1 -0
- package/dist/lib/types/values.d.ts +78 -0
- package/dist/lib/types/values.d.ts.map +1 -0
- package/dist/lib/types/values.js +3 -0
- package/dist/lib/types/values.js.map +1 -0
- package/dist/lib/utils/validation.d.ts +5 -0
- package/dist/lib/utils/validation.d.ts.map +1 -0
- package/dist/lib/utils/validation.js +77 -0
- package/dist/lib/utils/validation.js.map +1 -0
- package/dist/lib/validation/contract-references.d.ts +12 -0
- package/dist/lib/validation/contract-references.d.ts.map +1 -0
- package/dist/lib/validation/contract-references.js +112 -0
- package/dist/lib/validation/contract-references.js.map +1 -0
- package/dist/lib/validation/index.d.ts +1 -0
- package/dist/lib/validation/index.d.ts.map +1 -0
- package/dist/lib/validation/index.js +2 -0
- package/dist/lib/validation/index.js.map +1 -0
- package/dist/lib/verification/__tests__/etherscan.spec.d.ts +2 -0
- package/dist/lib/verification/__tests__/etherscan.spec.d.ts.map +1 -0
- package/dist/lib/verification/__tests__/etherscan.spec.js +565 -0
- package/dist/lib/verification/__tests__/etherscan.spec.js.map +1 -0
- package/dist/lib/verification/__tests__/sourcify.spec.d.ts +2 -0
- package/dist/lib/verification/__tests__/sourcify.spec.d.ts.map +1 -0
- package/dist/lib/verification/__tests__/sourcify.spec.js +212 -0
- package/dist/lib/verification/__tests__/sourcify.spec.js.map +1 -0
- package/dist/lib/verification/etherscan.d.ts +56 -0
- package/dist/lib/verification/etherscan.d.ts.map +1 -0
- package/dist/lib/verification/etherscan.js +340 -0
- package/dist/lib/verification/etherscan.js.map +1 -0
- package/dist/lib/verification/sourcify.d.ts +12 -0
- package/dist/lib/verification/sourcify.d.ts.map +1 -0
- package/dist/lib/verification/sourcify.js +227 -0
- package/dist/lib/verification/sourcify.js.map +1 -0
- package/eslint.config.js +48 -0
- package/examples/jobs/guards-v1.yaml +17 -0
- package/examples/jobs/sequence-seq-0001-patch.yaml +59 -0
- package/examples/jobs/sequence-v1.yaml +59 -0
- package/examples/templates/sequence-factory-v1.yaml +56 -0
- package/jest.config.js +25 -0
- package/package.json +68 -0
- package/src/cli.ts +17 -0
- package/src/commands/common.ts +61 -0
- package/src/commands/dry.ts +208 -0
- package/src/commands/etherscan.ts +360 -0
- package/src/commands/index.ts +5 -0
- package/src/commands/list.ts +249 -0
- package/src/commands/run.ts +136 -0
- package/src/commands/utils.ts +52 -0
- package/src/index.ts +67 -0
- package/src/lib/__tests__/deployer-events.spec.ts +338 -0
- package/src/lib/__tests__/deployer.spec.ts +1204 -0
- package/src/lib/__tests__/network-utils.spec.ts +181 -0
- package/src/lib/artifacts/__tests__/fixtures/contract1.json +19 -0
- package/src/lib/artifacts/__tests__/fixtures/contract2.json +19 -0
- package/src/lib/artifacts/__tests__/fixtures/duplicate-name.json +19 -0
- package/src/lib/artifacts/__tests__/fixtures/nested/nested-contract.json +18 -0
- package/src/lib/artifacts/__tests__/fixtures/not-an-artifact.json +8 -0
- package/src/lib/artifacts/__tests__/fixtures/readme.txt +2 -0
- package/src/lib/contracts/__tests__/repository.spec.ts +344 -0
- package/src/lib/contracts/repository.ts +313 -0
- package/src/lib/core/__tests__/engine.spec.ts +1514 -0
- package/src/lib/core/__tests__/graph.spec.ts +125 -0
- package/src/lib/core/__tests__/json-integration.spec.ts +360 -0
- package/src/lib/core/__tests__/loader.spec.ts +334 -0
- package/src/lib/core/__tests__/multi-platform-verification.spec.ts +406 -0
- package/src/lib/core/__tests__/resolver.spec.ts +1693 -0
- package/src/lib/core/__tests__/static-action.spec.ts +172 -0
- package/src/lib/core/context.ts +127 -0
- package/src/lib/core/engine.ts +1531 -0
- package/src/lib/core/graph.ts +252 -0
- package/src/lib/core/loader.ts +263 -0
- package/src/lib/core/resolver.ts +498 -0
- package/src/lib/deployer.ts +768 -0
- package/src/lib/events/__tests__/event-system.spec.ts +343 -0
- package/src/lib/events/cli-adapter.ts +325 -0
- package/src/lib/events/emitter.ts +62 -0
- package/src/lib/events/index.ts +3 -0
- package/src/lib/events/types.ts +469 -0
- package/src/lib/index.ts +14 -0
- package/src/lib/network-loader.ts +59 -0
- package/src/lib/network-utils.ts +64 -0
- package/src/lib/parsers/__tests__/buildinfo.spec.ts +122 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-bytecode-buildinfo.json +62 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/invalid-json.txt +2 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/multi-contract-buildinfo.json +89 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/no-contracts-buildinfo.json +17 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/simple-buildinfo.json +63 -0
- package/src/lib/parsers/__tests__/fixtures/buildinfo/wrong-format.json +4 -0
- package/src/lib/parsers/__tests__/job.spec.ts +335 -0
- package/src/lib/parsers/__tests__/template.spec.ts +111 -0
- package/src/lib/parsers/artifact/__tests__/artifact.spec.ts +117 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/empty-bytecode.json +5 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/hardhat-artifact.json +67 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/invalid-bytecode.json +5 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/invalid-json.txt +11 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/minimal-artifact.json +5 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-abi.json +4 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-bytecode.json +11 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/missing-contract-name.json +11 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/simple-artifact.json +40 -0
- package/src/lib/parsers/artifact/__tests__/fixtures/wrong-types.json +7 -0
- package/src/lib/parsers/artifact/foundry-1.2.ts +72 -0
- package/src/lib/parsers/artifact/index.ts +27 -0
- package/src/lib/parsers/artifact/types.ts +9 -0
- package/src/lib/parsers/buildinfo.ts +127 -0
- package/src/lib/parsers/constants.ts +56 -0
- package/src/lib/parsers/index.ts +5 -0
- package/src/lib/parsers/job.ts +101 -0
- package/src/lib/parsers/template.ts +131 -0
- package/src/lib/std/templates/assured-deployment.yaml +45 -0
- package/src/lib/std/templates/erc-2470.yaml +67 -0
- package/src/lib/std/templates/min-balance.yaml +32 -0
- package/src/lib/std/templates/nano-universal-deployer.yaml +59 -0
- package/src/lib/std/templates/raw-erc-2470.yaml +59 -0
- package/src/lib/std/templates/raw-nano-universal-deployer.yaml +51 -0
- package/src/lib/std/templates/raw-sequence-universal-deployer-2.yaml +48 -0
- package/src/lib/std/templates/sequence-universal-deployer-2.yaml +57 -0
- package/src/lib/types/__tests__/json-request-action.spec.ts +243 -0
- package/src/lib/types/__tests__/read-json-value.spec.ts +264 -0
- package/src/lib/types/actions.ts +127 -0
- package/src/lib/types/artifacts.ts +21 -0
- package/src/lib/types/buildinfo.ts +116 -0
- package/src/lib/types/conditions.ts +50 -0
- package/src/lib/types/contracts.ts +23 -0
- package/src/lib/types/definitions.ts +68 -0
- package/src/lib/types/index.ts +8 -0
- package/src/lib/types/network.ts +22 -0
- package/src/lib/types/project.ts +9 -0
- package/src/lib/types/task.ts +9 -0
- package/src/lib/types/values.ts +116 -0
- package/src/lib/utils/validation.ts +116 -0
- package/src/lib/validation/contract-references.ts +210 -0
- package/src/lib/validation/index.ts +1 -0
- package/src/lib/verification/__tests__/etherscan.spec.ts +710 -0
- package/src/lib/verification/__tests__/sourcify.spec.ts +288 -0
- package/src/lib/verification/etherscan.ts +546 -0
- package/src/lib/verification/sourcify.ts +248 -0
- package/test_validation/artifacts/TestContract.json +9 -0
- package/test_validation/jobs/test-missing.yaml +16 -0
- package/test_validation/networks.yaml +3 -0
- package/tsconfig.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
# Catapult
|
|
2
|
+
|
|
3
|
+
**Catapult** is a powerful Ethereum contract deployment and management framework designed to simplify the orchestration of complex contract deployments across multiple blockchain networks. Built with TypeScript and Node.js, it provides a declarative YAML-based approach to defining deployment jobs, templates, and dependencies.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Catapult addresses the challenge of managing complex contract deployment scenarios where multiple contracts need to be deployed in a specific order, with dependencies between them, across multiple blockchain networks. Instead of writing custom deployment scripts for each scenario, you define your deployment logic declaratively using YAML files.
|
|
8
|
+
|
|
9
|
+
### Key Features
|
|
10
|
+
|
|
11
|
+
- **🔄 Declarative Deployment Jobs**: Define complex deployment workflows using YAML configuration files
|
|
12
|
+
- **📋 Template System**: Create reusable deployment templates that can be shared across projects
|
|
13
|
+
- **🔗 Dependency Management**: Automatic resolution of deployment dependencies and execution ordering
|
|
14
|
+
- **🌐 Multi-Network Support**: Deploy to multiple blockchain networks simultaneously
|
|
15
|
+
- **⚡ Built-in Actions**: Comprehensive set of built-in actions for common deployment tasks
|
|
16
|
+
- **🧮 Value Resolvers**: Powerful system for computing values, encoding data, and performing calculations
|
|
17
|
+
- **✅ Skip Conditions**: Smart conditional logic to avoid redundant deployments
|
|
18
|
+
- **🔍 Validation & Dry Run**: Validate configurations and preview deployment plans without execution
|
|
19
|
+
- **📊 Event System**: Rich event system for monitoring deployment progress and debugging
|
|
20
|
+
- **🧾 Multi-platform Verification**: Verify on Etherscan v2 and Sourcify (tries all configured platforms by default)
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
### From Source
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git clone <repository-url>
|
|
28
|
+
cd catapult
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
npm link
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Global Installation (when published)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g catapult
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Project Structure
|
|
41
|
+
|
|
42
|
+
A Catapult project follows this structure:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
my-deployment-project/
|
|
46
|
+
├── networks.yaml # Network configurations
|
|
47
|
+
├── jobs/ # Deployment job definitions
|
|
48
|
+
│ ├── core-contracts.yaml
|
|
49
|
+
│ ├── factory-setup.yaml
|
|
50
|
+
│ └── token-deployment.yaml
|
|
51
|
+
├── templates/ # Custom template definitions
|
|
52
|
+
│ ├── erc20-factory.yaml
|
|
53
|
+
│ └── proxy-deployment.yaml
|
|
54
|
+
├── artifacts/ # Contract build artifacts
|
|
55
|
+
│ ├── MyContract.json
|
|
56
|
+
│ └── Factory.json
|
|
57
|
+
└── output/ # Generated deployment results
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
### Networks Configuration
|
|
63
|
+
|
|
64
|
+
Create a `networks.yaml` file in your project root to define target networks:
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
- name: "Ethereum Mainnet"
|
|
68
|
+
chainId: 1
|
|
69
|
+
rpcUrl: "https://mainnet.infura.io/v3/YOUR_PROJECT_ID"
|
|
70
|
+
|
|
71
|
+
- name: "Arbitrum One"
|
|
72
|
+
chainId: 42161
|
|
73
|
+
rpcUrl: "https://arb1.arbitrum.io/rpc"
|
|
74
|
+
|
|
75
|
+
- name: "Polygon"
|
|
76
|
+
chainId: 137
|
|
77
|
+
rpcUrl: "https://polygon-rpc.com"
|
|
78
|
+
supports: ["etherscan_v2"] # Optional: verification platforms supported
|
|
79
|
+
gasLimit: 500000 # Optional: gas limit for all transactions on this network
|
|
80
|
+
testnet: true # Optional: mark as test network
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `supports` field is optional and specifies which verification platforms are available for the network. Currently supported platforms:
|
|
84
|
+
|
|
85
|
+
- `etherscan_v2`: Etherscan v2 verification API (supports Ethereum, Polygon, Arbitrum, BSC, etc.)
|
|
86
|
+
- `sourcify`: Sourcify verification (no API key required)
|
|
87
|
+
|
|
88
|
+
If `supports` is omitted, all built-in platforms are allowed for that network. Etherscan requires an API key to be considered “configured”; Sourcify requires no configuration. The `gasLimit` field is optional and specifies a fixed gas limit to use for all transactions on this network. If not specified, the system will use ethers.js default gas estimation.
|
|
89
|
+
|
|
90
|
+
### Constants
|
|
91
|
+
|
|
92
|
+
You can define reusable values in constants files or directly within a job.
|
|
93
|
+
|
|
94
|
+
- Top-level constants are discovered anywhere under your project root by adding YAML files with `type: "constants"`.
|
|
95
|
+
- Keys must be unique across all constants files; duplicates will fail the load.
|
|
96
|
+
- Within jobs/templates, reference constants using bare placeholders like `{{MY_CONSTANT}}`.
|
|
97
|
+
- Job-level constants override top-level constants when names collide.
|
|
98
|
+
|
|
99
|
+
Example top-level constants file (can be placed anywhere, e.g., `constants.yaml`):
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
type: "constants"
|
|
103
|
+
|
|
104
|
+
constants:
|
|
105
|
+
address-zero: "0x0000000000000000000000000000000000000000"
|
|
106
|
+
salt-zero: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
|
107
|
+
developer-multisig-01: "0x007a47e6BF40C1e0ed5c01aE42fDC75879140bc4"
|
|
108
|
+
entrypoint-4337-07: "0x0000000071727de22e5e9d8baf0edac6f37da032"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Job-level constants example (defined at the top of a job):
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
name: "job-with-constants"
|
|
115
|
+
version: "1"
|
|
116
|
+
constants:
|
|
117
|
+
FEE: "1000"
|
|
118
|
+
ADMIN: "0x0000000000000000000000000000000000000001"
|
|
119
|
+
actions:
|
|
120
|
+
- name: "example"
|
|
121
|
+
template: "some-template"
|
|
122
|
+
arguments:
|
|
123
|
+
admin: "{{ADMIN}}" # resolves to job-level constant
|
|
124
|
+
defaultSalt: "{{salt-zero}}" # resolves to top-level constant
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Tip: Use `catapult list constants` to see discovered top-level constants and any job-level constants.
|
|
128
|
+
|
|
129
|
+
### Job Definitions
|
|
130
|
+
|
|
131
|
+
Jobs are the core deployment units. Create YAML files in the `jobs/` directory:
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
# jobs/core-contracts.yaml
|
|
135
|
+
name: "core-contracts"
|
|
136
|
+
version: "1.0.0"
|
|
137
|
+
description: "Deploy core system contracts"
|
|
138
|
+
|
|
139
|
+
actions:
|
|
140
|
+
- name: "deploy-factory"
|
|
141
|
+
template: "sequence-universal-deployer-2"
|
|
142
|
+
arguments:
|
|
143
|
+
creationCode: "{{Contract(MyFactory).creationCode}}"
|
|
144
|
+
salt: "0"
|
|
145
|
+
|
|
146
|
+
- name: "deploy-implementation"
|
|
147
|
+
template: "sequence-universal-deployer-2"
|
|
148
|
+
depends_on: ["deploy-factory"]
|
|
149
|
+
arguments:
|
|
150
|
+
creationCode:
|
|
151
|
+
type: "constructor-encode"
|
|
152
|
+
arguments:
|
|
153
|
+
creationCode: "{{Contract(MyImplementation).creationCode}}"
|
|
154
|
+
types: ["address"]
|
|
155
|
+
values: ["{{deploy-factory.address}}"]
|
|
156
|
+
salt: "0"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### Per-job network filters
|
|
160
|
+
|
|
161
|
+
Jobs run on all selected networks by default. You can restrict or exclude networks for a specific job by chain ID:
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
name: "token-deployment"
|
|
165
|
+
version: "1.0.0"
|
|
166
|
+
|
|
167
|
+
# Run only on these networks (takes precedence if present)
|
|
168
|
+
only_networks: [1, 42161]
|
|
169
|
+
|
|
170
|
+
# Or, skip these networks (used only if only_networks is not set)
|
|
171
|
+
# skip_networks: [137]
|
|
172
|
+
|
|
173
|
+
actions:
|
|
174
|
+
- name: "deploy"
|
|
175
|
+
template: "erc-2470"
|
|
176
|
+
arguments: { /* ... */ }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Rules:
|
|
180
|
+
- If `only_networks` is set and non-empty, the job runs only on those chain IDs.
|
|
181
|
+
- Else, if `skip_networks` is set and non-empty, the job is skipped on those chain IDs.
|
|
182
|
+
- Otherwise, the job runs on all networks selected for the run (via `networks.yaml` or `--network`).
|
|
183
|
+
|
|
184
|
+
#### Deprecating jobs
|
|
185
|
+
|
|
186
|
+
Mark a job as deprecated to opt it out of normal runs without deleting it:
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
name: "legacy-seed"
|
|
190
|
+
version: "1.2.3"
|
|
191
|
+
deprecated: true
|
|
192
|
+
actions:
|
|
193
|
+
- name: "noop"
|
|
194
|
+
type: "static"
|
|
195
|
+
arguments: { value: null }
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Behavior:
|
|
199
|
+
- Deprecated jobs are skipped by default when running without specifying job names.
|
|
200
|
+
- Explicitly targeting a deprecated job on the CLI will run it even without extra flags: `catapult run legacy-seed -k $PRIVATE_KEY`.
|
|
201
|
+
- To include all deprecated jobs in a normal run, pass `--run-deprecated`: `catapult run --run-deprecated -k $PRIVATE_KEY`.
|
|
202
|
+
- If a non-deprecated job depends on a deprecated job, that deprecated dependency is ALWAYS included automatically to satisfy dependencies (even without `--run-deprecated`).
|
|
203
|
+
|
|
204
|
+
### Template Definitions
|
|
205
|
+
|
|
206
|
+
Templates are reusable deployment patterns. Create them in the `templates/` directory:
|
|
207
|
+
|
|
208
|
+
```yaml
|
|
209
|
+
# templates/proxy-factory.yaml
|
|
210
|
+
name: "proxy-factory"
|
|
211
|
+
type: "template"
|
|
212
|
+
|
|
213
|
+
arguments:
|
|
214
|
+
implementation:
|
|
215
|
+
type: "address"
|
|
216
|
+
salt:
|
|
217
|
+
type: "bytes32"
|
|
218
|
+
|
|
219
|
+
returns:
|
|
220
|
+
address:
|
|
221
|
+
type: "address"
|
|
222
|
+
|
|
223
|
+
setup:
|
|
224
|
+
- type: "job-completed"
|
|
225
|
+
arguments:
|
|
226
|
+
job: "core-contracts"
|
|
227
|
+
|
|
228
|
+
actions:
|
|
229
|
+
- type: "send-transaction"
|
|
230
|
+
arguments:
|
|
231
|
+
to: "{{core-contracts.deploy-factory.address}}"
|
|
232
|
+
data:
|
|
233
|
+
type: "abi-encode"
|
|
234
|
+
arguments:
|
|
235
|
+
signature: "createProxy(address,bytes32)"
|
|
236
|
+
values:
|
|
237
|
+
- "{{implementation}}"
|
|
238
|
+
- "{{salt}}"
|
|
239
|
+
|
|
240
|
+
skip_condition:
|
|
241
|
+
- type: "contract-exists"
|
|
242
|
+
arguments:
|
|
243
|
+
address:
|
|
244
|
+
type: "compute-create2"
|
|
245
|
+
arguments:
|
|
246
|
+
deployerAddress: "{{core-contracts.deploy-factory.address}}"
|
|
247
|
+
salt: "{{salt}}"
|
|
248
|
+
initCode:
|
|
249
|
+
type: "constructor-encode"
|
|
250
|
+
arguments:
|
|
251
|
+
creationCode: "{{Contract(ProxyBytecode).creationCode}}"
|
|
252
|
+
types: ["address"]
|
|
253
|
+
values: ["{{implementation}}"]
|
|
254
|
+
|
|
255
|
+
outputs:
|
|
256
|
+
address:
|
|
257
|
+
type: "compute-create2"
|
|
258
|
+
arguments:
|
|
259
|
+
deployerAddress: "{{core-contracts.deploy-factory.address}}"
|
|
260
|
+
salt: "{{salt}}"
|
|
261
|
+
initCode:
|
|
262
|
+
type: "constructor-encode"
|
|
263
|
+
arguments:
|
|
264
|
+
creationCode: "{{Contract(ProxyBytecode).creationCode}}"
|
|
265
|
+
types: ["address"]
|
|
266
|
+
values: ["{{implementation}}"]
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Notes about template files:
|
|
270
|
+
- The `type: "template"` discriminator is optional but recommended for clarity. If provided, it must be exactly `template`.
|
|
271
|
+
- Templates are auto-discovered from your project `templates/` folder and any `templates/` subfolders under `jobs/`.
|
|
272
|
+
|
|
273
|
+
## Usage
|
|
274
|
+
|
|
275
|
+
### Running Deployments
|
|
276
|
+
|
|
277
|
+
Deploy all jobs to all configured networks:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
catapult run --private-key YOUR_PRIVATE_KEY
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Deploy specific jobs:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
catapult run core-contracts token-setup --private-key YOUR_PRIVATE_KEY
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Deploy multiple jobs using wildcards (matches job names, including nested names like `sequence_v3/beta_4`):
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
# Run all jobs whose name starts with "sequence_"
|
|
293
|
+
catapult run sequence_* -k $PRIVATE_KEY
|
|
294
|
+
|
|
295
|
+
# Run all jobs under a namespace/folder-like prefix
|
|
296
|
+
catapult run "sequence_v3/*" -k $PRIVATE_KEY
|
|
297
|
+
|
|
298
|
+
# Combine patterns and exact names; duplicates are de-duplicated
|
|
299
|
+
catapult run job1 job? -k $PRIVATE_KEY
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Deploy to specific networks:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
catapult run --network 1 42161 --private-key YOUR_PRIVATE_KEY
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Common options (run):
|
|
309
|
+
|
|
310
|
+
- `-p, --project <path>`: Project root directory (defaults to current directory)
|
|
311
|
+
- `--dotenv <path>`: Load environment variables from a custom .env file (run command only)
|
|
312
|
+
- `-n, --network <chainIds...>`: One or more chain IDs to target
|
|
313
|
+
- `--rpc-url <url>`: Run against a single custom RPC; chain ID is auto-detected (no networks.yaml required)
|
|
314
|
+
- `-k, --private-key <key>`: EOA private key (or set `PRIVATE_KEY`)
|
|
315
|
+
- `--etherscan-api-key <key>`: Etherscan API key (or set `ETHERSCAN_API_KEY`)
|
|
316
|
+
- `--fail-early`: Stop as soon as any job fails
|
|
317
|
+
- `--no-post-check-conditions`: Skip post-execution evaluation of skip conditions
|
|
318
|
+
- `--flat-output`: Write outputs in a single flat `output/` directory (do not mirror `jobs/` structure)
|
|
319
|
+
- `--no-summary`: Hide the end-of-run summary
|
|
320
|
+
- `--run-deprecated`: Allow running jobs marked `deprecated: true` (otherwise skipped unless explicitly targeted)
|
|
321
|
+
- `--no-std`: Do not load built-in standard templates
|
|
322
|
+
- `-v, --verbose` (repeatable): Increase logging verbosity (`-v`, `-vv`, `-vvv`)
|
|
323
|
+
|
|
324
|
+
Examples:
|
|
325
|
+
|
|
326
|
+
- Using a custom RPC (no networks.yaml needed):
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
catapult run --rpc-url http://127.0.0.1:8545 -k $PRIVATE_KEY
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
- Write outputs flat instead of mirroring `jobs/` folders:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
catapult run --flat-output -k $PRIVATE_KEY
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
- Run a deprecated job explicitly:
|
|
339
|
+
- Without flag (explicit targeting runs it):
|
|
340
|
+
```bash
|
|
341
|
+
catapult run legacy-job -k $PRIVATE_KEY
|
|
342
|
+
```
|
|
343
|
+
- Or include all deprecated jobs in the plan:
|
|
344
|
+
```bash
|
|
345
|
+
catapult run --run-deprecated -k $PRIVATE_KEY
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Validation and Dry Run
|
|
349
|
+
|
|
350
|
+
Validate your configuration without executing transactions:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
catapult dry-run
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Validate specific jobs:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
catapult dry-run core-contracts --network 1
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Listing Resources
|
|
363
|
+
|
|
364
|
+
List available jobs:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
catapult list jobs
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
List detected contracts:
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
catapult list contracts
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
List available templates:
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
catapult list templates
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
List configured networks:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
catapult list networks
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
List only test networks:
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
catapult list networks --only-testnets
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
List only non-test networks:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
catapult list networks --only-non-testnets
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
List constants (top-level and per-job):
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
catapult list constants
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Simple outputs for scripting:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
# Names only, one per line
|
|
410
|
+
catapult list networks --simple
|
|
411
|
+
|
|
412
|
+
# Chain IDs only, one per line
|
|
413
|
+
catapult list networks --simple-chain-ids
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Utilities:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# Convert chain ID to network name
|
|
420
|
+
catapult utils chain-id-to-name 42161 -p ./my-project
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Etherscan helpers:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Fetch ABI from Etherscan v2
|
|
427
|
+
catapult etherscan abi -n 1 -a 0xdAC17F958D2ee523a2206206994597C13D831ec7 --etherscan-api-key $ETHERSCAN_API_KEY
|
|
428
|
+
|
|
429
|
+
# Fetch source (standard-json or flattened) from Etherscan v2
|
|
430
|
+
catapult etherscan source -n 1 -a 0xdAC17F958D2ee523a2206206994597C13D831ec7 --etherscan-api-key $ETHERSCAN_API_KEY
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Built-in Actions
|
|
434
|
+
|
|
435
|
+
Catapult provides several built-in primitive actions:
|
|
436
|
+
|
|
437
|
+
### `send-transaction`
|
|
438
|
+
Send a transaction to the blockchain:
|
|
439
|
+
|
|
440
|
+
```yaml
|
|
441
|
+
- type: "send-transaction"
|
|
442
|
+
arguments:
|
|
443
|
+
to: "0x742..."
|
|
444
|
+
value: "1000000000000000000" # 1 ETH in wei
|
|
445
|
+
data: "0x..."
|
|
446
|
+
gasMultiplier: 1.5 # Optional: multiply gas limit by this factor
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
The `gasMultiplier` parameter is optional and allows you to tune the gas limit before sending the transaction:
|
|
450
|
+
- If a network gas limit is configured, it will be multiplied by this factor
|
|
451
|
+
- If no network gas limit is set, gas will be estimated first, then multiplied by this factor
|
|
452
|
+
- Must be a positive number (e.g., 1.5 for 50% more gas, 0.8 for 20% less gas)
|
|
453
|
+
|
|
454
|
+
### `send-signed-transaction`
|
|
455
|
+
Broadcast a pre-signed transaction:
|
|
456
|
+
|
|
457
|
+
```yaml
|
|
458
|
+
- type: "send-signed-transaction"
|
|
459
|
+
arguments:
|
|
460
|
+
transaction: "0x..." # Raw signed transaction
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### `static`
|
|
464
|
+
Sets a static value that can be referenced in subsequent steps. Useful for defining constants or passing data between actions.
|
|
465
|
+
|
|
466
|
+
```yaml
|
|
467
|
+
- type: "static"
|
|
468
|
+
name: "my-value"
|
|
469
|
+
arguments:
|
|
470
|
+
value: "hello world"
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
The `name` field is optional. When provided, the value is stored under [`name.value`](src/lib/core/engine.ts:560) in the context. If omitted, the value is computed but not stored. Supports all JSON data types including strings, numbers, booleans, objects, and arrays.
|
|
474
|
+
|
|
475
|
+
Example with complex data:
|
|
476
|
+
|
|
477
|
+
```yaml
|
|
478
|
+
- type: "static"
|
|
479
|
+
name: "config"
|
|
480
|
+
arguments:
|
|
481
|
+
value:
|
|
482
|
+
endpoint: "https://api.example.com"
|
|
483
|
+
timeout: 5000
|
|
484
|
+
enabled: true
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
This makes `config.value.endpoint`, `config.value.timeout`, and `config.value.enabled` available for use in subsequent actions.
|
|
488
|
+
|
|
489
|
+
### `create-contract`
|
|
490
|
+
Create a contract by sending its creation bytecode (and optional value):
|
|
491
|
+
|
|
492
|
+
```yaml
|
|
493
|
+
- type: "create-contract"
|
|
494
|
+
name: "deploy-foo"
|
|
495
|
+
arguments:
|
|
496
|
+
data: "{{Contract(Foo).creationCode}}"
|
|
497
|
+
gasMultiplier: 1.2
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### `json-request`
|
|
501
|
+
Make an HTTP JSON request and use the result downstream:
|
|
502
|
+
|
|
503
|
+
```yaml
|
|
504
|
+
- type: "json-request"
|
|
505
|
+
name: "get-config"
|
|
506
|
+
arguments:
|
|
507
|
+
url: "https://example.com/config.json"
|
|
508
|
+
method: "GET"
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## Value Resolvers
|
|
512
|
+
|
|
513
|
+
Catapult includes powerful value resolvers for computing complex values:
|
|
514
|
+
|
|
515
|
+
### `abi-encode`
|
|
516
|
+
ABI-encode function call data:
|
|
517
|
+
|
|
518
|
+
```yaml
|
|
519
|
+
data:
|
|
520
|
+
type: "abi-encode"
|
|
521
|
+
arguments:
|
|
522
|
+
signature: "transfer(address,uint256)"
|
|
523
|
+
values:
|
|
524
|
+
- "0x742..."
|
|
525
|
+
- "1000000000000000000"
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### `constructor-encode`
|
|
529
|
+
Encode constructor parameters with bytecode:
|
|
530
|
+
|
|
531
|
+
```yaml
|
|
532
|
+
creationCode:
|
|
533
|
+
type: "constructor-encode"
|
|
534
|
+
arguments:
|
|
535
|
+
creationCode: "{{Contract(MyContract).creationCode}}"
|
|
536
|
+
types: ["address", "uint256"]
|
|
537
|
+
values: ["{{factory.address}}", "100"]
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
### `abi-pack`
|
|
541
|
+
Pack values per ABI types into bytes:
|
|
542
|
+
|
|
543
|
+
```yaml
|
|
544
|
+
payload:
|
|
545
|
+
type: "abi-pack"
|
|
546
|
+
arguments:
|
|
547
|
+
types: ["address", "uint256"]
|
|
548
|
+
values: ["{{recipient}}", "{{amount}}"]
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### `compute-create2`
|
|
552
|
+
Compute CREATE2 addresses:
|
|
553
|
+
|
|
554
|
+
```yaml
|
|
555
|
+
address:
|
|
556
|
+
type: "compute-create2"
|
|
557
|
+
arguments:
|
|
558
|
+
deployerAddress: "{{factory.address}}"
|
|
559
|
+
salt: "{{salt}}"
|
|
560
|
+
initCode: "{{creationCode}}"
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
### `basic-arithmetic`
|
|
564
|
+
Perform mathematical operations:
|
|
565
|
+
|
|
566
|
+
```yaml
|
|
567
|
+
amount:
|
|
568
|
+
type: "basic-arithmetic"
|
|
569
|
+
arguments:
|
|
570
|
+
operation: "add"
|
|
571
|
+
values: ["{{current_balance}}", "1000000000000000000"]
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
### `read-balance`
|
|
575
|
+
Read account balance:
|
|
576
|
+
|
|
577
|
+
```yaml
|
|
578
|
+
balance:
|
|
579
|
+
type: "read-balance"
|
|
580
|
+
arguments:
|
|
581
|
+
address: "{{deployer_address}}"
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
### `call`
|
|
585
|
+
Make view/pure function calls:
|
|
586
|
+
|
|
587
|
+
```yaml
|
|
588
|
+
result:
|
|
589
|
+
type: "call"
|
|
590
|
+
arguments:
|
|
591
|
+
to: "{{contract.address}}"
|
|
592
|
+
signature: "getName()"
|
|
593
|
+
values: []
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### `verify-contract`
|
|
597
|
+
### `read-json`
|
|
598
|
+
Read a value from a JSON object at a given path:
|
|
599
|
+
|
|
600
|
+
```yaml
|
|
601
|
+
tokenAddress:
|
|
602
|
+
type: "read-json"
|
|
603
|
+
arguments:
|
|
604
|
+
json: "{{get-config.response}}"
|
|
605
|
+
path: "tokens.usdc.address"
|
|
606
|
+
```
|
|
607
|
+
Verify deployed contracts on block explorers:
|
|
608
|
+
|
|
609
|
+
```yaml
|
|
610
|
+
- type: "verify-contract"
|
|
611
|
+
arguments:
|
|
612
|
+
address: "{{deploy-factory.address}}"
|
|
613
|
+
contract: "{{Contract(MyContract)}}" # Reference to the contract to verify
|
|
614
|
+
constructorArguments: "0x000000000000000000000000..." # Optional hex-encoded args
|
|
615
|
+
platform: "etherscan_v2" # Optional, defaults to "all" (tries all configured platforms)
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
## Skip Conditions
|
|
619
|
+
|
|
620
|
+
Avoid redundant operations with skip conditions:
|
|
621
|
+
|
|
622
|
+
### `contract-exists`
|
|
623
|
+
Skip if contract exists at address:
|
|
624
|
+
|
|
625
|
+
```yaml
|
|
626
|
+
skip_condition:
|
|
627
|
+
- type: "contract-exists"
|
|
628
|
+
arguments:
|
|
629
|
+
address: "{{computed_address}}"
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
### `job-completed`
|
|
633
|
+
Skip if another job is completed:
|
|
634
|
+
|
|
635
|
+
```yaml
|
|
636
|
+
skip_condition:
|
|
637
|
+
- type: "job-completed"
|
|
638
|
+
arguments:
|
|
639
|
+
job: "prerequisite-job"
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
## Standard Templates
|
|
643
|
+
|
|
644
|
+
Catapult includes several standard templates:
|
|
645
|
+
|
|
646
|
+
- **`sequence-universal-deployer-2`**: Deploy contracts using Sequence's Universal Deployer v2
|
|
647
|
+
- **`nano-universal-deployer`**: Deploy contracts using the Nano Universal Deployer
|
|
648
|
+
- **`erc-2470`** and raw variant: CREATE2 Deployer (singleton factory)
|
|
649
|
+
- **`assured-deployment`**: Helper to ensure a contract is deployed at a specific address
|
|
650
|
+
- **`min-balance`**: Ensure minimum balance for any given address
|
|
651
|
+
- Raw building blocks: `raw-sequence-universal-deployer-2`, `raw-nano-universal-deployer`, `raw-erc-2470`
|
|
652
|
+
|
|
653
|
+
## Contract Resolution
|
|
654
|
+
|
|
655
|
+
Catapult automatically discovers and indexes contract artifacts in your project. It supports:
|
|
656
|
+
|
|
657
|
+
- **JSON artifacts** (Hardhat, Truffle, Foundry)
|
|
658
|
+
- **Nested directory structures**
|
|
659
|
+
- **Hash-based contract references**
|
|
660
|
+
- **Path-based contract references**
|
|
661
|
+
- **Name-based contract references**
|
|
662
|
+
|
|
663
|
+
Reference contracts in your YAML using the new unified Contract() syntax:
|
|
664
|
+
|
|
665
|
+
```yaml
|
|
666
|
+
creationCode: "{{Contract(path/to/MyContract).creationCode}}"
|
|
667
|
+
# or
|
|
668
|
+
creationCode: "{{Contract(0x1234...hash).creationCode}}"
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
## Output Format
|
|
672
|
+
|
|
673
|
+
After successful deployment, Catapult generates JSON files in the `output/` directory for each job. The output format is optimized to reduce repetition:
|
|
674
|
+
|
|
675
|
+
### Success Grouping
|
|
676
|
+
|
|
677
|
+
Networks with identical deployment outputs are grouped together:
|
|
678
|
+
|
|
679
|
+
```json
|
|
680
|
+
{
|
|
681
|
+
"jobName": "core-contracts",
|
|
682
|
+
"jobVersion": "1.0.0",
|
|
683
|
+
"lastRun": "2025-01-15T10:30:45.123Z",
|
|
684
|
+
"networks": [
|
|
685
|
+
{
|
|
686
|
+
"status": "success",
|
|
687
|
+
"chainIds": ["1", "42161", "137"],
|
|
688
|
+
"outputs": {
|
|
689
|
+
"deploy-factory.address": "0x742d35Cc6ab8b3c7B3d4B8b3aB4c8f9e9C8e8aB6",
|
|
690
|
+
"deploy-factory.txHash": "0xabc123...",
|
|
691
|
+
"deploy-implementation.address": "0x123abc..."
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
}
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
### Error Handling
|
|
699
|
+
|
|
700
|
+
When deployments fail on specific networks, each failure is recorded separately:
|
|
701
|
+
|
|
702
|
+
```json
|
|
703
|
+
{
|
|
704
|
+
"jobName": "core-contracts",
|
|
705
|
+
"jobVersion": "1.0.0",
|
|
706
|
+
"lastRun": "2025-01-15T10:30:45.123Z",
|
|
707
|
+
"networks": [
|
|
708
|
+
{
|
|
709
|
+
"status": "success",
|
|
710
|
+
"chainIds": ["1", "42161"],
|
|
711
|
+
"outputs": {
|
|
712
|
+
"deploy-factory.address": "0x742d35Cc6ab8b3c7B3d4B8b3aB4c8f9e9C8e8aB6"
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"status": "error",
|
|
717
|
+
"chainId": "137",
|
|
718
|
+
"error": "Transaction failed: insufficient funds"
|
|
719
|
+
}
|
|
720
|
+
]
|
|
721
|
+
}
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
This format ensures:
|
|
725
|
+
- **Minimal repetition**: Successful deployments with identical outputs across multiple networks are grouped together
|
|
726
|
+
- **Clear error tracking**: Individual network failures are clearly documented
|
|
727
|
+
- **Scalability**: The format remains readable even with deployments across dozens of networks
|
|
728
|
+
|
|
729
|
+
Output layout and selection:
|
|
730
|
+
|
|
731
|
+
- By default, output files mirror the structure under `jobs/` (e.g., `jobs/core/job.yaml` -> `output/core/job.json`). Use `--flat-output` to write all job JSON files directly under `output/`.
|
|
732
|
+
- You can control which action outputs are persisted per job using the `output` flag on actions:
|
|
733
|
+
- `output: true` to include all outputs for that action
|
|
734
|
+
- `output: false` to exclude outputs for that action
|
|
735
|
+
- `output: { key1: true, key2: true }` to include only specific keys from that action (e.g., `txHash`, `address`)
|
|
736
|
+
|
|
737
|
+
## Environment Variables
|
|
738
|
+
|
|
739
|
+
- `PRIVATE_KEY`: Signer private key (alternative to `--private-key`)
|
|
740
|
+
- `ETHERSCAN_API_KEY`: API key for Etherscan v2 verification (alternative to `--etherscan-api-key`)
|
|
741
|
+
|
|
742
|
+
You can load environment variables from a file using `--dotenv <path>` on the `run` command (defaults to `.env` in the current directory when provided).
|
|
743
|
+
|
|
744
|
+
## Development
|
|
745
|
+
|
|
746
|
+
### Prerequisites
|
|
747
|
+
- Node.js >= 16.0.0
|
|
748
|
+
- npm or yarn
|
|
749
|
+
|
|
750
|
+
### Setup
|
|
751
|
+
```bash
|
|
752
|
+
# Install dependencies
|
|
753
|
+
npm install
|
|
754
|
+
|
|
755
|
+
# Build the project
|
|
756
|
+
npm run build
|
|
757
|
+
|
|
758
|
+
# Run in development mode
|
|
759
|
+
npm run dev
|
|
760
|
+
|
|
761
|
+
# Watch for changes
|
|
762
|
+
npm run watch
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
### Scripts
|
|
766
|
+
- `npm run build` - Compile TypeScript to JavaScript
|
|
767
|
+
- `npm run dev` - Run the CLI in development mode with ts-node
|
|
768
|
+
- `npm run watch`
|
|
769
|
+
|
|
770
|
+
---
|
|
771
|
+
|
|
772
|
+
_Co-authored with Sonet-4, GLM-4.5-Air, and GPT-5. This project was vibe-coded._
|