@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
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { ReadJsonValue } from '../values'
|
|
2
|
+
|
|
3
|
+
describe('ReadJsonValue', () => {
|
|
4
|
+
describe('type definition', () => {
|
|
5
|
+
it('should have correct type structure for basic path', () => {
|
|
6
|
+
const value: ReadJsonValue = {
|
|
7
|
+
type: 'read-json',
|
|
8
|
+
arguments: {
|
|
9
|
+
json: { name: 'John', age: 30 },
|
|
10
|
+
path: 'name'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
expect(value.type).toBe('read-json')
|
|
15
|
+
expect(value.arguments.json).toEqual({ name: 'John', age: 30 })
|
|
16
|
+
expect(value.arguments.path).toBe('name')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('should support nested path access', () => {
|
|
20
|
+
const value: ReadJsonValue = {
|
|
21
|
+
type: 'read-json',
|
|
22
|
+
arguments: {
|
|
23
|
+
json: {
|
|
24
|
+
txs: {
|
|
25
|
+
to: '0x596aF90CecdBF9A768886E771178fd5561dD27Ab',
|
|
26
|
+
data: '0x1234'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
path: 'txs.data'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
expect(value.arguments.path).toBe('txs.data')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should support deeply nested path access', () => {
|
|
37
|
+
const value: ReadJsonValue = {
|
|
38
|
+
type: 'read-json',
|
|
39
|
+
arguments: {
|
|
40
|
+
json: {
|
|
41
|
+
user: {
|
|
42
|
+
profile: {
|
|
43
|
+
personal: {
|
|
44
|
+
name: 'Alice'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
path: 'user.profile.personal.name'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
expect(value.arguments.path).toBe('user.profile.personal.name')
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('should support array index access', () => {
|
|
57
|
+
const value: ReadJsonValue = {
|
|
58
|
+
type: 'read-json',
|
|
59
|
+
arguments: {
|
|
60
|
+
json: {
|
|
61
|
+
transactions: [
|
|
62
|
+
{ hash: '0xabc123' },
|
|
63
|
+
{ hash: '0xdef456' }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
path: 'transactions.0.hash'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
expect(value.arguments.path).toBe('transactions.0.hash')
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('should support template variables in json', () => {
|
|
74
|
+
const value: ReadJsonValue = {
|
|
75
|
+
type: 'read-json',
|
|
76
|
+
arguments: {
|
|
77
|
+
json: '{{apiResponse}}',
|
|
78
|
+
path: 'result.data'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
expect(value.arguments.json).toBe('{{apiResponse}}')
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('should support template variables in path', () => {
|
|
86
|
+
const value: ReadJsonValue = {
|
|
87
|
+
type: 'read-json',
|
|
88
|
+
arguments: {
|
|
89
|
+
json: { data: { field1: 'value1', field2: 'value2' } },
|
|
90
|
+
path: '{{fieldPath}}'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
expect(value.arguments.path).toBe('{{fieldPath}}')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('should support both json and path as template variables', () => {
|
|
98
|
+
const value: ReadJsonValue = {
|
|
99
|
+
type: 'read-json',
|
|
100
|
+
arguments: {
|
|
101
|
+
json: '{{responseData}}',
|
|
102
|
+
path: '{{extractionPath}}'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
expect(value.arguments.json).toBe('{{responseData}}')
|
|
107
|
+
expect(value.arguments.path).toBe('{{extractionPath}}')
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('should work with complex JSON structures', () => {
|
|
111
|
+
const complexJson = {
|
|
112
|
+
blockchain: {
|
|
113
|
+
ethereum: {
|
|
114
|
+
mainnet: {
|
|
115
|
+
contracts: {
|
|
116
|
+
erc20: [
|
|
117
|
+
{
|
|
118
|
+
address: '0xA0b86a33E6441e6e80D0c4C6C7527d72e1d7e4e1',
|
|
119
|
+
symbol: 'USDC',
|
|
120
|
+
decimals: 6
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
address: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
|
|
124
|
+
symbol: 'DAI',
|
|
125
|
+
decimals: 18
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const value: ReadJsonValue = {
|
|
135
|
+
type: 'read-json',
|
|
136
|
+
arguments: {
|
|
137
|
+
json: complexJson,
|
|
138
|
+
path: 'blockchain.ethereum.mainnet.contracts.erc20.1.symbol'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
expect(value.arguments.json).toEqual(complexJson)
|
|
143
|
+
expect(value.arguments.path).toBe('blockchain.ethereum.mainnet.contracts.erc20.1.symbol')
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
it('should work with the example from the task description', () => {
|
|
147
|
+
const exampleJson = {
|
|
148
|
+
txs: {
|
|
149
|
+
to: '0x596aF90CecdBF9A768886E771178fd5561dD27Ab',
|
|
150
|
+
data: '0x1234'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const value: ReadJsonValue = {
|
|
155
|
+
type: 'read-json',
|
|
156
|
+
arguments: {
|
|
157
|
+
json: exampleJson,
|
|
158
|
+
path: 'txs.data'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
expect(value.arguments.json).toEqual(exampleJson)
|
|
163
|
+
expect(value.arguments.path).toBe('txs.data')
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it('should support root level access', () => {
|
|
167
|
+
const value: ReadJsonValue = {
|
|
168
|
+
type: 'read-json',
|
|
169
|
+
arguments: {
|
|
170
|
+
json: 'simple string value',
|
|
171
|
+
path: ''
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
expect(value.arguments.json).toBe('simple string value')
|
|
176
|
+
expect(value.arguments.path).toBe('')
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
it('should support accessing array elements directly', () => {
|
|
180
|
+
const value: ReadJsonValue = {
|
|
181
|
+
type: 'read-json',
|
|
182
|
+
arguments: {
|
|
183
|
+
json: ['first', 'second', 'third'],
|
|
184
|
+
path: '1'
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
expect(value.arguments.json).toEqual(['first', 'second', 'third'])
|
|
189
|
+
expect(value.arguments.path).toBe('1')
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it('should support mixed object and array access', () => {
|
|
193
|
+
const value: ReadJsonValue = {
|
|
194
|
+
type: 'read-json',
|
|
195
|
+
arguments: {
|
|
196
|
+
json: {
|
|
197
|
+
results: [
|
|
198
|
+
{ id: 1, data: { value: 'first' } },
|
|
199
|
+
{ id: 2, data: { value: 'second' } }
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
path: 'results.0.data.value'
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
expect(value.arguments.path).toBe('results.0.data.value')
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it('should support boolean and number values in JSON', () => {
|
|
210
|
+
const value: ReadJsonValue = {
|
|
211
|
+
type: 'read-json',
|
|
212
|
+
arguments: {
|
|
213
|
+
json: {
|
|
214
|
+
config: {
|
|
215
|
+
enabled: true,
|
|
216
|
+
maxRetries: 5,
|
|
217
|
+
timeout: 30.5
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
path: 'config.enabled'
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
expect(value.arguments.json).toEqual({
|
|
225
|
+
config: {
|
|
226
|
+
enabled: true,
|
|
227
|
+
maxRetries: 5,
|
|
228
|
+
timeout: 30.5
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
it('should support null values in JSON', () => {
|
|
234
|
+
const value: ReadJsonValue = {
|
|
235
|
+
type: 'read-json',
|
|
236
|
+
arguments: {
|
|
237
|
+
json: {
|
|
238
|
+
user: {
|
|
239
|
+
name: 'John',
|
|
240
|
+
avatar: null
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
path: 'user.avatar'
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
expect(value.arguments.json.user.avatar).toBeNull()
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
it('should work with response from json-request action', () => {
|
|
251
|
+
// This simulates using the result of a json-request action
|
|
252
|
+
const value: ReadJsonValue = {
|
|
253
|
+
type: 'read-json',
|
|
254
|
+
arguments: {
|
|
255
|
+
json: '{{apiCall.response}}', // Reference to a json-request action output
|
|
256
|
+
path: 'data.transactions.0.hash'
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
expect(value.arguments.json).toBe('{{apiCall.response}}')
|
|
261
|
+
expect(value.arguments.path).toBe('data.transactions.0.hash')
|
|
262
|
+
})
|
|
263
|
+
})
|
|
264
|
+
})
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AddressValue, BytesValue, Uint256Value, Value } from './values'
|
|
2
|
+
import { Contract } from './contracts'
|
|
3
|
+
import { Condition } from './conditions'
|
|
4
|
+
|
|
5
|
+
// --- Primitive Actions ---
|
|
6
|
+
// These are the basic building blocks that interact with the blockchain.
|
|
7
|
+
|
|
8
|
+
export interface SendTransactionAction {
|
|
9
|
+
type: 'send-transaction';
|
|
10
|
+
arguments: {
|
|
11
|
+
to: AddressValue;
|
|
12
|
+
value?: Uint256Value;
|
|
13
|
+
data?: BytesValue;
|
|
14
|
+
gasMultiplier?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SendSignedTransactionAction {
|
|
19
|
+
type: 'send-signed-transaction';
|
|
20
|
+
arguments: {
|
|
21
|
+
transaction: BytesValue;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface VerifyContractAction {
|
|
26
|
+
type: 'verify-contract';
|
|
27
|
+
arguments: {
|
|
28
|
+
address: AddressValue;
|
|
29
|
+
contract: Value<Contract>; // The contract to verify
|
|
30
|
+
constructorArguments?: BytesValue; // Optional constructor args as hex string
|
|
31
|
+
platform?: Value<string | string[]>; // Platform(s) to verify on, defaults to "all" (tries all configured platforms)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface StaticAction {
|
|
36
|
+
type: 'static';
|
|
37
|
+
arguments: {
|
|
38
|
+
value: Value<any>;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface CreateContractAction {
|
|
43
|
+
type: 'create-contract';
|
|
44
|
+
arguments: {
|
|
45
|
+
data: BytesValue; // The contract bytecode (creation code)
|
|
46
|
+
value?: Uint256Value; // ETH to send with the contract creation
|
|
47
|
+
gasMultiplier?: number; // Optional gas multiplier
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TestNicksMethodAction {
|
|
52
|
+
type: 'test-nicks-method';
|
|
53
|
+
arguments: {
|
|
54
|
+
bytecode?: BytesValue;
|
|
55
|
+
gasPrice?: Uint256Value;
|
|
56
|
+
gasLimit?: Uint256Value;
|
|
57
|
+
fundingAmount?: Uint256Value;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface JsonRequestAction {
|
|
62
|
+
type: 'json-request';
|
|
63
|
+
arguments: {
|
|
64
|
+
url: Value<string>;
|
|
65
|
+
method?: Value<string>; // GET, POST, PUT, DELETE, etc. Defaults to GET
|
|
66
|
+
headers?: Value<Record<string, string>>; // Optional headers
|
|
67
|
+
body?: Value<any>; // JSON body for POST/PUT requests
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// A union of all primitive action types.
|
|
72
|
+
export type PrimitiveAction = SendTransactionAction | SendSignedTransactionAction | VerifyContractAction | StaticAction | CreateContractAction | TestNicksMethodAction | JsonRequestAction;
|
|
73
|
+
|
|
74
|
+
const primitiveActionTypes = [
|
|
75
|
+
'send-transaction',
|
|
76
|
+
'send-signed-transaction',
|
|
77
|
+
'verify-contract',
|
|
78
|
+
'static',
|
|
79
|
+
'create-contract',
|
|
80
|
+
'test-nicks-method',
|
|
81
|
+
'json-request',
|
|
82
|
+
] as const;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A set of all built-in primitive action types.
|
|
86
|
+
* This is useful for efficiently checking if an action type is a primitive.
|
|
87
|
+
*/
|
|
88
|
+
export const PRIMITIVE_ACTION_TYPES = new Set<string>(primitiveActionTypes);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A type guard to check if a given action `type` corresponds to a primitive action.
|
|
92
|
+
* @param type The action type string.
|
|
93
|
+
* @returns `true` if the type is a primitive action type.
|
|
94
|
+
*/
|
|
95
|
+
export function isPrimitiveActionType(type: string): type is (typeof primitiveActionTypes)[number] {
|
|
96
|
+
return PRIMITIVE_ACTION_TYPES.has(type);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// --- Template Call Action ---
|
|
100
|
+
// In your YAML, using another template as an action is done by specifying its name
|
|
101
|
+
// in the 'type' field (e.g., `type: 'min-balance'`). This type captures that pattern.
|
|
102
|
+
|
|
103
|
+
export interface TemplateCallAction {
|
|
104
|
+
/**
|
|
105
|
+
* The name of the template to call, e.g., 'min-balance'.
|
|
106
|
+
* This property acts as a discriminator.
|
|
107
|
+
*/
|
|
108
|
+
type: string;
|
|
109
|
+
arguments: Record<string, Value<any>>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* An Action is what appears in a `actions` array in your YAML.
|
|
114
|
+
* It's either a primitive action or a call to another template.
|
|
115
|
+
*
|
|
116
|
+
* The `type` field is used to discriminate. Your parser will need to have a list
|
|
117
|
+
* of known primitive action types (`send-transaction`, etc.) to distinguish them
|
|
118
|
+
* from template names.
|
|
119
|
+
*/
|
|
120
|
+
export type Action = (PrimitiveAction | TemplateCallAction) & {
|
|
121
|
+
/** An optional name for the action, allowing its outputs to be referenced. */
|
|
122
|
+
name?: string;
|
|
123
|
+
/** A list of conditions that, if any are met, will cause this action to be skipped. */
|
|
124
|
+
skip_condition?: Condition[];
|
|
125
|
+
/** A list of action names within the same job/template that must complete first. */
|
|
126
|
+
depends_on?: string[];
|
|
127
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface CompilerInfo {
|
|
2
|
+
version: string
|
|
3
|
+
// Future settings like optimizer runs can be added here
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface Artifact {
|
|
7
|
+
// --- Core Information ---
|
|
8
|
+
contractName: string
|
|
9
|
+
abi: any[]
|
|
10
|
+
bytecode: string // aka creationCode, initCode
|
|
11
|
+
|
|
12
|
+
// --- Optional Information for Verification & Debugging ---
|
|
13
|
+
deployedBytecode?: string // aka runtimeBytecode
|
|
14
|
+
sourceName?: string // e.g., "contracts/MyContract.sol"
|
|
15
|
+
source?: string // The full source code content for verification
|
|
16
|
+
compiler?: CompilerInfo
|
|
17
|
+
|
|
18
|
+
// --- Internal Management Properties (added by the loader) ---
|
|
19
|
+
_path: string // The absolute path to the artifact file
|
|
20
|
+
_hash: string // A hash of the artifact file's content (e.g., MD5)
|
|
21
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export interface BuildInfoSource {
|
|
2
|
+
content?: string
|
|
3
|
+
urls?: string[]
|
|
4
|
+
keccak256?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface BuildInfoInput {
|
|
8
|
+
language: string
|
|
9
|
+
sources: Record<string, BuildInfoSource>
|
|
10
|
+
settings: {
|
|
11
|
+
optimizer?: {
|
|
12
|
+
enabled: boolean
|
|
13
|
+
runs: number
|
|
14
|
+
}
|
|
15
|
+
evmVersion?: string
|
|
16
|
+
remappings?: string[]
|
|
17
|
+
viaIR?: boolean
|
|
18
|
+
libraries?: Record<string, Record<string, string>>
|
|
19
|
+
outputSelection: Record<string, Record<string, string[]>>
|
|
20
|
+
[key: string]: any
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BuildInfoError {
|
|
25
|
+
component?: string
|
|
26
|
+
errorCode?: string
|
|
27
|
+
formattedMessage?: string
|
|
28
|
+
message?: string
|
|
29
|
+
severity?: 'error' | 'warning' | 'info'
|
|
30
|
+
sourceLocation?: {
|
|
31
|
+
file: string
|
|
32
|
+
start: number
|
|
33
|
+
end: number
|
|
34
|
+
}
|
|
35
|
+
type?: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BuildInfoBytecode {
|
|
39
|
+
functionDebugData?: Record<string, any>
|
|
40
|
+
generatedSources?: any[]
|
|
41
|
+
linkReferences?: Record<string, Record<string, Array<{ length: number; start: number }>>>
|
|
42
|
+
object: string
|
|
43
|
+
opcodes?: string
|
|
44
|
+
sourceMap?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface BuildInfoContract {
|
|
48
|
+
abi: any[]
|
|
49
|
+
metadata?: string
|
|
50
|
+
storageLayout?: {
|
|
51
|
+
storage: Array<{
|
|
52
|
+
astId: number
|
|
53
|
+
contract: string
|
|
54
|
+
label: string
|
|
55
|
+
offset: number
|
|
56
|
+
slot: string
|
|
57
|
+
type: string
|
|
58
|
+
}>
|
|
59
|
+
types: Record<string, {
|
|
60
|
+
encoding: string
|
|
61
|
+
label: string
|
|
62
|
+
numberOfBytes: string
|
|
63
|
+
[key: string]: any
|
|
64
|
+
}>
|
|
65
|
+
}
|
|
66
|
+
userdoc?: any
|
|
67
|
+
devdoc?: any
|
|
68
|
+
ir?: string
|
|
69
|
+
irOptimized?: string
|
|
70
|
+
evm: {
|
|
71
|
+
assembly?: string
|
|
72
|
+
legacyAssembly?: any
|
|
73
|
+
bytecode: BuildInfoBytecode
|
|
74
|
+
deployedBytecode: BuildInfoBytecode
|
|
75
|
+
methodIdentifiers?: Record<string, string>
|
|
76
|
+
gasEstimates?: any
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface BuildInfoOutput {
|
|
81
|
+
errors?: BuildInfoError[]
|
|
82
|
+
sources: Record<string, {
|
|
83
|
+
id: number
|
|
84
|
+
ast?: any
|
|
85
|
+
}>
|
|
86
|
+
contracts: Record<string, Record<string, BuildInfoContract>>
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface BuildInfo {
|
|
90
|
+
_format?: 'hh-sol-build-info-1' | 'ethers-rs-sol-build-info-1' // Optional for factory-style formats
|
|
91
|
+
id: string
|
|
92
|
+
solcVersion: string
|
|
93
|
+
solcLongVersion?: string // Optional for factory-style formats
|
|
94
|
+
input: BuildInfoInput
|
|
95
|
+
output: BuildInfoOutput
|
|
96
|
+
// Optional extension keys for zkSync/zkEVM
|
|
97
|
+
zksolcVersion?: string
|
|
98
|
+
eraVersion?: string
|
|
99
|
+
zkevmVersion?: string
|
|
100
|
+
[key: string]: any // Allow additional unknown keys for forward compatibility
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface ExtractedContract {
|
|
104
|
+
contractName: string
|
|
105
|
+
sourceName: string
|
|
106
|
+
fullyQualifiedName: string // e.g., "src/Counter.sol:Counter"
|
|
107
|
+
abi: any[]
|
|
108
|
+
bytecode: string
|
|
109
|
+
deployedBytecode?: string
|
|
110
|
+
source?: string
|
|
111
|
+
compiler: {
|
|
112
|
+
version: string
|
|
113
|
+
}
|
|
114
|
+
buildInfoId: string
|
|
115
|
+
buildInfoPath?: string
|
|
116
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AddressValue, BooleanValue } from './values'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A condition that checks if a contract has code at a given address.
|
|
5
|
+
*/
|
|
6
|
+
export interface ContractExistsCondition {
|
|
7
|
+
type: 'contract-exists';
|
|
8
|
+
arguments: {
|
|
9
|
+
address: AddressValue;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isContractExistsCondition(obj: any): obj is ContractExistsCondition {
|
|
14
|
+
return (
|
|
15
|
+
obj &&
|
|
16
|
+
typeof obj === 'object' &&
|
|
17
|
+
obj.type === 'contract-exists' &&
|
|
18
|
+
obj.arguments &&
|
|
19
|
+
typeof obj.arguments === 'object' &&
|
|
20
|
+
'address' in obj.arguments
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A condition that checks if a dependency job has been successfully completed.
|
|
26
|
+
*/
|
|
27
|
+
export interface JobCompletedCondition {
|
|
28
|
+
type: 'job-completed';
|
|
29
|
+
arguments: {
|
|
30
|
+
job: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function isJobCompletedCondition(obj: any): obj is JobCompletedCondition {
|
|
35
|
+
return (
|
|
36
|
+
obj &&
|
|
37
|
+
typeof obj === 'object' &&
|
|
38
|
+
obj.type === 'job-completed' &&
|
|
39
|
+
obj.arguments &&
|
|
40
|
+
typeof obj.arguments === 'object' &&
|
|
41
|
+
typeof obj.arguments.job === 'string'
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A condition is something that resolves to a boolean. It can be a specific
|
|
47
|
+
* check type like 'contract-exists', or any ValueResolver that produces a
|
|
48
|
+
* boolean result (e.g., `basic-arithmetic` with an 'eq' operation).
|
|
49
|
+
*/
|
|
50
|
+
export type Condition = BooleanValue | ContractExistsCondition | JobCompletedCondition;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CompilerInfo } from './artifacts'
|
|
2
|
+
|
|
3
|
+
export interface Contract {
|
|
4
|
+
// The ultimate, unambiguous identifier
|
|
5
|
+
uniqueHash: string
|
|
6
|
+
|
|
7
|
+
// Core Information - Only creationCode is truly required
|
|
8
|
+
creationCode: string
|
|
9
|
+
runtimeBytecode?: string
|
|
10
|
+
abi?: any[]
|
|
11
|
+
|
|
12
|
+
// Source Information
|
|
13
|
+
sourceName?: string // e.g., "contracts/MyToken.sol"
|
|
14
|
+
contractName?: string
|
|
15
|
+
source?: string // The full source code
|
|
16
|
+
|
|
17
|
+
// Compilation Information
|
|
18
|
+
compiler?: CompilerInfo
|
|
19
|
+
buildInfoId?: string // The ID from the build-info file it was found in
|
|
20
|
+
|
|
21
|
+
// Internal Management - tracks all file paths from which this contract's data was hydrated
|
|
22
|
+
_sources: Set<string>
|
|
23
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Action } from './actions'
|
|
2
|
+
import { Condition } from './conditions'
|
|
3
|
+
import { Value } from './values'
|
|
4
|
+
|
|
5
|
+
// --- Template Definition ---
|
|
6
|
+
|
|
7
|
+
export interface TemplateArgument {
|
|
8
|
+
type: string; // e.g., 'address', 'bytes32', 'uint256'
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface Template {
|
|
13
|
+
/** Optional discriminator to explicitly mark this document as a template */
|
|
14
|
+
type?: 'template';
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
arguments?: Record<string, TemplateArgument>;
|
|
18
|
+
returns?: Record<string, TemplateArgument>;
|
|
19
|
+
setup?: {
|
|
20
|
+
skip_condition?: Condition[];
|
|
21
|
+
actions?: Action[];
|
|
22
|
+
};
|
|
23
|
+
actions: Action[];
|
|
24
|
+
skip_condition?: Condition[];
|
|
25
|
+
outputs?: Record<string, Value<any>>;
|
|
26
|
+
_path?: string; // Path to the template file for relative artifact resolution
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// --- Job Definition ---
|
|
30
|
+
|
|
31
|
+
export interface JobAction {
|
|
32
|
+
name: string; // Unique name for this action within the job
|
|
33
|
+
template?: string; // Name of the template to use (for template actions)
|
|
34
|
+
type?: string; // Type of primitive action (for primitive actions)
|
|
35
|
+
arguments: Record<string, Value<any>>;
|
|
36
|
+
skip_condition?: Condition[];
|
|
37
|
+
depends_on?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Output selection/override for this action when writing job outputs.
|
|
40
|
+
* - boolean: legacy flag. true marks the whole action for inclusion, false excludes.
|
|
41
|
+
* - object: custom output map. Keys become output keys under this action's name,
|
|
42
|
+
* values are Value<any> that will be resolved at job time, overriding template outputs.
|
|
43
|
+
*/
|
|
44
|
+
output?: boolean | Record<string, Value<any>>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface Job {
|
|
48
|
+
name: string;
|
|
49
|
+
version: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
depends_on?: string[]; // Names of other jobs this job depends on
|
|
52
|
+
actions: JobAction[];
|
|
53
|
+
only_networks?: number[]
|
|
54
|
+
skip_networks?: number[]
|
|
55
|
+
skip_condition?: Condition[];
|
|
56
|
+
constants?: Record<string, Value<any>>; // Optional job-level constants
|
|
57
|
+
deprecated?: boolean; // Optional flag to mark the job as deprecated
|
|
58
|
+
_path?: string; // Path to the job file for relative artifact resolution
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- Constants Definition (top-level documents) ---
|
|
62
|
+
|
|
63
|
+
export interface ConstantsDocument {
|
|
64
|
+
type: 'constants';
|
|
65
|
+
name?: string;
|
|
66
|
+
constants: Record<string, Value<any>>;
|
|
67
|
+
_path?: string; // Source file path
|
|
68
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a blockchain network configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface Network {
|
|
5
|
+
/** The human-readable name of the network */
|
|
6
|
+
name: string
|
|
7
|
+
|
|
8
|
+
/** The chain ID of the network */
|
|
9
|
+
chainId: number
|
|
10
|
+
|
|
11
|
+
/** The RPC URL endpoint for the network */
|
|
12
|
+
rpcUrl: string
|
|
13
|
+
|
|
14
|
+
/** Supported verification platforms */
|
|
15
|
+
supports?: string[]
|
|
16
|
+
|
|
17
|
+
/** Optional gas limit to use for all transactions on this network */
|
|
18
|
+
gasLimit?: number
|
|
19
|
+
|
|
20
|
+
/** Whether this is a test network */
|
|
21
|
+
testnet?: boolean
|
|
22
|
+
}
|