gate-evm-tools 1.0.31 → 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 +34 -20
- package/bin/cli.js +3 -0
- package/bin/delivery.cjs +8 -7
- 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/index.d.ts.map +1 -1
- package/dist/commands/plan/index.js +1 -1
- package/dist/commands/plan/index.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 +23 -4
- package/dist/core/preparation/evm.d.ts.map +1 -1
- package/dist/core/preparation/evm.js +19 -3
- package/dist/core/preparation/evm.js.map +1 -1
- package/dist/core/preparation/evmManifestSync.d.ts +5 -0
- package/dist/core/preparation/evmManifestSync.d.ts.map +1 -1
- package/dist/core/preparation/evmManifestSync.js +15 -7
- package/dist/core/preparation/evmManifestSync.js.map +1 -1
- package/dist/core/preparation/index.d.ts +2 -2
- package/dist/core/preparation/index.d.ts.map +1 -1
- package/dist/core/preparation/manifest.d.ts +2 -0
- package/dist/core/preparation/manifest.d.ts.map +1 -1
- package/dist/core/preparation/manifest.js +2 -2
- 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 +53 -11
- 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 +47 -5
- 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/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 +4 -0
- package/dist/index.js.map +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +5 -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 +4 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +2 -0
- package/dist/workflow/index.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 +25 -7
- package/dist-cjs/core/preparation/evm.js.map +1 -1
- package/dist-cjs/core/preparation/evmManifestSync.js +15 -7
- package/dist-cjs/core/preparation/evmManifestSync.js.map +1 -1
- package/dist-cjs/core/preparation/manifest.js +2 -2
- package/dist-cjs/core/preparation/manifest.js.map +1 -1
- package/dist-cjs/core/preparation/normalize.js +53 -11
- 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/deployment-evm/index.js +10 -0
- package/dist-cjs/deployment-evm/index.js.map +1 -0
- package/dist-cjs/sync/index.js +5 -0
- package/dist-cjs/sync/index.js.map +1 -1
- package/dist-cjs/workflow/index.js +11 -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/delivery/aggregate-bootstrap.js +3 -1
- package/dist-runtime/delivery/aggregate-bootstrap.js.map +1 -1
- package/dist-runtime/delivery/aggregate-channel.js +7 -3
- package/dist-runtime/delivery/aggregate-channel.js.map +1 -1
- 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 +13 -9
- package/dist-runtime/delivery/aggregate-source.js +11 -3
- package/dist-runtime/delivery/aggregate-source.js.map +1 -1
- package/dist-runtime/delivery/aggregate-worker.js +12 -4
- package/dist-runtime/delivery/aggregate-worker.js.map +1 -1
- package/dist-runtime/delivery/aggregate.js +2 -2
- package/dist-runtime/delivery/aggregate.js.map +1 -1
- 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/codec-pin.d.ts +2 -2
- package/dist-runtime/delivery/codec-pin.js +4 -4
- package/dist-runtime/delivery/codec-pin.js.map +1 -1
- package/dist-runtime/delivery/compiler-files.js +3 -1
- package/dist-runtime/delivery/compiler-files.js.map +1 -1
- package/dist-runtime/delivery/compiler-pins.js +1 -1
- package/dist-runtime/delivery/compiler.js +17 -16
- package/dist-runtime/delivery/compiler.js.map +1 -1
- package/dist-runtime/delivery/config.d.ts +1 -1
- package/dist-runtime/delivery/config.js +27 -2
- package/dist-runtime/delivery/config.js.map +1 -1
- package/dist-runtime/delivery/configuration-definition.d.ts +9 -0
- package/dist-runtime/delivery/configuration-definition.js +33 -6
- package/dist-runtime/delivery/configuration-definition.js.map +1 -1
- package/dist-runtime/delivery/configuration.js +7 -4
- package/dist-runtime/delivery/configuration.js.map +1 -1
- 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/custom-format.js +51 -24
- package/dist-runtime/delivery/custom-format.js.map +1 -1
- package/dist-runtime/delivery/development.d.ts +2 -1
- package/dist-runtime/delivery/development.js +21 -10
- package/dist-runtime/delivery/development.js.map +1 -1
- package/dist-runtime/delivery/eoa.d.ts +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/existing-code.js +14 -6
- package/dist-runtime/delivery/existing-code.js.map +1 -1
- package/dist-runtime/delivery/history-registration.d.ts +1 -1
- package/dist-runtime/delivery/inputs.js +22 -15
- package/dist-runtime/delivery/inputs.js.map +1 -1
- package/dist-runtime/delivery/journal.js +18 -10
- package/dist-runtime/delivery/journal.js.map +1 -1
- 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 +2 -0
- package/dist-runtime/delivery/parameters.js +22 -0
- package/dist-runtime/delivery/parameters.js.map +1 -1
- package/dist-runtime/delivery/planning.d.ts +4 -1
- package/dist-runtime/delivery/planning.js +19 -3
- package/dist-runtime/delivery/planning.js.map +1 -1
- package/dist-runtime/delivery/preparation.js +43 -23
- package/dist-runtime/delivery/preparation.js.map +1 -1
- package/dist-runtime/delivery/production-environment.js +2 -1
- package/dist-runtime/delivery/production-environment.js.map +1 -1
- package/dist-runtime/delivery/production-finalization.js +23 -9
- package/dist-runtime/delivery/production-finalization.js.map +1 -1
- 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 +129 -8
- package/dist-runtime/delivery/production.js +60 -11
- package/dist-runtime/delivery/production.js.map +1 -1
- package/dist-runtime/delivery/project-files.d.ts +3 -3
- package/dist-runtime/delivery/project-files.js +19 -14
- package/dist-runtime/delivery/project-files.js.map +1 -1
- 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 +3 -1
- package/dist-runtime/delivery/project.js +21 -8
- package/dist-runtime/delivery/project.js.map +1 -1
- 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/release-graph.d.ts +7 -3
- package/dist-runtime/delivery/release-graph.js +58 -25
- package/dist-runtime/delivery/release-graph.js.map +1 -1
- package/dist-runtime/delivery/release-history.d.ts +1 -1
- package/dist-runtime/delivery/release-history.js +86 -10
- package/dist-runtime/delivery/release-history.js.map +1 -1
- 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 +38 -14
- package/dist-runtime/delivery/release.js +81 -29
- package/dist-runtime/delivery/release.js.map +1 -1
- package/dist-runtime/delivery/safe.d.ts +1 -0
- package/dist-runtime/delivery/safe.js +13 -2
- package/dist-runtime/delivery/safe.js.map +1 -1
- package/dist-runtime/delivery/same-fork-baseline.d.ts +1 -1
- package/dist-runtime/delivery/same-fork-baseline.js +5 -4
- package/dist-runtime/delivery/same-fork-baseline.js.map +1 -1
- package/dist-runtime/delivery/setup.d.ts +1 -1
- package/dist-runtime/delivery/setup.js +21 -6
- package/dist-runtime/delivery/setup.js.map +1 -1
- package/dist-runtime/delivery/source.d.ts +1 -0
- package/dist-runtime/delivery/source.js +12 -10
- package/dist-runtime/delivery/source.js.map +1 -1
- 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.js +7 -2
- package/dist-runtime/delivery/validation.js.map +1 -1
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/vendor/plan-codec/index.cjs +97 -20
- package/dist-runtime/vendor/plan-codec/index.d.cts +6 -0
- package/dist-runtime/vendor/plan-codec/provenance.json +9 -8
- package/dist-runtime/workflow/lib/calls.js +1 -0
- package/dist-runtime/workflow/lib/calls.js.map +1 -1
- package/dist-runtime/workflow/lib/checkCodeRunner.js +7 -4
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -1
- package/dist-runtime/workflow/lib/context.d.ts +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +4 -26
- package/dist-runtime/workflow/lib/create2.js +2 -67
- 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/externalExecutionScanner.js +2 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -1
- package/dist-runtime/workflow/lib/gateTool.js +2 -2
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -1
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +3 -0
- package/dist-runtime/workflow/lib/gateToolSync.js +5 -0
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -1
- package/dist-runtime/workflow/lib/parameters.js +5 -0
- package/dist-runtime/workflow/lib/parameters.js.map +1 -1
- package/dist-runtime/workflow/lib/proxy.d.ts +1 -0
- package/dist-runtime/workflow/lib/proxy.js.map +1 -1
- package/dist-runtime/workflow/run.js +1 -3
- package/dist-runtime/workflow/run.js.map +1 -1
- package/dist-runtime/workflow/steps/deploy.js +53 -0
- package/dist-runtime/workflow/steps/deploy.js.map +1 -1
- package/dist-runtime/workflow/steps/upgrade.js +24 -10
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -1
- package/docs/compiler-qualification.md +8 -2
- package/docs/delivery-aggregate.md +2 -0
- package/docs/delivery-calldata.md +27 -0
- package/docs/delivery-development.md +6 -0
- package/docs/delivery-execution-store.md +1 -1
- package/docs/delivery-inputs.md +55 -6
- package/docs/delivery-parameters.md +1 -1
- package/docs/delivery-release.md +60 -6
- package/docs/delivery-safe.md +7 -4
- package/docs/delivery-setup.md +72 -20
- package/docs/delivery-source.md +8 -8
- 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/workflow-reference.md +12 -4
- package/docs/workflow-runtime.md +6 -0
- package/package.json +19 -5
- package/runtime/config/hardhatAdapters.ts +2 -1
- package/runtime/delivery/aggregate-bootstrap.ts +3 -1
- package/runtime/delivery/aggregate-channel.ts +6 -3
- package/runtime/delivery/aggregate-diagnostics.ts +63 -0
- package/runtime/delivery/aggregate-source.ts +6 -2
- package/runtime/delivery/aggregate-worker.ts +15 -5
- package/runtime/delivery/aggregate.ts +2 -2
- 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/codec-pin.ts +3 -3
- package/runtime/delivery/compiler-files.ts +3 -1
- package/runtime/delivery/compiler-pins.ts +1 -1
- package/runtime/delivery/compiler.ts +18 -17
- package/runtime/delivery/config.ts +25 -2
- package/runtime/delivery/configuration-definition.ts +34 -7
- package/runtime/delivery/configuration.ts +8 -5
- package/runtime/delivery/contract-source.ts +112 -0
- package/runtime/delivery/custom-format.ts +20 -5
- package/runtime/delivery/development.ts +13 -11
- package/runtime/delivery/execution-identity.ts +32 -0
- package/runtime/delivery/existing-code.ts +7 -6
- package/runtime/delivery/inputs.ts +18 -11
- package/runtime/delivery/journal.ts +14 -10
- package/runtime/delivery/parameter-defaults.ts +75 -0
- package/runtime/delivery/parameters.ts +18 -0
- package/runtime/delivery/planning.ts +19 -5
- package/runtime/delivery/preparation.ts +17 -1
- package/runtime/delivery/production-environment.ts +2 -1
- package/runtime/delivery/production-finalization.ts +19 -10
- package/runtime/delivery/production-intent.ts +14 -0
- package/runtime/delivery/production.ts +51 -11
- package/runtime/delivery/project-files.ts +16 -11
- package/runtime/delivery/project-rpc.ts +116 -0
- package/runtime/delivery/project.ts +19 -7
- package/runtime/delivery/public-calldata.ts +74 -0
- package/runtime/delivery/release-graph.ts +44 -14
- package/runtime/delivery/release-history.ts +66 -8
- package/runtime/delivery/release-inputs.ts +107 -0
- package/runtime/delivery/release.ts +56 -18
- package/runtime/delivery/safe.ts +14 -3
- package/runtime/delivery/same-fork-baseline.ts +5 -4
- package/runtime/delivery/setup.ts +20 -8
- package/runtime/delivery/source.ts +10 -10
- package/runtime/delivery/task-identity.ts +85 -0
- package/runtime/delivery/toolchain.ts +48 -0
- package/runtime/delivery/validation.ts +7 -2
- package/runtime/vendor/plan-codec/index.cjs +97 -20
- package/runtime/vendor/plan-codec/index.d.cts +6 -0
- package/runtime/vendor/plan-codec/provenance.json +9 -8
- package/runtime/workflow/lib/calls.ts +1 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +7 -3
- package/runtime/workflow/lib/context.ts +1 -0
- package/runtime/workflow/lib/create2.ts +7 -108
- package/runtime/workflow/lib/deploymentInfo.ts +8 -0
- package/runtime/workflow/lib/deploymentRecords.ts +3 -1
- package/runtime/workflow/lib/externalExecutionScanner.ts +2 -1
- package/runtime/workflow/lib/gateTool.ts +2 -2
- package/runtime/workflow/lib/gateToolSync.ts +8 -0
- package/runtime/workflow/lib/parameters.ts +4 -0
- package/runtime/workflow/lib/proxy.ts +1 -0
- package/runtime/workflow/run.ts +1 -2
- package/runtime/workflow/steps/deploy.ts +42 -0
- package/runtime/workflow/steps/upgrade.ts +19 -11
- package/bin/workflow.cjs +0 -19
|
@@ -657,6 +657,7 @@ const manifestIsCurrent = (input: {
|
|
|
657
657
|
proxyAddress: string;
|
|
658
658
|
implementationAddress: string;
|
|
659
659
|
storageLayoutHash: string;
|
|
660
|
+
proxyKind?: string;
|
|
660
661
|
}): boolean => {
|
|
661
662
|
const proxy = input.proxyAddress.toLowerCase();
|
|
662
663
|
const implementation = input.implementationAddress.toLowerCase();
|
|
@@ -669,6 +670,7 @@ const manifestIsCurrent = (input: {
|
|
|
669
670
|
isRecord(item)
|
|
670
671
|
&& typeof item.address === "string"
|
|
671
672
|
&& item.address.toLowerCase() === proxy
|
|
673
|
+
&& (input.proxyKind === undefined || item.kind === input.proxyKind)
|
|
672
674
|
));
|
|
673
675
|
}
|
|
674
676
|
if (isRecord(document.impls)) {
|
|
@@ -1114,7 +1116,7 @@ export const runCheckCode = async (
|
|
|
1114
1116
|
manifestFile: exactManifest.relative,
|
|
1115
1117
|
beforeHash,
|
|
1116
1118
|
};
|
|
1117
|
-
if (metadata?.proxyKind === "uups" && !implementationAddress) {
|
|
1119
|
+
if ((metadata?.proxyKind === "uups" || metadata?.proxyKind === "transparent") && !implementationAddress) {
|
|
1118
1120
|
entries.push({ ...base, syncStatus: "failed", afterHash: directoryHash(directory) });
|
|
1119
1121
|
continue;
|
|
1120
1122
|
}
|
|
@@ -1135,11 +1137,11 @@ export const runCheckCode = async (
|
|
|
1135
1137
|
}
|
|
1136
1138
|
continue;
|
|
1137
1139
|
}
|
|
1138
|
-
if (!implementationAddress || metadata?.proxyKind && metadata.proxyKind !== "uups") {
|
|
1140
|
+
if (!implementationAddress || metadata?.proxyKind && metadata.proxyKind !== "uups" && metadata.proxyKind !== "transparent") {
|
|
1139
1141
|
entries.push({ ...base, syncStatus: "not_required", afterHash: directoryHash(directory) });
|
|
1140
1142
|
continue;
|
|
1141
1143
|
}
|
|
1142
|
-
if (!metadata || metadata.proxyKind !== "uups") {
|
|
1144
|
+
if (!metadata || (metadata.proxyKind !== "uups" && metadata.proxyKind !== "transparent")) {
|
|
1143
1145
|
entries.push({ ...base, syncStatus: "proxy_kind_unknown", afterHash: directoryHash(directory) });
|
|
1144
1146
|
continue;
|
|
1145
1147
|
}
|
|
@@ -1159,6 +1161,7 @@ export const runCheckCode = async (
|
|
|
1159
1161
|
proxyAddress: selected.address,
|
|
1160
1162
|
implementationAddress,
|
|
1161
1163
|
storageLayoutHash,
|
|
1164
|
+
proxyKind:metadata.proxyKind,
|
|
1162
1165
|
})) {
|
|
1163
1166
|
entries.push({ ...base, syncStatus: "already_current", afterHash: beforeHash });
|
|
1164
1167
|
continue;
|
|
@@ -1178,6 +1181,7 @@ export const runCheckCode = async (
|
|
|
1178
1181
|
"--target",
|
|
1179
1182
|
selected.network,
|
|
1180
1183
|
"--skip-tx-hash",
|
|
1184
|
+
...(metadata.proxyKind === "transparent" ? ["--proxy-kind","transparent","--proxy-admin-address",metadata.proxyAdminAddress??"","--proxy-admin-owner",metadata.proxyAdminOwner??""] : []),
|
|
1181
1185
|
], {
|
|
1182
1186
|
network: selected.network,
|
|
1183
1187
|
scheme,
|
|
@@ -67,6 +67,7 @@ export interface WorkflowContext {
|
|
|
67
67
|
validation?: WorkflowValidationPort;
|
|
68
68
|
pendingUupsReuse?: PendingUupsResolverPort;
|
|
69
69
|
verification?: VerificationSink;
|
|
70
|
+
calldataReview?: import('../../delivery/calldata-review').CalldataReviewSink;
|
|
70
71
|
deploymentRecorder?: DeploymentRecorder;
|
|
71
72
|
executionPlanner?: TransactionPlannerPort;
|
|
72
73
|
externalCalls: ExternalCall[];
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { resolveWorkflowValue, type Create2FieldKind } from './validation';
|
|
2
2
|
import type { Signer } from "ethers";
|
|
3
|
-
import { getAddress,
|
|
3
|
+
import { getAddress, isAddress } from "ethers";
|
|
4
4
|
import { WorkflowStep } from "./parameters";
|
|
5
5
|
import type { WorkflowContext } from "./context";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export type Create2Scheme = "evm" | "zksync-eravm";
|
|
13
|
-
|
|
7
|
+
import { prepareControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
8
|
+
import type { PreparedWorkflowTransaction, PreparedControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
9
|
+
export { prepareControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
10
|
+
export type { PreparedWorkflowTransaction, PreparedControlledMulticallTransaction, ControlledMulticallInnerCall } from 'gate-evm-tools/workflow';
|
|
11
|
+
export type Create2Scheme = 'evm' | 'zksync-eravm';
|
|
14
12
|
export interface Create2Options {
|
|
15
13
|
scheme: Create2Scheme;
|
|
16
14
|
factory: string;
|
|
@@ -23,106 +21,7 @@ export interface Create2Options {
|
|
|
23
21
|
uupsPlaceholderImplementation?: string;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
target: string;
|
|
28
|
-
value: string;
|
|
29
|
-
data: string;
|
|
30
|
-
operation: 0;
|
|
31
|
-
scheme?: "zksync-eravm";
|
|
32
|
-
factoryDeps?: string[];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ControlledMulticallInnerCall {
|
|
36
|
-
target: string;
|
|
37
|
-
value: string;
|
|
38
|
-
data: string;
|
|
39
|
-
factoryDeps?: string[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface PreparedControlledMulticallTransaction
|
|
43
|
-
extends PreparedWorkflowTransaction {
|
|
44
|
-
method: "aggregate3" | "aggregate3Value";
|
|
45
|
-
calls: Array<{
|
|
46
|
-
target: string;
|
|
47
|
-
allowFailure: false;
|
|
48
|
-
value: string;
|
|
49
|
-
callData: string;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface SentTransaction {
|
|
54
|
-
hash: string;
|
|
55
|
-
wait: () => Promise<unknown>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const bigintValue = (value: string | undefined): bigint => {
|
|
59
|
-
if (!value || value === "0") return 0n;
|
|
60
|
-
const parsed = BigInt(value);
|
|
61
|
-
if (parsed < 0n) throw new Error("transaction value must be nonnegative");
|
|
62
|
-
return parsed;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const normalizeFactoryDeps = (
|
|
66
|
-
input: string[],
|
|
67
|
-
label: string,
|
|
68
|
-
): string[] => {
|
|
69
|
-
const seen = new Set<string>();
|
|
70
|
-
const output: string[] = [];
|
|
71
|
-
for (const [index, dependency] of input.entries()) {
|
|
72
|
-
if (!/^0x(?:[0-9a-fA-F]{2})+$/.test(dependency)) {
|
|
73
|
-
throw new Error(`${label}[${index}] must be non-empty byte-aligned bytecode`);
|
|
74
|
-
}
|
|
75
|
-
const normalized = dependency.toLowerCase();
|
|
76
|
-
if (seen.has(normalized)) continue;
|
|
77
|
-
seen.add(normalized);
|
|
78
|
-
output.push(normalized);
|
|
79
|
-
}
|
|
80
|
-
return output;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const prepareControlledMulticallTransaction = (
|
|
84
|
-
controlledMulticall: string,
|
|
85
|
-
inputCalls: ControlledMulticallInnerCall[],
|
|
86
|
-
scheme: Create2Scheme = "evm",
|
|
87
|
-
): PreparedControlledMulticallTransaction => {
|
|
88
|
-
if (!isAddress(controlledMulticall)) {
|
|
89
|
-
throw new Error("controlledMulticall must be an EVM address");
|
|
90
|
-
}
|
|
91
|
-
if (inputCalls.length === 0) {
|
|
92
|
-
throw new Error("controlled multicall requires at least one inner call");
|
|
93
|
-
}
|
|
94
|
-
if (scheme === "evm" && inputCalls.some((call) => call.factoryDeps !== undefined)) {
|
|
95
|
-
throw new Error("factoryDeps are only supported for zkSync transactions");
|
|
96
|
-
}
|
|
97
|
-
if (scheme === "zksync-eravm" && inputCalls.some((call) => call.factoryDeps === undefined)) {
|
|
98
|
-
throw new Error("every zkSync GateTool call must include factoryDeps");
|
|
99
|
-
}
|
|
100
|
-
const calls = inputCalls.map((call) => ({
|
|
101
|
-
target: getAddress(call.target),
|
|
102
|
-
allowFailure: false as const,
|
|
103
|
-
value: bigintValue(call.value).toString(10),
|
|
104
|
-
callData: call.data,
|
|
105
|
-
}));
|
|
106
|
-
const totalValue = calls.reduce((sum, call) => sum + BigInt(call.value), 0n);
|
|
107
|
-
const method = totalValue === 0n ? "aggregate3" as const : "aggregate3Value" as const;
|
|
108
|
-
const encodedCalls = method === "aggregate3"
|
|
109
|
-
? calls.map(({ value: _value, ...call }) => call)
|
|
110
|
-
: calls;
|
|
111
|
-
const factoryDeps = scheme === "zksync-eravm"
|
|
112
|
-
? normalizeFactoryDeps(inputCalls.flatMap((call) => call.factoryDeps!), "factoryDeps")
|
|
113
|
-
: undefined;
|
|
114
|
-
return {
|
|
115
|
-
target: getAddress(controlledMulticall),
|
|
116
|
-
value: totalValue.toString(10),
|
|
117
|
-
data: CONTROLLED_MULTICALL_INTERFACE.encodeFunctionData(method, [encodedCalls]),
|
|
118
|
-
operation: 0,
|
|
119
|
-
method,
|
|
120
|
-
calls,
|
|
121
|
-
...(scheme === "zksync-eravm"
|
|
122
|
-
? { scheme: "zksync-eravm" as const, factoryDeps: factoryDeps! }
|
|
123
|
-
: {}),
|
|
124
|
-
};
|
|
125
|
-
};
|
|
24
|
+
interface SentTransaction { hash:string; wait:()=>Promise<unknown>; }
|
|
126
25
|
|
|
127
26
|
export const sendPreparedWorkflowTransaction = async (
|
|
128
27
|
prepared: PreparedWorkflowTransaction,
|
|
@@ -11,6 +11,8 @@ export interface DeploymentInfoEntry {
|
|
|
11
11
|
actualContract: string;
|
|
12
12
|
proxyKind?: "uups" | "transparent";
|
|
13
13
|
implementationAddress?: string;
|
|
14
|
+
proxyAdminAddress?: string;
|
|
15
|
+
proxyAdminOwner?: string;
|
|
14
16
|
source: DeploymentInfoSource;
|
|
15
17
|
updatedAt: string;
|
|
16
18
|
}
|
|
@@ -114,6 +116,8 @@ const validateEntry = (value: unknown, label: string): DeploymentInfoEntry => {
|
|
|
114
116
|
"actualContract",
|
|
115
117
|
"proxyKind",
|
|
116
118
|
"implementationAddress",
|
|
119
|
+
"proxyAdminAddress",
|
|
120
|
+
"proxyAdminOwner",
|
|
117
121
|
"source",
|
|
118
122
|
"updatedAt",
|
|
119
123
|
]);
|
|
@@ -140,6 +144,8 @@ const validateEntry = (value: unknown, label: string): DeploymentInfoEntry => {
|
|
|
140
144
|
...(value.implementationAddress
|
|
141
145
|
? { implementationAddress: address(value.implementationAddress, `${label}.implementationAddress`) }
|
|
142
146
|
: {}),
|
|
147
|
+
...(value.proxyAdminAddress?{proxyAdminAddress:address(value.proxyAdminAddress,`${label}.proxyAdminAddress`)}:{}),
|
|
148
|
+
...(value.proxyAdminOwner?{proxyAdminOwner:address(value.proxyAdminOwner,`${label}.proxyAdminOwner`)}:{}),
|
|
143
149
|
source: validateSource(value.source, `${label}.source`),
|
|
144
150
|
updatedAt: value.updatedAt,
|
|
145
151
|
};
|
|
@@ -243,6 +249,7 @@ export function prepareDeploymentInfoFromRecords(input: {
|
|
|
243
249
|
actualContract,
|
|
244
250
|
...(proxyKind ? { proxyKind } : {}),
|
|
245
251
|
...(implementationAddress ? { implementationAddress } : {}),
|
|
252
|
+
...(proxyKind === "transparent" ? {proxyAdminAddress:optionalAddress(rawChange.proxyAdminAddress??existing?.proxyAdminAddress,"ProxyAdmin address"),proxyAdminOwner:optionalAddress(rawChange.proxyAdminOwner??existing?.proxyAdminOwner,"ProxyAdmin owner")}:{}),
|
|
246
253
|
source: {
|
|
247
254
|
kind: "deployment" as const,
|
|
248
255
|
deploymentId,
|
|
@@ -259,6 +266,7 @@ export function prepareDeploymentInfoFromRecords(input: {
|
|
|
259
266
|
...(existing.implementationAddress
|
|
260
267
|
? { implementationAddress: existing.implementationAddress }
|
|
261
268
|
: {}),
|
|
269
|
+
...(existing.proxyKind === "transparent" ? {proxyAdminAddress:existing.proxyAdminAddress,proxyAdminOwner:existing.proxyAdminOwner}:{}),
|
|
262
270
|
source: existing.source,
|
|
263
271
|
}
|
|
264
272
|
: undefined;
|
|
@@ -63,6 +63,8 @@ export interface DeploymentChange {
|
|
|
63
63
|
proxyKind?: string;
|
|
64
64
|
address?: string;
|
|
65
65
|
proxyAddress?: string;
|
|
66
|
+
proxyAdminAddress?: string;
|
|
67
|
+
proxyAdminOwner?: string;
|
|
66
68
|
implementationAddress?: string;
|
|
67
69
|
preparedImplementationAddress?: string;
|
|
68
70
|
placeholderImplementationAddress?: string;
|
|
@@ -272,7 +274,7 @@ export class DeploymentRecorder {
|
|
|
272
274
|
throw new Error("Deployment proxy transactionId is invalid");
|
|
273
275
|
}
|
|
274
276
|
const change = this.record.changes.find((entry) => entry.stepId === stepId);
|
|
275
|
-
if (!change || change.proxyKind !== "uups") {
|
|
277
|
+
if (!change || (change.proxyKind !== "uups" && change.proxyKind !== "transparent")) {
|
|
276
278
|
throw new Error(`Cannot bind a proxy transaction for deployment change ${stepId}`);
|
|
277
279
|
}
|
|
278
280
|
if (
|
|
@@ -790,7 +790,7 @@ export const reconcileExternalExecution = async (input: {
|
|
|
790
790
|
orderedMatches.map((match) => [match.transactionId, match]),
|
|
791
791
|
);
|
|
792
792
|
for (const change of deployment.changes) {
|
|
793
|
-
if (change.proxyKind !== "uups") continue;
|
|
793
|
+
if (change.proxyKind !== "uups" && change.proxyKind !== "transparent") continue;
|
|
794
794
|
if (
|
|
795
795
|
!change.proxyAddress
|
|
796
796
|
|| !change.implementationAddress
|
|
@@ -846,6 +846,7 @@ export const reconcileExternalExecution = async (input: {
|
|
|
846
846
|
target: input.network,
|
|
847
847
|
manifestDir: target.openzeppelin.manifestDir,
|
|
848
848
|
proxy: change.proxyAddress,
|
|
849
|
+
...(change.proxyKind === 'transparent'?{proxyKind:'transparent' as const,proxyAdminAddress:change.proxyAdminAddress,proxyAdminOwner:change.proxyAdminOwner}:{}),
|
|
849
850
|
implementation: change.implementationAddress,
|
|
850
851
|
contract: change.actualContract,
|
|
851
852
|
constructorArgs: change.constructorArgs,
|
|
@@ -162,7 +162,7 @@ export const expectedTransactionPurposes = (
|
|
|
162
162
|
if (plan.kind === "create2-deploy") {
|
|
163
163
|
return requiredRoles.has("contract") ? ["deploy-contract"] : [];
|
|
164
164
|
}
|
|
165
|
-
if (plan.kind === "uups-placeholder-deploy") {
|
|
165
|
+
if (plan.kind === "uups-placeholder-deploy" || plan.kind === "transparent-deploy") {
|
|
166
166
|
if (!requiredRoles.has("proxy")) {
|
|
167
167
|
if (requiredRoles.has("implementation")) {
|
|
168
168
|
throw new Error(
|
|
@@ -174,7 +174,7 @@ export const expectedTransactionPurposes = (
|
|
|
174
174
|
return [
|
|
175
175
|
...(requiredRoles.has("implementation") ? ["deploy-implementation" as const] : []),
|
|
176
176
|
"deploy-proxy",
|
|
177
|
-
"upgrade-proxy",
|
|
177
|
+
...(plan.kind === "uups-placeholder-deploy" ? ["upgrade-proxy" as const] : []),
|
|
178
178
|
];
|
|
179
179
|
}
|
|
180
180
|
return [
|
|
@@ -20,6 +20,9 @@ export interface SyncGateToolUupsOptions {
|
|
|
20
20
|
target: string;
|
|
21
21
|
manifestDir: string;
|
|
22
22
|
proxy: string;
|
|
23
|
+
proxyKind?: "uups" | "transparent";
|
|
24
|
+
proxyAdminAddress?: string;
|
|
25
|
+
proxyAdminOwner?: string;
|
|
23
26
|
implementation: string;
|
|
24
27
|
contract: string;
|
|
25
28
|
constructorArgs: unknown[];
|
|
@@ -163,6 +166,9 @@ const validateEvidenceIdentity = (
|
|
|
163
166
|
|| raw.scheme !== options.scheme
|
|
164
167
|
|| raw.network !== options.network
|
|
165
168
|
|| raw.target !== options.target
|
|
169
|
+
|| raw.proxyKind !== options.proxyKind
|
|
170
|
+
|| raw.proxyAdminAddress !== options.proxyAdminAddress
|
|
171
|
+
|| raw.proxyAdminOwner !== options.proxyAdminOwner
|
|
166
172
|
|| raw.manifestDir !== options.manifestDir
|
|
167
173
|
|| raw.contract !== options.contract
|
|
168
174
|
|| JSON.stringify(raw.constructorArgs) !== JSON.stringify(options.constructorArgs)
|
|
@@ -239,6 +245,7 @@ const buildSyncEvidence = (
|
|
|
239
245
|
network: options.network,
|
|
240
246
|
target: options.target,
|
|
241
247
|
manifestDir: options.manifestDir,
|
|
248
|
+
...(options.proxyKind?{proxyKind:options.proxyKind,proxyAdminAddress:options.proxyAdminAddress,proxyAdminOwner:options.proxyAdminOwner}:{}),
|
|
242
249
|
proxy: options.proxy.toLowerCase(),
|
|
243
250
|
implementation: options.implementation.toLowerCase(),
|
|
244
251
|
contract: options.contract,
|
|
@@ -335,6 +342,7 @@ export const syncGateToolUups = async (
|
|
|
335
342
|
network: options.network,
|
|
336
343
|
target: options.target,
|
|
337
344
|
proxy: options.proxy,
|
|
345
|
+
...(options.proxyKind?{proxyKind:options.proxyKind,proxyAdminAddress:options.proxyAdminAddress,proxyAdminOwner:options.proxyAdminOwner}:{}),
|
|
338
346
|
contract: options.contract,
|
|
339
347
|
constructorArgs: options.constructorArgs,
|
|
340
348
|
...(options.scheme === "evm"
|
|
@@ -246,6 +246,10 @@ export const validateDeployCreate2Strategy = (steps: WorkflowStep[]): void => {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
if (step.proxy !== undefined) {
|
|
249
|
+
if(asObject(step.proxy).kind === "transparent") {
|
|
250
|
+
if(step.upgradeableStrategy!=="transparent-proxy"||step.firstUpgrade!==undefined)throw new Error(`Deploy step ${step.id} requires transparent-proxy strategy without firstUpgrade`);
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
249
253
|
if (step.upgradeableStrategy !== "uups-placeholder-proxy") {
|
|
250
254
|
throw new Error(`Deploy step ${step.id} requires upgradeableStrategy: uups-placeholder-proxy`);
|
|
251
255
|
}
|
package/runtime/workflow/run.ts
CHANGED
|
@@ -130,11 +130,10 @@ const parseEnvArgs = (): Record<string, string | boolean> => {
|
|
|
130
130
|
const assertWalletCredentialForExecution = (mode: WorkflowMode, targetId: string): void => {
|
|
131
131
|
if (mode !== "execute") return;
|
|
132
132
|
if (targetId === "hardhat" || targetId === "localhost") return;
|
|
133
|
-
if (process.env.WALLET_CREDENTIAL?.trim()) return;
|
|
134
133
|
if (process.env.PRIVATE_KEY?.trim()) return;
|
|
135
134
|
|
|
136
135
|
throw new Error(
|
|
137
|
-
`Missing
|
|
136
|
+
`Missing PRIVATE_KEY in project .env or process env. Execute mode on "${targetId}" requires a deployment signer.`,
|
|
138
137
|
);
|
|
139
138
|
};
|
|
140
139
|
|
|
@@ -2,6 +2,7 @@ import { resolveWorkflowValue } from '../lib/validation';
|
|
|
2
2
|
import { recordPreparedDeployment } from "../lib/preparationEvidence";
|
|
3
3
|
import { CONTROLLED_MULTICALL_AUTHORITY_ABI } from "../lib/controlledMulticallAbi";
|
|
4
4
|
import path from "path";
|
|
5
|
+
import {verifyTransparentAdmin, transparentAdminAddress} from "gate-evm-tools/workflow";
|
|
5
6
|
import type {
|
|
6
7
|
GateToolDeploymentPlan,
|
|
7
8
|
GateToolPreparationPlanV1,
|
|
@@ -79,6 +80,7 @@ const resolveProxyOptions = (
|
|
|
79
80
|
options: {
|
|
80
81
|
kind: typeof proxy.kind === "string" ? proxy.kind : undefined,
|
|
81
82
|
initializer,
|
|
83
|
+
adminOwner: typeof proxy.adminOwner === "string" ? proxy.adminOwner : undefined,
|
|
82
84
|
unsafeAllow: Array.isArray(proxy.unsafeAllow)
|
|
83
85
|
? proxy.unsafeAllow.map((item) => String(item))
|
|
84
86
|
: undefined,
|
|
@@ -401,6 +403,46 @@ export const runDeployStep = async (
|
|
|
401
403
|
throw new Error(`Deploy step ${step.id} requires an execution deployment recorder`);
|
|
402
404
|
}
|
|
403
405
|
|
|
406
|
+
if (proxy?.options.kind === 'transparent') {
|
|
407
|
+
if(create2Options.scheme!=='evm'||step.upgradeableStrategy!=='transparent-proxy'||step.firstUpgrade!==undefined)throw Error('Transparent deployment requires EVM transparent-proxy strategy');
|
|
408
|
+
const adminOwner=proxy.options.adminOwner;
|
|
409
|
+
if(!adminOwner)throw Error('Transparent deployment requires explicit proxy.adminOwner');
|
|
410
|
+
if(proxy.options.initializer===undefined)throw Error('Transparent deployment requires explicit initializer method or false');
|
|
411
|
+
const actualContract=actualContractName(contractName),registryKey=contractInfoKey(saveAs,contractName);
|
|
412
|
+
const initialChange:DeploymentChange={stepId:step.id,kind:'deploy',instanceId:saveAs,actualContract,contractInfoKey:registryKey,strategy:'create2',proxyKind:'transparent',factory:create2Options.factory,multicall:create2Options.controlledMulticall,salt:create2Options.salt};
|
|
413
|
+
const existing=await applyExistingDeploymentPolicy(context,step,saveAs,initialChange,create2Options,true);
|
|
414
|
+
if(existing.completed){await verifyTransparentAdmin({hre:context.runtime.hre as any,proxy:existing.existingAddress!,admin:transparentAdminAddress(existing.existingAddress!),owner:adminOwner});return;}
|
|
415
|
+
const effective=existing.create2Options,implementationSalt=deriveImplementationSalt(context.bindings?.derivationSeed??context.executionId,contractName,effective.salt);
|
|
416
|
+
const request:GateToolPreparationRequestV1={version:1,kind:'transparent-deploy',scheme:'evm',network:context.runtime.hre.network.name,target:context.targetId,contract:contractName,
|
|
417
|
+
constructorArgs:proxy.options.constructorArgs??[],factory:effective.factory,proxyKind:'transparent',implementationSalt,proxySalt:effective.salt,proxyAdminOwner:adminOwner,
|
|
418
|
+
...(proxy.options.unsafeAllow?{unsafeAllow:proxy.options.unsafeAllow}:{}),...(addressPolicy(effective)?{proxyAddressPolicy:addressPolicy(effective)}:{}),
|
|
419
|
+
...(proxy.options.initializer===false?{}:{call:{method:proxy.options.initializer,args:resolveArray(context,step.args??[],`Step ${step.id} args`)}})};
|
|
420
|
+
const prepared=await prepareGateToolWorkflow({hre:context.runtime.hre,validation:context.validation,root:context.root,evidenceDir:gateToolEvidenceDir(context),evidenceName:step.id,request,
|
|
421
|
+
expected:context.preparations?.expected(step.id,request),readBlockTag:context.mode==='simulate'?context.simulation.snapshot?.blockNumber:undefined});
|
|
422
|
+
const implementation=deploymentForRole(prepared.plan,'implementation'),deployed=deploymentForRole(prepared.plan,'proxy'),admin=prepared.plan.proxyAdmin!;
|
|
423
|
+
if(existing.existingAddress?.toLowerCase()===deployed.address.toLowerCase())throw Error('Transparent redeploy predicted the existing address');
|
|
424
|
+
const change:DeploymentChange={...initialChange,salt:effective.salt,predictedAddress:deployed.address,implementationAddress:implementation.address,implementationSalt,
|
|
425
|
+
proxyAdminAddress:admin.address,proxyAdminOwner:admin.owner,constructorArgs:request.constructorArgs,gateTool:gateToolChange(context,prepared.planPath,prepared.plan),
|
|
426
|
+
...(existing.existingAddress?{previousAddress:existing.existingAddress}:{}),...(existing.redeployReason?{redeployReason:existing.redeployReason}:{})};
|
|
427
|
+
context.bindings?.recordOrAssertDerivedValue(`${step.id}.implementation`,implementationSalt);recorder?.prepare(change);
|
|
428
|
+
recordPreparedDeployment(context,change,prepared,[`${step.id}.implementation`]);
|
|
429
|
+
if(context.mode==='execute')recorder?.stageAddressCandidate(change,deployed.address);
|
|
430
|
+
const execution=await runGateToolControlledMulticall(context,step,effective,prepared.plan.transactions);
|
|
431
|
+
if(context.mode==='execute'&&execution.transactionId)recorder?.bindProxyTransaction(step.id,execution.transactionId);
|
|
432
|
+
if(!execution.external){
|
|
433
|
+
await verifyTransparentAdmin({hre:context.runtime.hre as any,proxy:deployed.address,admin:admin.address,owner:admin.owner});
|
|
434
|
+
if((await getERC1967Implementation(context.runtime.hre.ethers.provider,deployed.address))?.toLowerCase()!==implementation.address.toLowerCase())throw Error('Transparent implementation mismatch');
|
|
435
|
+
}
|
|
436
|
+
const gateToolSync=context.mode==='execute'&&!execution.external&&deployed.status!=='reused'?await syncGateToolUups({hre:context.runtime.hre,root:context.root,evidenceDir:gateToolEvidenceDir(context),evidenceName:step.id,
|
|
437
|
+
scheme:'evm',network:context.runtime.hre.network.name,target:context.targetId,manifestDir:context.target.openzeppelin.manifestDir,proxy:deployed.address,implementation:implementation.address,
|
|
438
|
+
contract:actualContract,constructorArgs:request.constructorArgs,transactionHash:execution.txHash??'',proxyKind:'transparent',proxyAdminAddress:admin.address,proxyAdminOwner:admin.owner}):undefined;
|
|
439
|
+
if(context.mode==='execute'&&!execution.external)recorder?.applyAddress({...change,address:deployed.address,proxyAddress:deployed.address,txHash:execution.txHash,gateToolSync,reused:deployed.status==='reused'},deployed.address);
|
|
440
|
+
context.state.set(saveAs,{address:deployed.address,proxyAddress:deployed.address,implementationAddress:implementation.address,implementationSalt,proxyAdminAddress:admin.address,proxyAdminOwner:admin.owner,txHash:execution.txHash,external:execution.external});
|
|
441
|
+
context.reporter.result('execution',{stepId:step.id,kind:step.kind,mode:execution.external?'external':context.mode,contract:contractName,actualContract,saveAs,contractInfoKey:registryKey,strategy:'create2',scheme:'evm',proxy:'transparent',
|
|
442
|
+
address:deployed.address,implementationAddress:implementation.address,proxyAdminAddress:admin.address,proxyAdminOwner:admin.owner,transactionId:execution.transactionId,txHash:execution.txHash,gateToolPlan:change.gateTool!.outputPath});
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
|
|
404
446
|
if (proxy) {
|
|
405
447
|
const firstUpgrade = resolveFirstUpgradeOptions(context, step);
|
|
406
448
|
if (step.upgradeableStrategy !== "uups-placeholder-proxy" || !firstUpgrade) {
|
|
@@ -2,6 +2,7 @@ import { resolveWorkflowValue } from '../lib/validation';
|
|
|
2
2
|
import { recordPreparedDeployment } from "../lib/preparationEvidence";
|
|
3
3
|
import { CONTROLLED_MULTICALL_AUTHORITY_ABI } from "../lib/controlledMulticallAbi";
|
|
4
4
|
import { isAddress } from "ethers";
|
|
5
|
+
import {transparentAdminAddress, verifyTransparentAdmin, PROXY_ADMIN_INTERFACE} from "gate-evm-tools/workflow";
|
|
5
6
|
import path from "path";
|
|
6
7
|
import type {
|
|
7
8
|
GateToolDeploymentPlan,
|
|
@@ -108,6 +109,7 @@ const proxyReference = (
|
|
|
108
109
|
proxy: {
|
|
109
110
|
kind: stringField(proxyObject, "kind")
|
|
110
111
|
|| (typeof step.proxyKind === "string" ? step.proxyKind : "uups"),
|
|
112
|
+
adminOwner: stringField(proxyObject, "adminOwner"),
|
|
111
113
|
initializer: proxyObject.initializer === false
|
|
112
114
|
? false
|
|
113
115
|
: stringField(proxyObject, "initializer"),
|
|
@@ -198,9 +200,9 @@ export const runUpgradeStep = async (
|
|
|
198
200
|
}
|
|
199
201
|
const contractName = String(step.contract);
|
|
200
202
|
const proxy = proxyReference(context, step);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
const transparent=proxy.proxy.kind === "transparent";
|
|
204
|
+
if (!transparent && (proxy.proxy.kind || "uups") !== "uups") throw new Error(`Upgrade step ${step.id} has unsupported proxy kind`);
|
|
205
|
+
if(transparent&&!proxy.proxy.adminOwner)throw Error("Transparent upgrade requires explicit proxy.adminOwner");
|
|
204
206
|
const sameFork = context.preparations?.assertUpgradeBaseline(proxy.proxyAddress) === true;
|
|
205
207
|
if (sameFork) {
|
|
206
208
|
if (context.mode !== 'simulate' || !context.validation?.sameForkUpgrade) throw new Error('Same-fork upgrade requires owned local-fork validation');
|
|
@@ -243,16 +245,16 @@ export const runUpgradeStep = async (
|
|
|
243
245
|
contractName,
|
|
244
246
|
proxy.proxyAddress,
|
|
245
247
|
);
|
|
248
|
+
if(transparent&&scheme!=="evm")throw Error("Transparent upgrade requires ordinary EVM");
|
|
246
249
|
const request: GateToolPreparationRequestV1 = {
|
|
247
250
|
version: 1,
|
|
248
|
-
kind: "uups-upgrade",
|
|
251
|
+
...(transparent?{kind:"transparent-upgrade" as const,proxyKind:"transparent" as const,proxyAdmin:transparentAdminAddress(proxy.proxyAddress),proxyAdminOwner:proxy.proxy.adminOwner!}:{kind:"uups-upgrade" as const,proxyKind:"uups" as const}),
|
|
249
252
|
scheme,
|
|
250
253
|
network: context.runtime.hre.network.name,
|
|
251
254
|
target: context.targetId,
|
|
252
255
|
contract: contractName,
|
|
253
256
|
constructorArgs,
|
|
254
257
|
factory,
|
|
255
|
-
proxyKind: "uups",
|
|
256
258
|
proxy: proxy.proxyAddress,
|
|
257
259
|
implementationSalt,
|
|
258
260
|
...(proxy.proxy.unsafeAllow ? { unsafeAllow: proxy.proxy.unsafeAllow } : {}),
|
|
@@ -291,7 +293,8 @@ export const runUpgradeStep = async (
|
|
|
291
293
|
actualContract,
|
|
292
294
|
contractInfoKey: proxy.contractInfoKey,
|
|
293
295
|
strategy: "gate-tool",
|
|
294
|
-
proxyKind: "uups",
|
|
296
|
+
proxyKind: transparent?"transparent":"uups",
|
|
297
|
+
...(transparent?{proxyAdminAddress:prepared.plan.proxyAdmin!.address,proxyAdminOwner:prepared.plan.proxyAdmin!.owner}:{}),
|
|
295
298
|
proxyAddress: proxy.proxyAddress,
|
|
296
299
|
implementationAddress: implementation.address,
|
|
297
300
|
implementationSalt,
|
|
@@ -312,13 +315,13 @@ export const runUpgradeStep = async (
|
|
|
312
315
|
recordPreparedDeployment(context, preparedChange, prepared, [`${step.id}.implementation`]);
|
|
313
316
|
|
|
314
317
|
const proxyContract = await context.runtime.hre.ethers.getContractAt(
|
|
315
|
-
String(step.abi || contractName),
|
|
316
|
-
proxy.proxyAddress,
|
|
318
|
+
transparent?[...PROXY_ADMIN_INTERFACE.fragments]:String(step.abi || contractName),
|
|
319
|
+
transparent?prepared.plan.proxyAdmin!.address:proxy.proxyAddress,
|
|
317
320
|
context.signer,
|
|
318
321
|
);
|
|
319
322
|
const upgradeAuthority = await decideAuthority(
|
|
320
323
|
proxyContract,
|
|
321
|
-
context.target,
|
|
324
|
+
transparent?{...context.target,admin:proxy.proxy.adminOwner}:context.target,
|
|
322
325
|
context.signerAddress,
|
|
323
326
|
);
|
|
324
327
|
if (
|
|
@@ -399,6 +402,7 @@ export const runUpgradeStep = async (
|
|
|
399
402
|
context.signer,
|
|
400
403
|
);
|
|
401
404
|
await assertUupsChainState(context, proxy.proxyAddress, implementation.address);
|
|
405
|
+
if(transparent)await verifyTransparentAdmin({hre:context.runtime.hre as any,proxy:proxy.proxyAddress,admin:prepared.plan.proxyAdmin!.address,owner:prepared.plan.proxyAdmin!.owner});
|
|
402
406
|
const gateToolSync = context.mode === "execute"
|
|
403
407
|
? await syncGateToolUups({
|
|
404
408
|
hre: context.runtime.hre,
|
|
@@ -410,6 +414,7 @@ export const runUpgradeStep = async (
|
|
|
410
414
|
target: context.targetId,
|
|
411
415
|
manifestDir: context.target.openzeppelin.manifestDir,
|
|
412
416
|
proxy: proxy.proxyAddress,
|
|
417
|
+
...(transparent?{proxyKind:"transparent" as const,proxyAdminAddress:prepared.plan.proxyAdmin!.address,proxyAdminOwner:prepared.plan.proxyAdmin!.owner}:{}),
|
|
413
418
|
implementation: implementation.address,
|
|
414
419
|
contract: actualContract,
|
|
415
420
|
constructorArgs,
|
|
@@ -544,8 +549,8 @@ export const runUpgradeStep = async (
|
|
|
544
549
|
value: upgradeTransaction.value,
|
|
545
550
|
data: upgradeTransaction.data,
|
|
546
551
|
operation: upgradeTransaction.operation,
|
|
547
|
-
method: "upgradeToAndCall",
|
|
548
|
-
args: [implementation.address],
|
|
552
|
+
method: transparent ? "upgradeAndCall" : "upgradeToAndCall",
|
|
553
|
+
args: transparent ? [proxy.proxyAddress, implementation.address, PROXY_ADMIN_INTERFACE.decodeFunctionData("upgradeAndCall", proxyUpgradeCall.data)[2]] : [implementation.address],
|
|
549
554
|
executor: upgradeTransaction.executor,
|
|
550
555
|
reason: upgradeAuthority.reason,
|
|
551
556
|
});
|
|
@@ -569,6 +574,7 @@ export const runUpgradeStep = async (
|
|
|
569
574
|
&& upgradeTransaction.route === "operator"
|
|
570
575
|
) {
|
|
571
576
|
await assertUupsChainState(context, proxy.proxyAddress, implementation.address);
|
|
577
|
+
if(transparent)await verifyTransparentAdmin({hre:context.runtime.hre as any,proxy:proxy.proxyAddress,admin:prepared.plan.proxyAdmin!.address,owner:prepared.plan.proxyAdmin!.owner});
|
|
572
578
|
const gateToolSync = await syncGateToolUups({
|
|
573
579
|
hre: context.runtime.hre,
|
|
574
580
|
root: context.root,
|
|
@@ -579,6 +585,7 @@ export const runUpgradeStep = async (
|
|
|
579
585
|
target: context.targetId,
|
|
580
586
|
manifestDir: context.target.openzeppelin.manifestDir,
|
|
581
587
|
proxy: proxy.proxyAddress,
|
|
588
|
+
...(transparent?{proxyKind:"transparent" as const,proxyAdminAddress:prepared.plan.proxyAdmin!.address,proxyAdminOwner:prepared.plan.proxyAdmin!.owner}:{}),
|
|
582
589
|
implementation: implementation.address,
|
|
583
590
|
contract: actualContract,
|
|
584
591
|
constructorArgs,
|
|
@@ -592,6 +599,7 @@ export const runUpgradeStep = async (
|
|
|
592
599
|
});
|
|
593
600
|
} else if (context.mode === "simulate") {
|
|
594
601
|
await assertUupsChainState(context, proxy.proxyAddress, implementation.address);
|
|
602
|
+
if(transparent)await verifyTransparentAdmin({hre:context.runtime.hre as any,proxy:proxy.proxyAddress,admin:prepared.plan.proxyAdmin!.address,owner:prepared.plan.proxyAdmin!.owner});
|
|
595
603
|
}
|
|
596
604
|
context.state.set(`${proxy.saveAs}Upgrade`, {
|
|
597
605
|
proxyAddress: proxy.proxyAddress,
|
package/bin/workflow.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const path = require('node:path');
|
|
3
|
-
const fs = require('node:fs');
|
|
4
|
-
const commands = {run:'cli', checkcode:'checkCode', 'checkcode-plan':'checkCodePlan', 'checkcode-finalize':'checkCodeFinalize', 'static-validate':'staticValidate', 'create2-hashes':'create2Hashes', 'release-finalize':'releaseFinalize', 'import-state':'importState', 'reconcile-external':'reconcileExternal', 'commit-contract-info':'commitContractInfo', 'plan-read':'planRead', 'plan-write':'planWrite', 'plan-add':'planAdd', 'plan-status':'planStatus'};
|
|
5
|
-
const args = process.argv.slice(2);
|
|
6
|
-
if (!args.length || args[0] === '--help') {
|
|
7
|
-
console.log('gate-workflow <'+[...Object.keys(commands),'migrate'].join('|')+'> [--project-root <path>] [existing workflow arguments]');
|
|
8
|
-
} else {
|
|
9
|
-
try {
|
|
10
|
-
const command=args.shift();
|
|
11
|
-
if (command !== 'migrate' && !Object.hasOwn(commands,command)) throw new Error('Unknown workflow command');
|
|
12
|
-
const at=args.indexOf('--project-root');
|
|
13
|
-
if(at>=0){if(!args[at+1]||args[at+1].startsWith('--'))throw new Error('--project-root requires a path');process.chdir(fs.realpathSync(args[at+1]));args.splice(at,2);}
|
|
14
|
-
if(!fs.existsSync(path.join(process.cwd(),'package.json')))throw new Error('Workflow requires a project root with package.json');
|
|
15
|
-
process.argv=[process.argv[0],process.argv[1],...args];
|
|
16
|
-
if(command === 'migrate') console.log(JSON.stringify(require('../dist-runtime/migrate.js').migrateTemplate(process.cwd(),args.includes('--apply')),null,2));
|
|
17
|
-
else require('../dist-runtime/workflow/'+commands[command]+'.js');
|
|
18
|
-
} catch(error){console.error(error.message);process.exitCode=1;}
|
|
19
|
-
}
|