gate-evm-tools 1.0.28 → 1.2.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/README.md +47 -18
- package/bin/cli.js +6 -0
- package/bin/delivery.cjs +52 -0
- package/bin/manifest-bootstrap.js +4 -15
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +26 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/plan/file-store.d.ts.map +1 -0
- package/dist/commands/plan/generate-deployment.d.ts +48 -0
- package/dist/commands/plan/generate-deployment.d.ts.map +1 -0
- package/dist/commands/plan/generate-deployment.js +211 -0
- package/dist/commands/plan/generate-deployment.js.map +1 -0
- package/dist/commands/plan/helpers.d.ts.map +1 -0
- package/dist/commands/plan/index.d.ts +3 -0
- package/dist/commands/plan/index.d.ts.map +1 -0
- package/dist/commands/plan/index.js +88 -0
- package/dist/commands/plan/index.js.map +1 -0
- package/dist/commands/sync.js +1 -1
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/BytecodeChecker.d.ts.map +1 -1
- package/dist/core/BytecodeChecker.js +27 -8
- package/dist/core/BytecodeChecker.js.map +1 -1
- package/dist/core/preparation/artifacts.d.ts +2 -0
- package/dist/core/preparation/artifacts.d.ts.map +1 -1
- package/dist/core/preparation/artifacts.js +9 -3
- package/dist/core/preparation/artifacts.js.map +1 -1
- package/dist/core/preparation/batch.d.ts +26 -0
- package/dist/core/preparation/batch.d.ts.map +1 -0
- package/dist/core/preparation/batch.js +72 -0
- package/dist/core/preparation/batch.js.map +1 -0
- package/dist/core/preparation/evm.d.ts +61 -6
- package/dist/core/preparation/evm.d.ts.map +1 -1
- package/dist/core/preparation/evm.js +122 -34
- package/dist/core/preparation/evm.js.map +1 -1
- package/dist/core/preparation/evmManifestSync.d.ts +68 -0
- package/dist/core/preparation/evmManifestSync.d.ts.map +1 -0
- package/dist/core/preparation/evmManifestSync.js +154 -0
- package/dist/core/preparation/evmManifestSync.js.map +1 -0
- package/dist/core/preparation/index.d.ts +40 -2
- package/dist/core/preparation/index.d.ts.map +1 -1
- package/dist/core/preparation/index.js +3 -3
- package/dist/core/preparation/index.js.map +1 -1
- package/dist/core/preparation/manifest.d.ts +17 -3
- package/dist/core/preparation/manifest.d.ts.map +1 -1
- package/dist/core/preparation/manifest.js +23 -28
- package/dist/core/preparation/manifest.js.map +1 -1
- package/dist/core/preparation/normalize.d.ts.map +1 -1
- package/dist/core/preparation/normalize.js +67 -20
- package/dist/core/preparation/normalize.js.map +1 -1
- package/dist/core/preparation/transparent.d.ts +23 -0
- package/dist/core/preparation/transparent.d.ts.map +1 -0
- package/dist/core/preparation/transparent.js +103 -0
- package/dist/core/preparation/transparent.js.map +1 -0
- package/dist/core/preparation/types.d.ts +54 -7
- package/dist/core/preparation/types.d.ts.map +1 -1
- package/dist/core/preparation/zksync.d.ts.map +1 -1
- package/dist/core/preparation/zksync.js +2 -0
- package/dist/core/preparation/zksync.js.map +1 -1
- package/dist/custody/credential.d.ts.map +1 -1
- package/dist/custody/credential.js +1 -6
- package/dist/custody/credential.js.map +1 -1
- package/dist/custody/hardhat-runtime.d.ts.map +1 -1
- package/dist/custody/hardhat-runtime.js +2 -0
- package/dist/custody/hardhat-runtime.js.map +1 -1
- package/dist/custody/hardhat.d.ts +1 -0
- package/dist/custody/hardhat.d.ts.map +1 -1
- package/dist/custody/hardhat.js +1 -0
- package/dist/custody/hardhat.js.map +1 -1
- package/dist/custody/index.d.ts +1 -0
- package/dist/custody/index.d.ts.map +1 -1
- package/dist/custody/index.js +1 -0
- package/dist/custody/index.js.map +1 -1
- package/dist/custody/provider-wait.d.ts +13 -0
- package/dist/custody/provider-wait.d.ts.map +1 -0
- package/dist/custody/provider-wait.js +78 -0
- package/dist/custody/provider-wait.js.map +1 -0
- package/dist/delivery/policy.d.ts +6 -0
- package/dist/delivery/policy.d.ts.map +1 -0
- package/dist/delivery/policy.js +24 -0
- package/dist/delivery/policy.js.map +1 -0
- package/dist/deployment-evm/index.d.ts +4 -0
- package/dist/deployment-evm/index.d.ts.map +1 -0
- package/dist/deployment-evm/index.js +3 -0
- package/dist/deployment-evm/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/sync/index.d.ts +15 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +13 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow/index.d.ts +10 -2
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +6 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist-cjs/core/BytecodeChecker.js +526 -0
- package/dist-cjs/core/BytecodeChecker.js.map +1 -0
- package/dist-cjs/core/legacyProxyArtifact.js +42 -0
- package/dist-cjs/core/legacyProxyArtifact.js.map +1 -0
- package/dist-cjs/core/preparation/artifacts.js +11 -4
- package/dist-cjs/core/preparation/artifacts.js.map +1 -1
- package/dist-cjs/core/preparation/batch.js +76 -0
- package/dist-cjs/core/preparation/batch.js.map +1 -0
- package/dist-cjs/core/preparation/evm.js +128 -37
- package/dist-cjs/core/preparation/evm.js.map +1 -1
- package/dist-cjs/core/preparation/evmManifestSync.js +163 -0
- package/dist-cjs/core/preparation/evmManifestSync.js.map +1 -0
- package/dist-cjs/core/preparation/index.js +3 -3
- package/dist-cjs/core/preparation/index.js.map +1 -1
- package/dist-cjs/core/preparation/manifest.js +25 -30
- package/dist-cjs/core/preparation/manifest.js.map +1 -1
- package/dist-cjs/core/preparation/normalize.js +67 -20
- package/dist-cjs/core/preparation/normalize.js.map +1 -1
- package/dist-cjs/core/preparation/transparent.js +110 -0
- package/dist-cjs/core/preparation/transparent.js.map +1 -0
- package/dist-cjs/core/preparation/zksync.js +2 -0
- package/dist-cjs/core/preparation/zksync.js.map +1 -1
- package/dist-cjs/custody/credential.js +1 -6
- package/dist-cjs/custody/credential.js.map +1 -1
- package/dist-cjs/custody/hardhat-runtime.js +2 -0
- package/dist-cjs/custody/hardhat-runtime.js.map +1 -1
- package/dist-cjs/custody/hardhat.js +3 -1
- package/dist-cjs/custody/hardhat.js.map +1 -1
- package/dist-cjs/custody/index.js +3 -1
- package/dist-cjs/custody/index.js.map +1 -1
- package/dist-cjs/custody/provider-wait.js +81 -0
- package/dist-cjs/custody/provider-wait.js.map +1 -0
- package/dist-cjs/delivery/policy.js +29 -0
- package/dist-cjs/delivery/policy.js.map +1 -0
- package/dist-cjs/deployment-evm/index.js +10 -0
- package/dist-cjs/deployment-evm/index.js.map +1 -0
- package/dist-cjs/sync/index.js +13 -0
- package/dist-cjs/sync/index.js.map +1 -1
- package/dist-cjs/workflow/index.js +22 -1
- package/dist-cjs/workflow/index.js.map +1 -1
- package/dist-runtime/config/hardhatAdapters.js +2 -1
- package/dist-runtime/config/hardhatAdapters.js.map +1 -1
- package/dist-runtime/config/openzeppelin.d.ts +2 -1
- package/dist-runtime/config/openzeppelin.js +2 -19
- package/dist-runtime/config/openzeppelin.js.map +1 -1
- package/dist-runtime/delivery/abi.d.ts +14 -0
- package/dist-runtime/delivery/abi.js +161 -0
- package/dist-runtime/delivery/abi.js.map +1 -0
- package/dist-runtime/delivery/aggregate-bootstrap.d.ts +12 -0
- package/dist-runtime/delivery/aggregate-bootstrap.js +42 -0
- package/dist-runtime/delivery/aggregate-bootstrap.js.map +1 -0
- package/dist-runtime/delivery/aggregate-channel.d.ts +28 -0
- package/dist-runtime/delivery/aggregate-channel.js +159 -0
- package/dist-runtime/delivery/aggregate-channel.js.map +1 -0
- package/dist-runtime/delivery/aggregate-diagnostics.d.ts +14 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js +73 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js.map +1 -0
- package/dist-runtime/delivery/aggregate-inputs.d.ts +172 -0
- package/dist-runtime/delivery/aggregate-inputs.js +57 -0
- package/dist-runtime/delivery/aggregate-inputs.js.map +1 -0
- package/dist-runtime/delivery/aggregate-source.d.ts +25 -0
- package/dist-runtime/delivery/aggregate-source.js +87 -0
- package/dist-runtime/delivery/aggregate-source.js.map +1 -0
- package/dist-runtime/delivery/aggregate-worker.d.ts +1 -0
- package/dist-runtime/delivery/aggregate-worker.js +199 -0
- package/dist-runtime/delivery/aggregate-worker.js.map +1 -0
- package/dist-runtime/delivery/aggregate.d.ts +51 -0
- package/dist-runtime/delivery/aggregate.js +190 -0
- package/dist-runtime/delivery/aggregate.js.map +1 -0
- package/dist-runtime/delivery/bindings.d.ts +21 -0
- package/dist-runtime/delivery/bindings.js +53 -0
- package/dist-runtime/delivery/bindings.js.map +1 -0
- package/dist-runtime/delivery/business-extension.d.ts +10 -0
- package/dist-runtime/delivery/business-extension.js +38 -0
- package/dist-runtime/delivery/business-extension.js.map +1 -0
- package/dist-runtime/delivery/calldata-archive.d.ts +18 -0
- package/dist-runtime/delivery/calldata-archive.js +31 -0
- package/dist-runtime/delivery/calldata-archive.js.map +1 -0
- package/dist-runtime/delivery/calldata-details.d.ts +47 -0
- package/dist-runtime/delivery/calldata-details.js +94 -0
- package/dist-runtime/delivery/calldata-details.js.map +1 -0
- package/dist-runtime/delivery/calldata-format.d.ts +4 -0
- package/dist-runtime/delivery/calldata-format.js +17 -0
- package/dist-runtime/delivery/calldata-format.js.map +1 -0
- package/dist-runtime/delivery/calldata-preparations.d.ts +13 -0
- package/dist-runtime/delivery/calldata-preparations.js +85 -0
- package/dist-runtime/delivery/calldata-preparations.js.map +1 -0
- package/dist-runtime/delivery/calldata-review.d.ts +44 -0
- package/dist-runtime/delivery/calldata-review.js +131 -0
- package/dist-runtime/delivery/calldata-review.js.map +1 -0
- package/dist-runtime/delivery/check-code.d.ts +19 -0
- package/dist-runtime/delivery/check-code.js +63 -0
- package/dist-runtime/delivery/check-code.js.map +1 -0
- package/dist-runtime/delivery/closure-format.d.ts +77 -0
- package/dist-runtime/delivery/closure-format.js +225 -0
- package/dist-runtime/delivery/closure-format.js.map +1 -0
- package/dist-runtime/delivery/codec-pin.d.ts +2 -0
- package/dist-runtime/delivery/codec-pin.js +7 -0
- package/dist-runtime/delivery/codec-pin.js.map +1 -0
- package/dist-runtime/delivery/codec.d.ts +19 -0
- package/dist-runtime/delivery/codec.js +73 -0
- package/dist-runtime/delivery/codec.js.map +1 -0
- package/dist-runtime/delivery/compiler-dependency-pins.d.ts +7 -0
- package/dist-runtime/delivery/compiler-dependency-pins.js +1689 -0
- package/dist-runtime/delivery/compiler-dependency-pins.js.map +1 -0
- package/dist-runtime/delivery/compiler-files.d.ts +40 -0
- package/dist-runtime/delivery/compiler-files.js +222 -0
- package/dist-runtime/delivery/compiler-files.js.map +1 -0
- package/dist-runtime/delivery/compiler-io.d.ts +2 -0
- package/dist-runtime/delivery/compiler-io.js +13 -0
- package/dist-runtime/delivery/compiler-io.js.map +1 -0
- package/dist-runtime/delivery/compiler-pins.d.ts +10 -0
- package/dist-runtime/delivery/compiler-pins.js +147 -0
- package/dist-runtime/delivery/compiler-pins.js.map +1 -0
- package/dist-runtime/delivery/compiler.d.ts +188 -0
- package/dist-runtime/delivery/compiler.js +851 -0
- package/dist-runtime/delivery/compiler.js.map +1 -0
- package/dist-runtime/delivery/config.d.ts +48 -0
- package/dist-runtime/delivery/config.js +124 -0
- package/dist-runtime/delivery/config.js.map +1 -0
- package/dist-runtime/delivery/configuration-definition.d.ts +31 -0
- package/dist-runtime/delivery/configuration-definition.js +343 -0
- package/dist-runtime/delivery/configuration-definition.js.map +1 -0
- package/dist-runtime/delivery/configuration-hre.d.ts +17 -0
- package/dist-runtime/delivery/configuration-hre.js +198 -0
- package/dist-runtime/delivery/configuration-hre.js.map +1 -0
- package/dist-runtime/delivery/configuration-runtime.d.ts +36 -0
- package/dist-runtime/delivery/configuration-runtime.js +248 -0
- package/dist-runtime/delivery/configuration-runtime.js.map +1 -0
- package/dist-runtime/delivery/configuration.d.ts +35 -0
- package/dist-runtime/delivery/configuration.js +86 -0
- package/dist-runtime/delivery/configuration.js.map +1 -0
- package/dist-runtime/delivery/contract-source.d.ts +14 -0
- package/dist-runtime/delivery/contract-source.js +138 -0
- package/dist-runtime/delivery/contract-source.js.map +1 -0
- package/dist-runtime/delivery/create2.d.ts +3 -0
- package/dist-runtime/delivery/create2.js +48 -0
- package/dist-runtime/delivery/create2.js.map +1 -0
- package/dist-runtime/delivery/custom-closure.d.ts +27 -0
- package/dist-runtime/delivery/custom-closure.js +818 -0
- package/dist-runtime/delivery/custom-closure.js.map +1 -0
- package/dist-runtime/delivery/custom-format.d.ts +35 -0
- package/dist-runtime/delivery/custom-format.js +410 -0
- package/dist-runtime/delivery/custom-format.js.map +1 -0
- package/dist-runtime/delivery/custom.d.ts +32 -0
- package/dist-runtime/delivery/custom.js +158 -0
- package/dist-runtime/delivery/custom.js.map +1 -0
- package/dist-runtime/delivery/data.d.ts +7 -0
- package/dist-runtime/delivery/data.js +86 -0
- package/dist-runtime/delivery/data.js.map +1 -0
- package/dist-runtime/delivery/development.d.ts +92 -0
- package/dist-runtime/delivery/development.js +406 -0
- package/dist-runtime/delivery/development.js.map +1 -0
- package/dist-runtime/delivery/engine.d.ts +9 -0
- package/dist-runtime/delivery/engine.js +23 -0
- package/dist-runtime/delivery/engine.js.map +1 -0
- package/dist-runtime/delivery/eoa-observation.d.ts +43 -0
- package/dist-runtime/delivery/eoa-observation.js +145 -0
- package/dist-runtime/delivery/eoa-observation.js.map +1 -0
- package/dist-runtime/delivery/eoa-signed.d.ts +2 -0
- package/dist-runtime/delivery/eoa-signed.js +74 -0
- package/dist-runtime/delivery/eoa-signed.js.map +1 -0
- package/dist-runtime/delivery/eoa.d.ts +82 -0
- package/dist-runtime/delivery/eoa.js +274 -0
- package/dist-runtime/delivery/eoa.js.map +1 -0
- package/dist-runtime/delivery/execution-db.d.ts +20 -0
- package/dist-runtime/delivery/execution-db.js +153 -0
- package/dist-runtime/delivery/execution-db.js.map +1 -0
- package/dist-runtime/delivery/execution-files.d.ts +9 -0
- package/dist-runtime/delivery/execution-files.js +138 -0
- package/dist-runtime/delivery/execution-files.js.map +1 -0
- package/dist-runtime/delivery/execution-identity.d.ts +15 -0
- package/dist-runtime/delivery/execution-identity.js +33 -0
- package/dist-runtime/delivery/execution-identity.js.map +1 -0
- package/dist-runtime/delivery/execution-model.d.ts +56 -0
- package/dist-runtime/delivery/execution-model.js +66 -0
- package/dist-runtime/delivery/execution-model.js.map +1 -0
- package/dist-runtime/delivery/execution-store.d.ts +48 -0
- package/dist-runtime/delivery/execution-store.js +361 -0
- package/dist-runtime/delivery/execution-store.js.map +1 -0
- package/dist-runtime/delivery/existing-code.d.ts +37 -0
- package/dist-runtime/delivery/existing-code.js +83 -0
- package/dist-runtime/delivery/existing-code.js.map +1 -0
- package/dist-runtime/delivery/export.d.ts +51 -0
- package/dist-runtime/delivery/export.js +69 -0
- package/dist-runtime/delivery/export.js.map +1 -0
- package/dist-runtime/delivery/forkAudit.d.ts +119 -0
- package/dist-runtime/delivery/forkAudit.js +473 -0
- package/dist-runtime/delivery/forkAudit.js.map +1 -0
- package/dist-runtime/delivery/hardhat.d.ts +3 -0
- package/dist-runtime/delivery/hardhat.js +45 -0
- package/dist-runtime/delivery/hardhat.js.map +1 -0
- package/dist-runtime/delivery/history-registration.d.ts +2 -0
- package/dist-runtime/delivery/history-registration.js +17 -0
- package/dist-runtime/delivery/history-registration.js.map +1 -0
- package/dist-runtime/delivery/identities.d.ts +22 -0
- package/dist-runtime/delivery/identities.js +97 -0
- package/dist-runtime/delivery/identities.js.map +1 -0
- package/dist-runtime/delivery/input-files.d.ts +5 -0
- package/dist-runtime/delivery/input-files.js +70 -0
- package/dist-runtime/delivery/input-files.js.map +1 -0
- package/dist-runtime/delivery/inputs.d.ts +62 -0
- package/dist-runtime/delivery/inputs.js +194 -0
- package/dist-runtime/delivery/inputs.js.map +1 -0
- package/dist-runtime/delivery/journal.d.ts +35 -0
- package/dist-runtime/delivery/journal.js +278 -0
- package/dist-runtime/delivery/journal.js.map +1 -0
- package/dist-runtime/delivery/manifest.d.ts +14 -0
- package/dist-runtime/delivery/manifest.js +68 -0
- package/dist-runtime/delivery/manifest.js.map +1 -0
- package/dist-runtime/delivery/materialization.d.ts +20 -0
- package/dist-runtime/delivery/materialization.js +138 -0
- package/dist-runtime/delivery/materialization.js.map +1 -0
- package/dist-runtime/delivery/observations.d.ts +31 -0
- package/dist-runtime/delivery/observations.js +38 -0
- package/dist-runtime/delivery/observations.js.map +1 -0
- package/dist-runtime/delivery/parameter-defaults.d.ts +10 -0
- package/dist-runtime/delivery/parameter-defaults.js +86 -0
- package/dist-runtime/delivery/parameter-defaults.js.map +1 -0
- package/dist-runtime/delivery/parameters.d.ts +55 -0
- package/dist-runtime/delivery/parameters.js +279 -0
- package/dist-runtime/delivery/parameters.js.map +1 -0
- package/dist-runtime/delivery/pending.d.ts +70 -0
- package/dist-runtime/delivery/pending.js +99 -0
- package/dist-runtime/delivery/pending.js.map +1 -0
- package/dist-runtime/delivery/plan.d.ts +50 -0
- package/dist-runtime/delivery/plan.js +209 -0
- package/dist-runtime/delivery/plan.js.map +1 -0
- package/dist-runtime/delivery/planning.d.ts +84 -0
- package/dist-runtime/delivery/planning.js +318 -0
- package/dist-runtime/delivery/planning.js.map +1 -0
- package/dist-runtime/delivery/policy.d.ts +4 -0
- package/dist-runtime/delivery/policy.js +9 -0
- package/dist-runtime/delivery/policy.js.map +1 -0
- package/dist-runtime/delivery/preparation.d.ts +6 -0
- package/dist-runtime/delivery/preparation.js +178 -0
- package/dist-runtime/delivery/preparation.js.map +1 -0
- package/dist-runtime/delivery/production-environment.d.ts +2 -0
- package/dist-runtime/delivery/production-environment.js +13 -0
- package/dist-runtime/delivery/production-environment.js.map +1 -0
- package/dist-runtime/delivery/production-finalization.d.ts +86 -0
- package/dist-runtime/delivery/production-finalization.js +292 -0
- package/dist-runtime/delivery/production-finalization.js.map +1 -0
- package/dist-runtime/delivery/production-intent.d.ts +2 -0
- package/dist-runtime/delivery/production-intent.js +16 -0
- package/dist-runtime/delivery/production-intent.js.map +1 -0
- package/dist-runtime/delivery/production.d.ts +582 -0
- package/dist-runtime/delivery/production.js +445 -0
- package/dist-runtime/delivery/production.js.map +1 -0
- package/dist-runtime/delivery/project-files.d.ts +8 -0
- package/dist-runtime/delivery/project-files.js +87 -0
- package/dist-runtime/delivery/project-files.js.map +1 -0
- package/dist-runtime/delivery/project-rpc.d.ts +19 -0
- package/dist-runtime/delivery/project-rpc.js +138 -0
- package/dist-runtime/delivery/project-rpc.js.map +1 -0
- package/dist-runtime/delivery/project.d.ts +17 -0
- package/dist-runtime/delivery/project.js +170 -0
- package/dist-runtime/delivery/project.js.map +1 -0
- package/dist-runtime/delivery/protocol.d.ts +49 -0
- package/dist-runtime/delivery/protocol.js +112 -0
- package/dist-runtime/delivery/protocol.js.map +1 -0
- package/dist-runtime/delivery/public-calldata.d.ts +25 -0
- package/dist-runtime/delivery/public-calldata.js +97 -0
- package/dist-runtime/delivery/public-calldata.js.map +1 -0
- package/dist-runtime/delivery/references.d.ts +19 -0
- package/dist-runtime/delivery/references.js +84 -0
- package/dist-runtime/delivery/references.js.map +1 -0
- package/dist-runtime/delivery/release-graph.d.ts +97 -0
- package/dist-runtime/delivery/release-graph.js +139 -0
- package/dist-runtime/delivery/release-graph.js.map +1 -0
- package/dist-runtime/delivery/release-history-capture.d.ts +7 -0
- package/dist-runtime/delivery/release-history-capture.js +76 -0
- package/dist-runtime/delivery/release-history-capture.js.map +1 -0
- package/dist-runtime/delivery/release-history.d.ts +43 -0
- package/dist-runtime/delivery/release-history.js +322 -0
- package/dist-runtime/delivery/release-history.js.map +1 -0
- package/dist-runtime/delivery/release-inputs.d.ts +33 -0
- package/dist-runtime/delivery/release-inputs.js +129 -0
- package/dist-runtime/delivery/release-inputs.js.map +1 -0
- package/dist-runtime/delivery/release.d.ts +196 -0
- package/dist-runtime/delivery/release.js +261 -0
- package/dist-runtime/delivery/release.js.map +1 -0
- package/dist-runtime/delivery/safe-manifest.d.ts +9 -0
- package/dist-runtime/delivery/safe-manifest.js +13 -0
- package/dist-runtime/delivery/safe-manifest.js.map +1 -0
- package/dist-runtime/delivery/safe-observation.d.ts +30 -0
- package/dist-runtime/delivery/safe-observation.js +487 -0
- package/dist-runtime/delivery/safe-observation.js.map +1 -0
- package/dist-runtime/delivery/safe-prepare.d.ts +13 -0
- package/dist-runtime/delivery/safe-prepare.js +81 -0
- package/dist-runtime/delivery/safe-prepare.js.map +1 -0
- package/dist-runtime/delivery/safe.d.ts +92 -0
- package/dist-runtime/delivery/safe.js +254 -0
- package/dist-runtime/delivery/safe.js.map +1 -0
- package/dist-runtime/delivery/same-fork-baseline.d.ts +8 -0
- package/dist-runtime/delivery/same-fork-baseline.js +21 -0
- package/dist-runtime/delivery/same-fork-baseline.js.map +1 -0
- package/dist-runtime/delivery/setup.d.ts +31 -0
- package/dist-runtime/delivery/setup.js +230 -0
- package/dist-runtime/delivery/setup.js.map +1 -0
- package/dist-runtime/delivery/source.d.ts +42 -0
- package/dist-runtime/delivery/source.js +139 -0
- package/dist-runtime/delivery/source.js.map +1 -0
- package/dist-runtime/delivery/target-fields.d.ts +2 -0
- package/dist-runtime/delivery/target-fields.js +11 -0
- package/dist-runtime/delivery/target-fields.js.map +1 -0
- package/dist-runtime/delivery/task-identity.d.ts +23 -0
- package/dist-runtime/delivery/task-identity.js +109 -0
- package/dist-runtime/delivery/task-identity.js.map +1 -0
- package/dist-runtime/delivery/toolchain.d.ts +3 -0
- package/dist-runtime/delivery/toolchain.js +52 -0
- package/dist-runtime/delivery/toolchain.js.map +1 -0
- package/dist-runtime/delivery/validation.d.ts +9 -0
- package/dist-runtime/delivery/validation.js +155 -0
- package/dist-runtime/delivery/validation.js.map +1 -0
- package/dist-runtime/delivery/verification.d.ts +16 -0
- package/dist-runtime/delivery/verification.js +65 -0
- package/dist-runtime/delivery/verification.js.map +1 -0
- package/dist-runtime/migrate.js +1 -0
- package/dist-runtime/migrate.js.map +1 -1
- package/dist-runtime/miner/binary.d.ts +2 -0
- package/dist-runtime/miner/binary.js +54 -0
- package/dist-runtime/miner/binary.js.map +1 -0
- package/dist-runtime/miner/cli.d.ts +1 -0
- package/dist-runtime/miner/cli.js +131 -0
- package/dist-runtime/miner/cli.js.map +1 -0
- package/dist-runtime/miner/index.d.ts +5 -0
- package/dist-runtime/miner/index.js +13 -0
- package/dist-runtime/miner/index.js.map +1 -0
- package/dist-runtime/miner/request.d.ts +7 -0
- package/dist-runtime/miner/request.js +73 -0
- package/dist-runtime/miner/request.js.map +1 -0
- package/dist-runtime/miner/runner.d.ts +2 -0
- package/dist-runtime/miner/runner.js +131 -0
- package/dist-runtime/miner/runner.js.map +1 -0
- package/dist-runtime/miner/types.d.ts +89 -0
- package/dist-runtime/miner/types.js +3 -0
- package/dist-runtime/miner/types.js.map +1 -0
- package/dist-runtime/miner/verify.d.ts +2 -0
- package/dist-runtime/miner/verify.js +75 -0
- package/dist-runtime/miner/verify.js.map +1 -0
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/vendor/plan-codec/index.cjs +897 -0
- package/dist-runtime/vendor/plan-codec/index.d.cts +38 -0
- package/dist-runtime/vendor/plan-codec/provenance.json +25 -0
- package/dist-runtime/workflow/engine.d.ts +14 -0
- package/dist-runtime/workflow/engine.js +160 -0
- package/dist-runtime/workflow/engine.js.map +1 -0
- package/dist-runtime/workflow/lib/authority.d.ts +6 -3
- package/dist-runtime/workflow/lib/authority.js.map +1 -1
- package/dist-runtime/workflow/lib/calls.d.ts +1 -1
- package/dist-runtime/workflow/lib/calls.js +44 -34
- package/dist-runtime/workflow/lib/calls.js.map +1 -1
- package/dist-runtime/workflow/lib/canonicalData.d.ts +8 -0
- package/dist-runtime/workflow/lib/canonicalData.js +68 -0
- package/dist-runtime/workflow/lib/canonicalData.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js +7 -4
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -1
- package/dist-runtime/workflow/lib/config.d.ts +3 -1
- package/dist-runtime/workflow/lib/config.js.map +1 -1
- package/dist-runtime/workflow/lib/context.d.ts +77 -0
- package/dist-runtime/workflow/lib/context.js +3 -0
- package/dist-runtime/workflow/lib/context.js.map +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +5 -27
- package/dist-runtime/workflow/lib/create2.js +11 -79
- package/dist-runtime/workflow/lib/create2.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentInfo.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js +6 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -1
- package/dist-runtime/workflow/lib/deployments.d.ts +5 -5
- package/dist-runtime/workflow/lib/deployments.js +5 -13
- package/dist-runtime/workflow/lib/deployments.js.map +1 -1
- package/dist-runtime/workflow/lib/evidencePorts.d.ts +55 -0
- package/dist-runtime/workflow/lib/evidencePorts.js +3 -0
- package/dist-runtime/workflow/lib/evidencePorts.js.map +1 -0
- package/dist-runtime/workflow/lib/executionPlan.d.ts +4 -42
- package/dist-runtime/workflow/lib/executionPlan.js +15 -210
- package/dist-runtime/workflow/lib/executionPlan.js.map +1 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js +2 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -1
- package/dist-runtime/workflow/lib/gateTool.d.ts +6 -2
- package/dist-runtime/workflow/lib/gateTool.js +22 -12
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -1
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +4 -1
- package/dist-runtime/workflow/lib/gateToolSync.js +8 -2
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -1
- package/dist-runtime/workflow/lib/operationNames.d.ts +3 -0
- package/dist-runtime/workflow/lib/operationNames.js +34 -0
- package/dist-runtime/workflow/lib/operationNames.js.map +1 -0
- package/dist-runtime/workflow/lib/parameters.d.ts +1 -1
- package/dist-runtime/workflow/lib/parameters.js +11 -22
- package/dist-runtime/workflow/lib/parameters.js.map +1 -1
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js +18 -52
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js.map +1 -1
- package/dist-runtime/workflow/lib/pendingUupsBinding.d.ts +42 -0
- package/dist-runtime/workflow/lib/pendingUupsBinding.js +39 -0
- package/dist-runtime/workflow/lib/pendingUupsBinding.js.map +1 -0
- package/dist-runtime/workflow/lib/plan.d.ts +55 -0
- package/dist-runtime/workflow/lib/plan.js +324 -0
- package/dist-runtime/workflow/lib/plan.js.map +1 -0
- package/dist-runtime/workflow/lib/planCli.d.ts +14 -0
- package/dist-runtime/workflow/lib/planCli.js +279 -0
- package/dist-runtime/workflow/lib/planCli.js.map +1 -0
- package/dist-runtime/workflow/lib/preparationEvidence.d.ts +4 -0
- package/dist-runtime/workflow/lib/preparationEvidence.js +19 -0
- package/dist-runtime/workflow/lib/preparationEvidence.js.map +1 -0
- package/dist-runtime/workflow/lib/proxy.d.ts +4 -2
- package/dist-runtime/workflow/lib/proxy.js +3 -4
- package/dist-runtime/workflow/lib/proxy.js.map +1 -1
- package/dist-runtime/workflow/lib/runtime.d.ts +6 -0
- package/dist-runtime/workflow/lib/runtime.js +48 -0
- package/dist-runtime/workflow/lib/runtime.js.map +1 -0
- package/dist-runtime/workflow/lib/signer.d.ts +3 -2
- package/dist-runtime/workflow/lib/signer.js +18 -18
- package/dist-runtime/workflow/lib/signer.js.map +1 -1
- package/dist-runtime/workflow/lib/simulation.d.ts +13 -6
- package/dist-runtime/workflow/lib/simulation.js +39 -31
- package/dist-runtime/workflow/lib/simulation.js.map +1 -1
- package/dist-runtime/workflow/lib/state.js +3 -3
- package/dist-runtime/workflow/lib/state.js.map +1 -1
- package/dist-runtime/workflow/lib/staticValidation.d.ts +28 -0
- package/dist-runtime/workflow/lib/staticValidation.js +54 -10
- package/dist-runtime/workflow/lib/staticValidation.js.map +1 -1
- package/dist-runtime/workflow/lib/transactionPlanner.d.ts +62 -0
- package/dist-runtime/workflow/lib/transactionPlanner.js +258 -0
- package/dist-runtime/workflow/lib/transactionPlanner.js.map +1 -0
- package/dist-runtime/workflow/lib/typedValue.d.ts +3 -0
- package/dist-runtime/workflow/lib/typedValue.js +76 -0
- package/dist-runtime/workflow/lib/typedValue.js.map +1 -0
- package/dist-runtime/workflow/lib/validation.d.ts +23 -0
- package/dist-runtime/workflow/lib/validation.js +15 -0
- package/dist-runtime/workflow/lib/validation.js.map +1 -0
- package/dist-runtime/workflow/planAdd.d.ts +1 -0
- package/dist-runtime/workflow/planAdd.js +11 -0
- package/dist-runtime/workflow/planAdd.js.map +1 -0
- package/dist-runtime/workflow/planRead.d.ts +1 -0
- package/dist-runtime/workflow/planRead.js +11 -0
- package/dist-runtime/workflow/planRead.js.map +1 -0
- package/dist-runtime/workflow/planStatus.d.ts +1 -0
- package/dist-runtime/workflow/planStatus.js +11 -0
- package/dist-runtime/workflow/planStatus.js.map +1 -0
- package/dist-runtime/workflow/planWrite.d.ts +1 -0
- package/dist-runtime/workflow/planWrite.js +11 -0
- package/dist-runtime/workflow/planWrite.js.map +1 -0
- package/dist-runtime/workflow/run.d.ts +1 -40
- package/dist-runtime/workflow/run.js +69 -139
- package/dist-runtime/workflow/run.js.map +1 -1
- package/dist-runtime/workflow/staticValidate.js +8 -3
- package/dist-runtime/workflow/staticValidate.js.map +1 -1
- package/dist-runtime/workflow/steps/call.d.ts +1 -1
- package/dist-runtime/workflow/steps/check.d.ts +1 -1
- package/dist-runtime/workflow/steps/custom.d.ts +1 -1
- package/dist-runtime/workflow/steps/deploy.d.ts +1 -1
- package/dist-runtime/workflow/steps/deploy.js +110 -55
- package/dist-runtime/workflow/steps/deploy.js.map +1 -1
- package/dist-runtime/workflow/steps/upgrade.d.ts +1 -1
- package/dist-runtime/workflow/steps/upgrade.js +84 -49
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -1
- package/dist-runtime/workflow/steps/view.d.ts +1 -1
- package/docs/compiler-qualification.md +38 -0
- package/docs/configuration-runtime-observation.md +29 -0
- package/docs/create2-miner.md +100 -0
- package/docs/delivery-aggregate.md +29 -0
- package/docs/delivery-calldata.md +27 -0
- package/docs/delivery-custom-input-closure.md +51 -0
- package/docs/delivery-development.md +38 -0
- package/docs/delivery-eoa.md +46 -0
- package/docs/delivery-evm-manifest.md +20 -0
- package/docs/delivery-execution-store.md +33 -0
- package/docs/delivery-inputs.md +95 -0
- package/docs/delivery-parameters.md +65 -0
- package/docs/delivery-planning.md +140 -0
- package/docs/delivery-release.md +119 -0
- package/docs/delivery-safe.md +75 -0
- package/docs/delivery-setup.md +198 -0
- package/docs/delivery-source.md +67 -0
- package/docs/direct-package-acceptance.md +2 -0
- package/docs/openzeppelin-acceptance.md +86 -0
- package/docs/openzeppelin-baseline.json +27 -0
- package/docs/openzeppelin-integration.md +115 -0
- package/docs/plans/2026-10-28-openzeppelin-toolkit-consolidation.md +396 -0
- package/docs/plans/2026-11-02-transparent-proxy-delivery.md +78 -0
- package/docs/superpowers/plans/2026-08-17-custody-hardhat-signers.md +1 -1
- package/docs/superpowers/plans/2026-09-24-scheme-aware-static-validation.md +193 -0
- package/docs/superpowers/plans/2026-10-28-create2-miner.md +82 -0
- package/docs/workflow-reference.md +12 -4
- package/docs/workflow-runtime.md +6 -0
- package/package.json +148 -10
- package/resources/create2/LICENSE +21 -0
- package/resources/create2/README.md +9 -0
- package/resources/create2/darwin-arm64/smartflow_miner +0 -0
- package/resources/create2/darwin-x64/smartflow_miner +0 -0
- package/resources/create2/manifest.json +27 -0
- package/runtime/config/hardhatAdapters.ts +2 -1
- package/runtime/config/openzeppelin.ts +3 -21
- package/runtime/delivery/abi.ts +225 -0
- package/runtime/delivery/aggregate-bootstrap.ts +31 -0
- package/runtime/delivery/aggregate-channel.ts +88 -0
- package/runtime/delivery/aggregate-diagnostics.ts +63 -0
- package/runtime/delivery/aggregate-inputs.ts +39 -0
- package/runtime/delivery/aggregate-source.ts +57 -0
- package/runtime/delivery/aggregate-worker.ts +143 -0
- package/runtime/delivery/aggregate.ts +139 -0
- package/runtime/delivery/bindings.ts +37 -0
- package/runtime/delivery/business-extension.ts +33 -0
- package/runtime/delivery/calldata-archive.ts +25 -0
- package/runtime/delivery/calldata-details.ts +90 -0
- package/runtime/delivery/calldata-format.ts +14 -0
- package/runtime/delivery/calldata-preparations.ts +76 -0
- package/runtime/delivery/calldata-review.ts +126 -0
- package/runtime/delivery/check-code.ts +38 -0
- package/runtime/delivery/closure-format.ts +350 -0
- package/runtime/delivery/codec-pin.ts +3 -0
- package/runtime/delivery/codec.ts +50 -0
- package/runtime/delivery/compiler-dependency-pins.ts +1685 -0
- package/runtime/delivery/compiler-files.ts +181 -0
- package/runtime/delivery/compiler-io.ts +10 -0
- package/runtime/delivery/compiler-pins.ts +143 -0
- package/runtime/delivery/compiler.ts +701 -0
- package/runtime/delivery/config.ts +116 -0
- package/runtime/delivery/configuration-definition.ts +160 -0
- package/runtime/delivery/configuration-hre.ts +130 -0
- package/runtime/delivery/configuration-runtime.ts +163 -0
- package/runtime/delivery/configuration.ts +67 -0
- package/runtime/delivery/contract-source.ts +112 -0
- package/runtime/delivery/create2.ts +57 -0
- package/runtime/delivery/custom-closure.ts +993 -0
- package/runtime/delivery/custom-format.ts +479 -0
- package/runtime/delivery/custom.ts +219 -0
- package/runtime/delivery/data.ts +94 -0
- package/runtime/delivery/development.ts +264 -0
- package/runtime/delivery/engine.ts +29 -0
- package/runtime/delivery/eoa-observation.ts +106 -0
- package/runtime/delivery/eoa-signed.ts +55 -0
- package/runtime/delivery/eoa.ts +288 -0
- package/runtime/delivery/execution-db.ts +131 -0
- package/runtime/delivery/execution-files.ts +135 -0
- package/runtime/delivery/execution-identity.ts +32 -0
- package/runtime/delivery/execution-model.ts +102 -0
- package/runtime/delivery/execution-store.ts +411 -0
- package/runtime/delivery/existing-code.ts +45 -0
- package/runtime/delivery/export.ts +99 -0
- package/runtime/delivery/forkAudit.ts +620 -0
- package/runtime/delivery/hardhat.ts +38 -0
- package/runtime/delivery/history-registration.ts +10 -0
- package/runtime/delivery/identities.ts +132 -0
- package/runtime/delivery/input-files.ts +46 -0
- package/runtime/delivery/inputs.ts +204 -0
- package/runtime/delivery/journal.ts +205 -0
- package/runtime/delivery/manifest.ts +54 -0
- package/runtime/delivery/materialization.ts +53 -0
- package/runtime/delivery/observations.ts +60 -0
- package/runtime/delivery/parameter-defaults.ts +75 -0
- package/runtime/delivery/parameters.ts +367 -0
- package/runtime/delivery/pending.ts +98 -0
- package/runtime/delivery/plan.ts +337 -0
- package/runtime/delivery/planning.ts +411 -0
- package/runtime/delivery/policy.ts +9 -0
- package/runtime/delivery/preparation.ts +240 -0
- package/runtime/delivery/production-environment.ts +7 -0
- package/runtime/delivery/production-finalization.ts +181 -0
- package/runtime/delivery/production-intent.ts +14 -0
- package/runtime/delivery/production.ts +415 -0
- package/runtime/delivery/project-files.ts +63 -0
- package/runtime/delivery/project-rpc.ts +116 -0
- package/runtime/delivery/project.ts +129 -0
- package/runtime/delivery/protocol.ts +94 -0
- package/runtime/delivery/public-calldata.ts +74 -0
- package/runtime/delivery/references.ts +106 -0
- package/runtime/delivery/release-graph.ts +79 -0
- package/runtime/delivery/release-history-capture.ts +32 -0
- package/runtime/delivery/release-history.ts +178 -0
- package/runtime/delivery/release-inputs.ts +107 -0
- package/runtime/delivery/release.ts +166 -0
- package/runtime/delivery/safe-manifest.ts +11 -0
- package/runtime/delivery/safe-observation.ts +626 -0
- package/runtime/delivery/safe-prepare.ts +101 -0
- package/runtime/delivery/safe.ts +355 -0
- package/runtime/delivery/same-fork-baseline.ts +17 -0
- package/runtime/delivery/setup.ts +184 -0
- package/runtime/delivery/source.ts +130 -0
- package/runtime/delivery/target-fields.ts +7 -0
- package/runtime/delivery/task-identity.ts +85 -0
- package/runtime/delivery/toolchain.ts +48 -0
- package/runtime/delivery/validation.ts +252 -0
- package/runtime/delivery/verification.ts +47 -0
- package/runtime/migrate.ts +1 -0
- package/runtime/miner/binary.ts +41 -0
- package/runtime/miner/cli.ts +87 -0
- package/runtime/miner/index.ts +5 -0
- package/runtime/miner/request.ts +54 -0
- package/runtime/miner/runner.ts +90 -0
- package/runtime/miner/types.ts +71 -0
- package/runtime/miner/verify.ts +61 -0
- package/runtime/vendor/plan-codec/index.cjs +897 -0
- package/runtime/vendor/plan-codec/index.d.cts +38 -0
- package/runtime/vendor/plan-codec/provenance.json +25 -0
- package/runtime/workflow/engine.ts +174 -0
- package/runtime/workflow/lib/authority.ts +3 -3
- package/runtime/workflow/lib/calls.ts +47 -37
- package/runtime/workflow/lib/canonicalData.ts +45 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +7 -3
- package/runtime/workflow/lib/config.ts +1 -1
- package/runtime/workflow/lib/context.ts +77 -0
- package/runtime/workflow/lib/create2.ts +18 -121
- package/runtime/workflow/lib/deploymentInfo.ts +8 -0
- package/runtime/workflow/lib/deploymentRecords.ts +3 -1
- package/runtime/workflow/lib/deployments.ts +6 -14
- package/runtime/workflow/lib/evidencePorts.ts +20 -0
- package/runtime/workflow/lib/executionPlan.ts +17 -268
- package/runtime/workflow/lib/externalExecutionScanner.ts +2 -1
- package/runtime/workflow/lib/gateTool.ts +22 -10
- package/runtime/workflow/lib/gateToolSync.ts +11 -3
- package/runtime/workflow/lib/operationNames.ts +32 -0
- package/runtime/workflow/lib/parameters.ts +8 -21
- package/runtime/workflow/lib/pendingDeploymentReuse.ts +4 -56
- package/runtime/workflow/lib/pendingUupsBinding.ts +43 -0
- package/runtime/workflow/lib/plan.ts +334 -0
- package/runtime/workflow/lib/planCli.ts +279 -0
- package/runtime/workflow/lib/preparationEvidence.ts +14 -0
- package/runtime/workflow/lib/proxy.ts +6 -3
- package/runtime/workflow/lib/runtime.ts +46 -0
- package/runtime/workflow/lib/signer.ts +8 -5
- package/runtime/workflow/lib/simulation.ts +41 -17
- package/runtime/workflow/lib/state.ts +3 -3
- package/runtime/workflow/lib/staticValidation.ts +92 -11
- package/runtime/workflow/lib/transactionPlanner.ts +314 -0
- package/runtime/workflow/lib/typedValue.ts +46 -0
- package/runtime/workflow/lib/validation.ts +50 -0
- package/runtime/workflow/planAdd.ts +8 -0
- package/runtime/workflow/planRead.ts +8 -0
- package/runtime/workflow/planStatus.ts +8 -0
- package/runtime/workflow/planWrite.ts +8 -0
- package/runtime/workflow/run.ts +42 -176
- package/runtime/workflow/staticValidate.ts +8 -3
- package/runtime/workflow/steps/call.ts +1 -1
- package/runtime/workflow/steps/check.ts +1 -1
- package/runtime/workflow/steps/custom.ts +1 -1
- package/runtime/workflow/steps/deploy.ts +99 -58
- package/runtime/workflow/steps/upgrade.ts +88 -57
- package/runtime/workflow/steps/view.ts +1 -1
- package/bin/workflow.cjs +0 -19
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { yieldCompilerIo } from './compiler-io';
|
|
2
|
+
import { createCalldataInvocation, reviewTransaction, parseCalldataReviews, type CalldataTransactionReview } from './calldata-review';
|
|
3
|
+
import { preparationCalldataReviews } from './calldata-preparations';
|
|
4
|
+
import {assertOwnedTargetWorker} from './aggregate-bootstrap';
|
|
5
|
+
import type { ReferenceObservation } from "./references";
|
|
6
|
+
import { createDeliveryValidation } from "./validation";
|
|
7
|
+
import { strictData } from "./data";
|
|
8
|
+
/** Internal simulation collection only. No release_ready, business acceptance or broadcast API. */
|
|
9
|
+
import {
|
|
10
|
+
DeliveryOperationIdentities,
|
|
11
|
+
bindDeliveryTransactions,
|
|
12
|
+
} from "./identities";
|
|
13
|
+
import {
|
|
14
|
+
CustomPlanningSession,
|
|
15
|
+
ownedCustomSession,
|
|
16
|
+
parseCustomEvidence,
|
|
17
|
+
type CustomEvidence,
|
|
18
|
+
type CustomPlanningInputSession,
|
|
19
|
+
} from "./custom";
|
|
20
|
+
import { LocalForkAudit, type ForkAuditEvidence } from "./forkAudit";
|
|
21
|
+
import type { WorkflowStep } from "../workflow/lib/parameters";
|
|
22
|
+
import type { CompletedExecutionTransaction } from "../workflow/lib/transactionPlanner";
|
|
23
|
+
import { TransactionPlanner } from "../workflow/lib/transactionPlanner";
|
|
24
|
+
import {
|
|
25
|
+
canonicalData,
|
|
26
|
+
canonicalJson,
|
|
27
|
+
deepFreeze,
|
|
28
|
+
semanticHash,
|
|
29
|
+
} from "../workflow/lib/canonicalData";
|
|
30
|
+
import { assertLocalForkRuntime } from "../workflow/lib/runtime";
|
|
31
|
+
import { runDeliverySteps, type DeliveryStepContext } from "./engine";
|
|
32
|
+
import {
|
|
33
|
+
parseDeliveryPlan,
|
|
34
|
+
parseDeliveryPlanHeader,
|
|
35
|
+
sealDeliveryPlan,
|
|
36
|
+
type DeliveryPlan,
|
|
37
|
+
type DeliveryPlanHeader,
|
|
38
|
+
type DeliveryPlanBody,
|
|
39
|
+
} from "./plan";
|
|
40
|
+
import { DeliveryExecutionBindings } from "./bindings";
|
|
41
|
+
import {
|
|
42
|
+
PreparationJournal,
|
|
43
|
+
parsePreparationJournal,
|
|
44
|
+
type PreparationEntry,
|
|
45
|
+
} from "./journal";
|
|
46
|
+
import {
|
|
47
|
+
VerificationJournal,
|
|
48
|
+
parseVerificationObservation,
|
|
49
|
+
} from "./verification";
|
|
50
|
+
import type { VerificationObservation } from "../workflow/lib/evidencePorts";
|
|
51
|
+
import type { PendingReuseBinding } from "../workflow/lib/pendingUupsBinding";
|
|
52
|
+
import { ownedDeliveryCompiler, hasCompilerSameForkInitial, type DeliveryCompilerCollector, type CompilerEvidence } from './compiler';
|
|
53
|
+
export interface PlanningIdentityPort {
|
|
54
|
+
/** Launcher supplies validated source/inputs/runtime identity; parser does not inspect project files. */
|
|
55
|
+
read(): Promise<DeliveryPlanHeader>;
|
|
56
|
+
/** Launcher-owned read-only source connection. It must read the requested pinned block. */
|
|
57
|
+
readSourceBlock(
|
|
58
|
+
blockNumber: number
|
|
59
|
+
): Promise<{ chainId: string; blockNumber: number; blockHash: string }>;
|
|
60
|
+
}
|
|
61
|
+
export interface DeliveryRuntimeEvidence {
|
|
62
|
+
/** Validated during this collection only; never hashed or compared as canonical replay content. */
|
|
63
|
+
pendingUupsReuse: { stepId: string; binding: PendingReuseBinding }[];
|
|
64
|
+
forkAudit: ForkAuditEvidence;
|
|
65
|
+
references: {
|
|
66
|
+
sourceStepId: string;
|
|
67
|
+
observations: readonly ReferenceObservation[];
|
|
68
|
+
}[];
|
|
69
|
+
}
|
|
70
|
+
export interface DeliveryCollection {
|
|
71
|
+
plan: DeliveryPlan;
|
|
72
|
+
calldata: CalldataTransactionReview[];
|
|
73
|
+
preparations: PreparationEntry[];
|
|
74
|
+
verification: VerificationObservation[];
|
|
75
|
+
runtimeEvidence: DeliveryRuntimeEvidence;
|
|
76
|
+
}
|
|
77
|
+
async function readCompilerEvidence(compiler: DeliveryCompilerCollector): Promise<CompilerEvidence> {
|
|
78
|
+
try {
|
|
79
|
+
return compiler.evidence();
|
|
80
|
+
} finally {
|
|
81
|
+
// Full payload rereads can outlast an idle HTTP connection. Yield before
|
|
82
|
+
// the first collection RPC as well as before returning to its caller.
|
|
83
|
+
await yieldCompilerIo();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Strict compiler-owned contribution path. Header identities are still launcher-owned until aggregate c.2. */
|
|
87
|
+
export async function collectCompilerQualifiedDeliveryPlan(
|
|
88
|
+
input: Parameters<typeof collectDeliveryPlan>[0] & { compiler: DeliveryCompilerCollector },
|
|
89
|
+
): Promise<{ collection: DeliveryCollection; compilerEvidence: CompilerEvidence }> {
|
|
90
|
+
if (ownedDeliveryCompiler(input.context.runtime.hre) !== input.compiler) throw new Error('Compiler-qualified collection requires its actual owned HRE collector');
|
|
91
|
+
await readCompilerEvidence(input.compiler);
|
|
92
|
+
const collection = await collectDeliveryPlan(input);
|
|
93
|
+
return { collection, compilerEvidence: await readCompilerEvidence(input.compiler) };
|
|
94
|
+
}
|
|
95
|
+
export interface DeliveryPlanningOptions {
|
|
96
|
+
context: DeliveryStepContext;
|
|
97
|
+
header: DeliveryPlanHeader;
|
|
98
|
+
identities: PlanningIdentityPort;
|
|
99
|
+
steps: readonly WorkflowStep[];
|
|
100
|
+
derivationSeed: string;
|
|
101
|
+
expected?: Pick<DeliveryCollection, "plan" | "preparations" | "verification"> & Partial<Pick<DeliveryCollection, 'calldata'>>;
|
|
102
|
+
completedTransactions?: CompletedExecutionTransaction[];
|
|
103
|
+
customSession?: CustomPlanningInputSession;
|
|
104
|
+
}
|
|
105
|
+
export interface StagedDeliveryCollection {
|
|
106
|
+
readonly payload: Omit<DeliveryPlanBody,'inputsHash'>;
|
|
107
|
+
readonly invariantHash:string;
|
|
108
|
+
readonly snapshot: {payload:Omit<DeliveryPlanBody,'inputsHash'>;calldata:CalldataTransactionReview[];preparations:PreparationEntry[];verification:VerificationObservation[];runtimeEvidence:Omit<DeliveryRuntimeEvidence,'forkAudit'>&{forkAudit:Omit<ForkAuditEvidence,'planHash'|'evidenceHash'>}};
|
|
109
|
+
assertUnchanged(): Promise<void>;
|
|
110
|
+
bind(inputsHash:string): DeliveryCollection;
|
|
111
|
+
close():void;
|
|
112
|
+
}
|
|
113
|
+
export async function collectDeliveryPlan(input:DeliveryPlanningOptions):Promise<DeliveryCollection> {
|
|
114
|
+
return collectOwned(input,false) as Promise<DeliveryCollection>;
|
|
115
|
+
}
|
|
116
|
+
/** Internal worker seam. JSON cannot manufacture this live interval/closure authority. */
|
|
117
|
+
export async function stageDeliveryPlan(input:Omit<DeliveryPlanningOptions,'header'|'identities'> & {
|
|
118
|
+
header:Omit<DeliveryPlanHeader,'inputsHash'>;
|
|
119
|
+
identities:Omit<PlanningIdentityPort,'read'> & {read():Promise<Omit<DeliveryPlanHeader,'inputsHash'>>};
|
|
120
|
+
}):Promise<StagedDeliveryCollection> {
|
|
121
|
+
assertOwnedTargetWorker();
|
|
122
|
+
if(input.expected)throw new Error('Staged replay requires independently closed current inputs; use known-final collection');
|
|
123
|
+
if(input.context.pendingUupsReuse)throw new Error('Unknown aggregate inputs cannot authorize pending reuse');
|
|
124
|
+
const hash='0'.repeat(64);
|
|
125
|
+
return collectOwned({...input,header:{...input.header,inputsHash:hash},identities:{...input.identities,read:async()=>({...await input.identities.read(),inputsHash:hash})}},true) as Promise<StagedDeliveryCollection>;
|
|
126
|
+
}
|
|
127
|
+
async function collectOwned(input:DeliveryPlanningOptions,staging:boolean):Promise<DeliveryCollection|StagedDeliveryCollection> {
|
|
128
|
+
const sourceSteps = strictData(input.steps);
|
|
129
|
+
const header = parseDeliveryPlanHeader(input.header),
|
|
130
|
+
context = input.context;
|
|
131
|
+
if (context.mode !== "simulate")
|
|
132
|
+
throw new Error("Delivery planning requires simulate mode");
|
|
133
|
+
if (context.target.create2?.scheme && context.target.create2.scheme !== "evm")
|
|
134
|
+
throw new Error("Delivery planning requires EVM");
|
|
135
|
+
if (new Set(sourceSteps.map((s) => s.id)).size !== input.steps.length)
|
|
136
|
+
throw new Error("Duplicate selected step IDs");
|
|
137
|
+
assertLocalForkRuntime(context.runtime);
|
|
138
|
+
if (
|
|
139
|
+
context.executionId !== header.executionId ||
|
|
140
|
+
context.taskId !== header.deploymentId ||
|
|
141
|
+
context.targetId !== header.target ||
|
|
142
|
+
context.signerAddress?.toLowerCase() !== header.operator ||
|
|
143
|
+
!context.signer ||
|
|
144
|
+
(await context.signer.getAddress()).toLowerCase() !== header.operator
|
|
145
|
+
)
|
|
146
|
+
throw new Error("Delivery context/header/operator identity mismatch");
|
|
147
|
+
const snapshot = context.simulation.snapshot;
|
|
148
|
+
if (
|
|
149
|
+
!snapshot ||
|
|
150
|
+
!Number.isSafeInteger(snapshot.blockNumber) ||
|
|
151
|
+
snapshot.blockNumber < 0 ||
|
|
152
|
+
!/^0x[\da-fA-F]{64}$/.test(snapshot.blockHash)
|
|
153
|
+
)
|
|
154
|
+
throw new Error("Delivery planning requires pinned fork identity");
|
|
155
|
+
const pinned = {
|
|
156
|
+
blockNumber: snapshot.blockNumber,
|
|
157
|
+
blockHash: snapshot.blockHash.toLowerCase(),
|
|
158
|
+
};
|
|
159
|
+
const verifyIdentities = async () => {
|
|
160
|
+
assertLocalForkRuntime(context.runtime);
|
|
161
|
+
const [identity, source, local, network] = await Promise.all([
|
|
162
|
+
input.identities.read(),
|
|
163
|
+
input.identities.readSourceBlock(pinned.blockNumber),
|
|
164
|
+
context.runtime.hre.network.provider.request({
|
|
165
|
+
method: "eth_getBlockByNumber",
|
|
166
|
+
params: [`0x${pinned.blockNumber.toString(16)}`, false],
|
|
167
|
+
}),
|
|
168
|
+
context.runtime.hre.ethers.provider.getNetwork(),
|
|
169
|
+
]);
|
|
170
|
+
if (
|
|
171
|
+
canonicalJson(parseDeliveryPlanHeader(identity)) !== canonicalJson(header)
|
|
172
|
+
)
|
|
173
|
+
throw new Error("Planning source/input/runtime identity drift");
|
|
174
|
+
if (
|
|
175
|
+
network.chainId.toString() !== header.chainId ||
|
|
176
|
+
source.chainId !== header.chainId ||
|
|
177
|
+
source.blockNumber !== pinned.blockNumber ||
|
|
178
|
+
source.blockHash.toLowerCase() !== pinned.blockHash ||
|
|
179
|
+
!local ||
|
|
180
|
+
typeof local !== "object" ||
|
|
181
|
+
(local as { hash?: string }).hash?.toLowerCase() !== pinned.blockHash
|
|
182
|
+
)
|
|
183
|
+
throw new Error("Planning pinned fork/source identity mismatch");
|
|
184
|
+
};
|
|
185
|
+
await verifyIdentities();
|
|
186
|
+
await createDeliveryValidation(context).preflight(
|
|
187
|
+
sourceSteps.filter((step) => step.kind !== "custom")
|
|
188
|
+
);
|
|
189
|
+
const audit = await LocalForkAudit.start({
|
|
190
|
+
provider: context.runtime.hre.network.provider,
|
|
191
|
+
chainId: header.chainId,
|
|
192
|
+
sourceSnapshot: pinned,
|
|
193
|
+
});
|
|
194
|
+
let retained=false;
|
|
195
|
+
try {
|
|
196
|
+
const expected =
|
|
197
|
+
input.expected && parseDeliveryPlan(input.expected.plan, header);
|
|
198
|
+
const journalIdentity = {
|
|
199
|
+
target: header.target,
|
|
200
|
+
chainId: header.chainId,
|
|
201
|
+
expectedStepIds: expected?.deploymentBindings.map((b) => b.stepId) ?? [],
|
|
202
|
+
};
|
|
203
|
+
const prior =
|
|
204
|
+
expected &&
|
|
205
|
+
parsePreparationJournal(
|
|
206
|
+
input.expected!.preparations,
|
|
207
|
+
expected.transactions,
|
|
208
|
+
expected.derivedBindings,
|
|
209
|
+
journalIdentity
|
|
210
|
+
);
|
|
211
|
+
const bindings = new DeliveryExecutionBindings({
|
|
212
|
+
executionId: header.executionId,
|
|
213
|
+
derivationSeed: input.derivationSeed,
|
|
214
|
+
expected: expected?.derivedBindings,
|
|
215
|
+
});
|
|
216
|
+
const planner = new TransactionPlanner({
|
|
217
|
+
operator: header.operator,
|
|
218
|
+
expectedTransactions: expected?.transactions,
|
|
219
|
+
replayCompletedPrefix: true,
|
|
220
|
+
completedTransactions: input.completedTransactions,
|
|
221
|
+
});
|
|
222
|
+
const preparations = new PreparationJournal({
|
|
223
|
+
...journalIdentity,
|
|
224
|
+
expectedStepIds: [],
|
|
225
|
+
expected: prior,
|
|
226
|
+
qualifiedSameFork: initial => hasCompilerSameForkInitial(context.runtime.hre,initial),
|
|
227
|
+
});
|
|
228
|
+
const verification = new VerificationJournal([]);
|
|
229
|
+
const pendingObservations: DeliveryRuntimeEvidence["pendingUupsReuse"] = [];
|
|
230
|
+
const callReviews = new Map<string, CalldataTransactionReview>();
|
|
231
|
+
const operationIds = new DeliveryOperationIdentities();
|
|
232
|
+
const references: DeliveryRuntimeEvidence["references"] = [];
|
|
233
|
+
const customBindings: CustomEvidence[] = [],
|
|
234
|
+
executed: WorkflowStep[] = [];
|
|
235
|
+
const session = sourceSteps.some((step) => step.kind === "custom")
|
|
236
|
+
? ownedCustomSession(
|
|
237
|
+
input.customSession ??
|
|
238
|
+
new CustomPlanningSession({
|
|
239
|
+
root: context.root,
|
|
240
|
+
businessRoot: context.taskDir,
|
|
241
|
+
params: context.targetParams,
|
|
242
|
+
target: context.target,
|
|
243
|
+
state: () => context.state.snapshot(),
|
|
244
|
+
}),
|
|
245
|
+
context.root,
|
|
246
|
+
context.taskDir
|
|
247
|
+
)
|
|
248
|
+
: undefined;
|
|
249
|
+
const pendingUupsReuse = context.pendingUupsReuse;
|
|
250
|
+
const stepContext: DeliveryStepContext = {
|
|
251
|
+
...context,
|
|
252
|
+
deploymentRecorder: undefined,
|
|
253
|
+
bindings,
|
|
254
|
+
preparations,
|
|
255
|
+
verification,
|
|
256
|
+
calldataReview: { record(tx, intent) {
|
|
257
|
+
if (callReviews.has(tx.transactionId)) throw Error('Duplicate calldata ABI intent');
|
|
258
|
+
callReviews.set(tx.transactionId, reviewTransaction(tx, createCalldataInvocation({ ...intent, data: tx.data })));
|
|
259
|
+
} },
|
|
260
|
+
executionPlanner: planner,
|
|
261
|
+
transactionIdentity: operationIds,
|
|
262
|
+
transactionObserver: audit,
|
|
263
|
+
runtime: {
|
|
264
|
+
...context.runtime,
|
|
265
|
+
localFork: {
|
|
266
|
+
...context.runtime.localFork!,
|
|
267
|
+
impersonate: (address) =>
|
|
268
|
+
audit.setup(address, () =>
|
|
269
|
+
context.runtime.localFork!.impersonate(address)
|
|
270
|
+
),
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
pendingUupsReuse: pendingUupsReuse && {
|
|
274
|
+
resolve: async (query) => {
|
|
275
|
+
const resolution = await pendingUupsReuse.resolve(query);
|
|
276
|
+
if (resolution?.binding)
|
|
277
|
+
pendingObservations.push({
|
|
278
|
+
stepId: query.stepId,
|
|
279
|
+
binding: canonicalData(
|
|
280
|
+
resolution.binding
|
|
281
|
+
) as unknown as PendingReuseBinding,
|
|
282
|
+
});
|
|
283
|
+
return resolution;
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
for (const sourceStep of sourceSteps) {
|
|
288
|
+
let operations: readonly WorkflowStep[];
|
|
289
|
+
if (sourceStep.kind === "custom") {
|
|
290
|
+
const evidence = parseCustomEvidence(
|
|
291
|
+
await session!.evaluate(sourceStep)
|
|
292
|
+
);
|
|
293
|
+
if (evidence.sourceStepId !== sourceStep.id)
|
|
294
|
+
throw new Error("Custom session source identity mismatch");
|
|
295
|
+
customBindings.push(evidence);
|
|
296
|
+
operations = evidence.operations;
|
|
297
|
+
} else operations = [sourceStep];
|
|
298
|
+
// Register and validate the complete emitted list before dispatching its first operation.
|
|
299
|
+
const steps: WorkflowStep[] = operations.map((operation) => ({
|
|
300
|
+
...operation,
|
|
301
|
+
id: operationIds.register(
|
|
302
|
+
sourceStep.id,
|
|
303
|
+
sourceStep.kind === "custom" ? operation.id : null,
|
|
304
|
+
operation.kind
|
|
305
|
+
),
|
|
306
|
+
}));
|
|
307
|
+
preparations.declare(
|
|
308
|
+
steps
|
|
309
|
+
.filter((s) => s.kind === "deploy" || s.kind === "upgrade")
|
|
310
|
+
.map((s) => s.id)
|
|
311
|
+
);
|
|
312
|
+
verification.declare(
|
|
313
|
+
steps
|
|
314
|
+
.filter((s) => s.kind === "check")
|
|
315
|
+
.flatMap((s) => {
|
|
316
|
+
if (!Array.isArray(s.calls) || !s.calls.length)
|
|
317
|
+
throw new Error(`Check ${s.id} requires calls`);
|
|
318
|
+
return s.calls.map((_, callIndex) => ({
|
|
319
|
+
stepId: s.id,
|
|
320
|
+
callIndex,
|
|
321
|
+
assertionId: `${s.id}:${callIndex}`,
|
|
322
|
+
}));
|
|
323
|
+
})
|
|
324
|
+
);
|
|
325
|
+
executed.push(...steps);
|
|
326
|
+
const result = await runDeliverySteps(stepContext, steps);
|
|
327
|
+
references.push({
|
|
328
|
+
sourceStepId: sourceStep.id,
|
|
329
|
+
observations: result.references,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
await verifyIdentities();
|
|
333
|
+
const transactions = planner.complete(),
|
|
334
|
+
derivedBindings = bindings.seal();
|
|
335
|
+
const prepared = preparations.seal(transactions, derivedBindings),
|
|
336
|
+
observations = verification.seal();
|
|
337
|
+
for (const review of await preparationCalldataReviews(prepared, transactions, context.runtime.hre.artifacts)) {
|
|
338
|
+
if (callReviews.has(review.transactionId)) throw Error('Duplicate calldata preparation intent');
|
|
339
|
+
callReviews.set(review.transactionId, review);
|
|
340
|
+
}
|
|
341
|
+
const calldata = parseCalldataReviews(transactions.map(tx => callReviews.get(tx.transactionId)), transactions);
|
|
342
|
+
if (input.expected?.calldata && canonicalJson(parseCalldataReviews(input.expected.calldata, transactions)) !== canonicalJson(calldata)) throw Error('Replayed calldata ABI intent differs');
|
|
343
|
+
const {inputsHash:knownHash,...base}=header;
|
|
344
|
+
const payload = deepFreeze({
|
|
345
|
+
...base,
|
|
346
|
+
transactions,
|
|
347
|
+
derivedBindings,
|
|
348
|
+
operationBindings: operationIds.seal(),
|
|
349
|
+
transactionBindings: bindDeliveryTransactions(
|
|
350
|
+
transactions,
|
|
351
|
+
operationIds.seal()
|
|
352
|
+
),
|
|
353
|
+
customBindings,
|
|
354
|
+
customInputClosure: session?.seal() ?? null,
|
|
355
|
+
deploymentBindings: prepared.map((p) => ({
|
|
356
|
+
stepId: p.stepId,
|
|
357
|
+
preparationHash: p.preparationHash,
|
|
358
|
+
transactionIds: p.mappings.map((m) => m.transactionId),
|
|
359
|
+
derivedKeys: p.derivedKeys,
|
|
360
|
+
})),
|
|
361
|
+
verificationBindings: executed
|
|
362
|
+
.filter((s) => s.kind === "check")
|
|
363
|
+
.map((s) => {
|
|
364
|
+
const checks = observations.filter((o) => o.stepId === s.id);
|
|
365
|
+
return {
|
|
366
|
+
stepId: s.id,
|
|
367
|
+
assertionIds: checks.map((o) => o.assertionId),
|
|
368
|
+
verificationHash: semanticHash(checks),
|
|
369
|
+
};
|
|
370
|
+
}),
|
|
371
|
+
});
|
|
372
|
+
if (input.expected && canonicalJson(input.expected.verification.map(parseVerificationObservation)) !== canonicalJson(observations))
|
|
373
|
+
throw new Error("Replayed verification evidence differs");
|
|
374
|
+
session?.closeReads();
|
|
375
|
+
const interval=await audit.capture({transactions,completedTransactions:input.completedTransactions??[]});
|
|
376
|
+
const stagedSnapshot=deepFreeze({payload,calldata,preparations:prepared,verification:observations,runtimeEvidence:{pendingUupsReuse:pendingObservations,forkAudit:interval.snapshot,references}});
|
|
377
|
+
const invariantHash=semanticHash(stagedSnapshot);
|
|
378
|
+
let state:'staged'|'bound'|'failed'|'closed'='staged';
|
|
379
|
+
const open=()=>{if(state!=='staged')throw new Error('Staged collection closed or already bound');};
|
|
380
|
+
const bind=(inputsHash:string):DeliveryCollection=>{
|
|
381
|
+
open(); state='failed';
|
|
382
|
+
const plan=sealDeliveryPlan({...payload,inputsHash});
|
|
383
|
+
if(expected&&plan.planHash!==expected.planHash)throw new Error('Replayed delivery plan differs from expected plan');
|
|
384
|
+
const forkAudit=interval.bind(plan.planHash);
|
|
385
|
+
const result=deepFreeze(canonicalData({plan,calldata,preparations:prepared,verification:observations,
|
|
386
|
+
runtimeEvidence:{pendingUupsReuse:pendingObservations,forkAudit,references}}) as unknown as DeliveryCollection);
|
|
387
|
+
if(collectionInvariantHash(result)!==invariantHash)throw new Error('Binding changed staged collection payload');
|
|
388
|
+
state='bound';return result;
|
|
389
|
+
};
|
|
390
|
+
const check=async()=>{
|
|
391
|
+
open();
|
|
392
|
+
try {
|
|
393
|
+
await verifyIdentities();await interval.assertUnchanged();
|
|
394
|
+
if(session&&canonicalJson(session.seal())!==canonicalJson(payload.customInputClosure))throw new Error('Custom input closure drift at collection completion');
|
|
395
|
+
}catch(error){state='failed';throw error;}
|
|
396
|
+
};
|
|
397
|
+
if(!staging){await check();return bind(knownHash);}
|
|
398
|
+
retained=true;
|
|
399
|
+
return Object.freeze({payload,invariantHash,snapshot:stagedSnapshot,assertUnchanged:check,bind,close(){state='closed';audit.close();}});
|
|
400
|
+
|
|
401
|
+
} finally {
|
|
402
|
+
if(!retained)audit.close();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** Comparison only; this hash creates no collection/staging authority. */
|
|
407
|
+
export function collectionInvariantHash(collection:DeliveryCollection):string {
|
|
408
|
+
const {inputsHash:_,planHash:__,...payload}=collection.plan;
|
|
409
|
+
const {planHash:___,evidenceHash:____,...forkAudit}=collection.runtimeEvidence.forkAudit;
|
|
410
|
+
return semanticHash({payload,calldata:collection.calldata,preparations:collection.preparations,verification:collection.verification,runtimeEvidence:{...collection.runtimeEvidence,forkAudit}});
|
|
411
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// dist-runtime is a separate CommonJS package boundary. Resolve our built policy by
|
|
2
|
+
// location rather than package self-reference, which is unavailable in a checkout.
|
|
3
|
+
export const validateManifestPolicy: typeof import('gate-evm-tools/delivery-policy').validateManifestPolicy =
|
|
4
|
+
require('../../dist-cjs/delivery/policy.js').validateManifestPolicy;
|
|
5
|
+
export const validateNetworkAlias: typeof import('gate-evm-tools/delivery-policy').validateNetworkAlias =
|
|
6
|
+
require('../../dist-cjs/delivery/policy.js').validateNetworkAlias;
|
|
7
|
+
export const isSafeNetworkAlias: typeof import('gate-evm-tools/delivery-policy').isSafeNetworkAlias =
|
|
8
|
+
require('../../dist-cjs/delivery/policy.js').isSafeNetworkAlias;
|
|
9
|
+
export type { ManifestEnvironment } from 'gate-evm-tools/delivery-policy';
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/** Pure current-artifact consistency, including reuse. This does not attest compiler or OZ layout closure. */
|
|
2
|
+
import { Interface, concat, getCreate2Address } from "ethers";
|
|
3
|
+
import {
|
|
4
|
+
artifactIdentity,
|
|
5
|
+
TRANSPARENT_PROXY_ARTIFACT, PROXY_ADMIN_ARTIFACT, PROXY_ADMIN_INTERFACE, transparentAdminAddress,
|
|
6
|
+
type GateToolArtifact,
|
|
7
|
+
type GateToolPreparationPlanV1,
|
|
8
|
+
type GateToolPreparationRequestV1,
|
|
9
|
+
type GateToolDeploymentPlan,
|
|
10
|
+
type GateToolAddressPolicy,
|
|
11
|
+
} from "gate-evm-tools/workflow";
|
|
12
|
+
import { canonicalJson } from "../workflow/lib/canonicalData";
|
|
13
|
+
import { canonicalCreate2Hashes } from "../workflow/lib/create2Hashes";
|
|
14
|
+
import { strictData } from "./data";
|
|
15
|
+
import { validateAbiArguments, validateTransactionValue } from "./abi";
|
|
16
|
+
export const ERC1967_PROXY =
|
|
17
|
+
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy";
|
|
18
|
+
const factoryInterface = new Interface([
|
|
19
|
+
"function deploy(bytes32 salt,bytes initCode,bytes data,uint256 create2ForwardValue,uint256 callForwardValue) payable returns(address)",
|
|
20
|
+
]);
|
|
21
|
+
const upgradeInterface = new Interface([
|
|
22
|
+
"function upgradeToAndCall(address newImplementation,bytes data) payable",
|
|
23
|
+
]);
|
|
24
|
+
export type DeliveryArtifactReader = (
|
|
25
|
+
name: string,
|
|
26
|
+
) => Promise<GateToolArtifact>;
|
|
27
|
+
export function deliveryArtifact(raw: GateToolArtifact): GateToolArtifact {
|
|
28
|
+
const artifact = strictData(raw, "delivery artifact");
|
|
29
|
+
if (
|
|
30
|
+
artifact._format !== "hh-sol-artifact-1" ||
|
|
31
|
+
typeof artifact.bytecode !== "string" ||
|
|
32
|
+
!/^0x(?:[0-9a-fA-F]{2})*$/.test(artifact.bytecode)
|
|
33
|
+
)
|
|
34
|
+
throw new Error("Delivery requires actual EVM artifact bytecode");
|
|
35
|
+
new Interface(artifact.abi);
|
|
36
|
+
return artifact;
|
|
37
|
+
}
|
|
38
|
+
export function deliveryPreparationData(raw: unknown): unknown {
|
|
39
|
+
const value = strictData(raw);
|
|
40
|
+
if (
|
|
41
|
+
value &&
|
|
42
|
+
typeof value === "object" &&
|
|
43
|
+
Object.hasOwn(value, "constructorArgs")
|
|
44
|
+
) {
|
|
45
|
+
const request = value as Record<string, unknown>;
|
|
46
|
+
for (const key of ["create2ForwardValue", "callForwardValue"])
|
|
47
|
+
if (Object.hasOwn(request, key)) validateTransactionValue(request[key]);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
export async function validatePreparationSemantics(
|
|
52
|
+
request: GateToolPreparationRequestV1,
|
|
53
|
+
plan: GateToolPreparationPlanV1,
|
|
54
|
+
read: DeliveryArtifactReader,
|
|
55
|
+
): Promise<void> {
|
|
56
|
+
strictData(request);
|
|
57
|
+
strictData(plan);
|
|
58
|
+
if ((request.scheme ?? "evm") !== "evm" || plan.scheme !== "evm")
|
|
59
|
+
throw new Error("Delivery preparation requires EVM");
|
|
60
|
+
if (request.kind === "create2-deploy") {
|
|
61
|
+
validateTransactionValue(request.create2ForwardValue ?? "0");
|
|
62
|
+
validateTransactionValue(request.callForwardValue ?? "0");
|
|
63
|
+
validateTransactionValue(
|
|
64
|
+
(
|
|
65
|
+
BigInt(request.create2ForwardValue ?? "0") +
|
|
66
|
+
BigInt(request.callForwardValue ?? "0")
|
|
67
|
+
).toString(),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const artifact = deliveryArtifact(await read(request.contract));
|
|
71
|
+
if (
|
|
72
|
+
canonicalJson(artifactIdentity(artifact, "evm")) !==
|
|
73
|
+
canonicalJson(plan.artifact)
|
|
74
|
+
)
|
|
75
|
+
throw new Error("Actual artifact identity differs from preparation");
|
|
76
|
+
const deployments: GateToolDeploymentPlan[] = [],
|
|
77
|
+
transactions: GateToolPreparationPlanV1["transactions"] = [];
|
|
78
|
+
const role = (
|
|
79
|
+
name: GateToolDeploymentPlan["role"],
|
|
80
|
+
a: GateToolArtifact,
|
|
81
|
+
args: unknown[],
|
|
82
|
+
salt: string,
|
|
83
|
+
policy?: GateToolAddressPolicy,
|
|
84
|
+
): string => {
|
|
85
|
+
if (a.bytecode === '0x') throw new Error('Deployment requires non-empty EVM bytecode');
|
|
86
|
+
validateAbiArguments(a.abi, null, args);
|
|
87
|
+
const constructorInput = new Interface(a.abi)
|
|
88
|
+
.encodeDeploy(args)
|
|
89
|
+
.toLowerCase(),
|
|
90
|
+
initCode = concat([a.bytecode, constructorInput]);
|
|
91
|
+
const hash = canonicalCreate2Hashes({ scheme: "evm", artifact: a, args });
|
|
92
|
+
if (hash.scheme !== "evm") throw new Error("Invalid CREATE2 scheme");
|
|
93
|
+
const address = getCreate2Address(
|
|
94
|
+
request.factory,
|
|
95
|
+
salt,
|
|
96
|
+
hash.initCodeHash,
|
|
97
|
+
).toLowerCase();
|
|
98
|
+
if (
|
|
99
|
+
policy?.expectedAddress &&
|
|
100
|
+
policy.expectedAddress.toLowerCase() !== address
|
|
101
|
+
)
|
|
102
|
+
throw new Error("Actual CREATE2 address differs from expectedAddress");
|
|
103
|
+
if (
|
|
104
|
+
policy?.leadingZeroBytes !== undefined &&
|
|
105
|
+
(!Number.isSafeInteger(policy.leadingZeroBytes) ||
|
|
106
|
+
policy.leadingZeroBytes < 0 ||
|
|
107
|
+
policy.leadingZeroBytes > 20 ||
|
|
108
|
+
!address.slice(2).startsWith("00".repeat(policy.leadingZeroBytes)))
|
|
109
|
+
)
|
|
110
|
+
throw new Error("Actual CREATE2 address violates leadingZeroBytes");
|
|
111
|
+
const matches = plan.deployments.filter((d) => d.role === name);
|
|
112
|
+
if (matches.length !== 1) throw new Error("Actual CREATE2 roles differ");
|
|
113
|
+
const expected = {
|
|
114
|
+
role: name,
|
|
115
|
+
address,
|
|
116
|
+
salt: salt.toLowerCase(),
|
|
117
|
+
status: matches[0].status,
|
|
118
|
+
constructorInput,
|
|
119
|
+
initCodeHash: hash.initCodeHash,
|
|
120
|
+
};
|
|
121
|
+
if (canonicalJson(expected) !== canonicalJson(matches[0]))
|
|
122
|
+
throw new Error("Actual CREATE2 deployment differs from preparation");
|
|
123
|
+
deployments.push(expected);
|
|
124
|
+
if (expected.status === "required") {
|
|
125
|
+
const forward =
|
|
126
|
+
request.kind === "create2-deploy"
|
|
127
|
+
? (request.create2ForwardValue ?? "0")
|
|
128
|
+
: "0",
|
|
129
|
+
callForward =
|
|
130
|
+
request.kind === "create2-deploy"
|
|
131
|
+
? (request.callForwardValue ?? "0")
|
|
132
|
+
: "0";
|
|
133
|
+
validateTransactionValue(forward);
|
|
134
|
+
validateTransactionValue(callForward);
|
|
135
|
+
validateTransactionValue(
|
|
136
|
+
(BigInt(forward) + BigInt(callForward)).toString(),
|
|
137
|
+
);
|
|
138
|
+
const purpose =
|
|
139
|
+
name === "contract"
|
|
140
|
+
? "deploy-contract"
|
|
141
|
+
: name === "implementation"
|
|
142
|
+
? "deploy-implementation"
|
|
143
|
+
: "deploy-proxy";
|
|
144
|
+
transactions.push({
|
|
145
|
+
id: purpose,
|
|
146
|
+
purpose,
|
|
147
|
+
to: request.factory.toLowerCase(),
|
|
148
|
+
operation: 0,
|
|
149
|
+
value: (BigInt(forward) + BigInt(callForward)).toString(),
|
|
150
|
+
data: factoryInterface
|
|
151
|
+
.encodeFunctionData("deploy", [
|
|
152
|
+
salt,
|
|
153
|
+
initCode,
|
|
154
|
+
"0x",
|
|
155
|
+
forward,
|
|
156
|
+
callForward,
|
|
157
|
+
])
|
|
158
|
+
.toLowerCase(),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return address;
|
|
162
|
+
};
|
|
163
|
+
if (request.kind === "create2-deploy")
|
|
164
|
+
role(
|
|
165
|
+
"contract",
|
|
166
|
+
artifact,
|
|
167
|
+
request.constructorArgs,
|
|
168
|
+
request.salt,
|
|
169
|
+
request.addressPolicy,
|
|
170
|
+
);
|
|
171
|
+
else {
|
|
172
|
+
const implementation = role(
|
|
173
|
+
"implementation",
|
|
174
|
+
artifact,
|
|
175
|
+
request.constructorArgs,
|
|
176
|
+
request.implementationSalt,
|
|
177
|
+
(request.kind === "uups-upgrade" || request.kind === "transparent-upgrade")
|
|
178
|
+
? request.implementationAddressPolicy
|
|
179
|
+
: undefined,
|
|
180
|
+
);
|
|
181
|
+
if(request.kind === 'transparent-deploy' || request.kind === 'transparent-upgrade'){
|
|
182
|
+
if(request.call)validateAbiArguments(artifact.abi,request.call.method,request.call.args);
|
|
183
|
+
const data=request.call?new Interface(artifact.abi).encodeFunctionData(request.call.method,request.call.args):'0x';
|
|
184
|
+
await read(PROXY_ADMIN_ARTIFACT);
|
|
185
|
+
const proxy=request.kind==='transparent-deploy'
|
|
186
|
+
?role('proxy',deliveryArtifact(await read(TRANSPARENT_PROXY_ARTIFACT)),[implementation,request.proxyAdminOwner,data],request.proxySalt,request.proxyAddressPolicy)
|
|
187
|
+
:request.proxy.toLowerCase();
|
|
188
|
+
const admin=transparentAdminAddress(proxy);
|
|
189
|
+
if(plan.proxyKind!=='transparent'||plan.proxyAdmin?.address!==admin||plan.proxyAdmin?.owner!==request.proxyAdminOwner.toLowerCase()
|
|
190
|
+
||(request.kind==='transparent-upgrade'&&request.proxyAdmin.toLowerCase()!==admin))throw Error('Actual Transparent admin identity differs from preparation');
|
|
191
|
+
if(request.kind==='transparent-upgrade')transactions.push({id:'upgrade-proxy',purpose:'upgrade-proxy',to:admin,value:'0',operation:0,
|
|
192
|
+
data:PROXY_ADMIN_INTERFACE.encodeFunctionData('upgradeAndCall',[proxy,implementation,data]).toLowerCase()});
|
|
193
|
+
if(request.kind==='transparent-deploy'&&deployments.find(d=>d.role==='proxy')?.status==='reused'&&deployments.some(d=>d.status==='required'))throw Error('Invalid actual Transparent reuse roles');
|
|
194
|
+
} else {
|
|
195
|
+
const proxy =
|
|
196
|
+
request.kind === "uups-placeholder-deploy"
|
|
197
|
+
? role(
|
|
198
|
+
"proxy",
|
|
199
|
+
deliveryArtifact(await read(ERC1967_PROXY)),
|
|
200
|
+
[request.placeholderImplementation, "0x"],
|
|
201
|
+
request.proxySalt,
|
|
202
|
+
request.proxyAddressPolicy,
|
|
203
|
+
)
|
|
204
|
+
: request.proxy.toLowerCase();
|
|
205
|
+
if (request.call)
|
|
206
|
+
validateAbiArguments(
|
|
207
|
+
artifact.abi,
|
|
208
|
+
request.call.method,
|
|
209
|
+
request.call.args,
|
|
210
|
+
);
|
|
211
|
+
const data = request.call
|
|
212
|
+
? new Interface(artifact.abi).encodeFunctionData(
|
|
213
|
+
request.call.method,
|
|
214
|
+
request.call.args,
|
|
215
|
+
)
|
|
216
|
+
: "0x";
|
|
217
|
+
if (
|
|
218
|
+
request.kind === "uups-upgrade" ||
|
|
219
|
+
deployments.find((d) => d.role === "proxy")?.status === "required"
|
|
220
|
+
)
|
|
221
|
+
transactions.push({
|
|
222
|
+
id: "upgrade-proxy",
|
|
223
|
+
purpose: "upgrade-proxy",
|
|
224
|
+
to: proxy,
|
|
225
|
+
operation: 0,
|
|
226
|
+
value: "0",
|
|
227
|
+
data: upgradeInterface
|
|
228
|
+
.encodeFunctionData("upgradeToAndCall", [implementation, data])
|
|
229
|
+
.toLowerCase(),
|
|
230
|
+
});
|
|
231
|
+
else if (deployments.some((d) => d.status === "required"))
|
|
232
|
+
throw new Error("Invalid actual UUPS reuse roles");
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (
|
|
236
|
+
canonicalJson(deployments) !== canonicalJson(plan.deployments) ||
|
|
237
|
+
canonicalJson(transactions) !== canonicalJson(plan.transactions)
|
|
238
|
+
)
|
|
239
|
+
throw new Error("Actual CREATE2 calldata or roles differ from preparation");
|
|
240
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Remove signing authority, retaining independent model/RPC API configuration. */
|
|
2
|
+
export function productionChildEnvironment(input:NodeJS.ProcessEnv):NodeJS.ProcessEnv {
|
|
3
|
+
const out={...input};
|
|
4
|
+
// Also discard the retired alias if it remains in a caller's environment; it is never a signer input.
|
|
5
|
+
for(const key of Object.keys(out))if(/(^|_)(PRIVATE_KEY|WALLET_CREDENTIAL|MNEMONIC|SEED_PHRASE)$/.test(key)||key==='CUSTODY_API_BASE_URL'||/^GATEFLOW_(OPERATOR_TOKEN|PRODUCTION_|MAC_SECURE_SIGNER_)/.test(key)||/^GATE_(CUSTODY|SIGNER)_/.test(key))delete out[key];
|
|
6
|
+
return out;
|
|
7
|
+
}
|