gate-evm-tools 1.0.25 → 1.0.27
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 +33 -11
- package/bin/workflow.cjs +19 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +21 -57
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkBatch.d.ts +4 -0
- package/dist/commands/checkBatch.d.ts.map +1 -0
- package/dist/commands/checkBatch.js +57 -0
- package/dist/commands/checkBatch.js.map +1 -0
- package/dist/commands/checkOptions.d.ts +3 -0
- package/dist/commands/checkOptions.d.ts.map +1 -1
- package/dist/commands/checkOptions.js +10 -1
- package/dist/commands/checkOptions.js.map +1 -1
- package/dist/commands/prepare.d.ts +1 -2
- package/dist/commands/prepare.d.ts.map +1 -1
- package/dist/commands/prepare.js +2 -17
- package/dist/commands/prepare.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +2 -17
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +2 -17
- package/dist/commands/validate.js.map +1 -1
- package/dist/core/BytecodeChecker.d.ts.map +1 -1
- package/dist/core/BytecodeChecker.js +16 -1
- package/dist/core/BytecodeChecker.js.map +1 -1
- package/dist/core/legacyProxyArtifact.d.ts +6 -0
- package/dist/core/legacyProxyArtifact.d.ts.map +1 -0
- package/dist/core/legacyProxyArtifact.js +36 -0
- package/dist/core/legacyProxyArtifact.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/hardhat.d.ts +4 -0
- package/dist/utils/hardhat.d.ts.map +1 -0
- package/dist/utils/hardhat.js +9 -0
- package/dist/utils/hardhat.js.map +1 -0
- package/dist-runtime/config/hardhatAdapters.d.ts +5 -0
- package/dist-runtime/config/hardhatAdapters.js +53 -0
- package/dist-runtime/config/hardhatAdapters.js.map +1 -0
- package/dist-runtime/config/networks.d.ts +8 -0
- package/dist-runtime/config/networks.js +269 -0
- package/dist-runtime/config/networks.js.map +1 -0
- package/dist-runtime/config/openzeppelin.d.ts +28 -0
- package/dist-runtime/config/openzeppelin.js +144 -0
- package/dist-runtime/config/openzeppelin.js.map +1 -0
- package/dist-runtime/config/rpc.d.ts +7 -0
- package/dist-runtime/config/rpc.js +19 -0
- package/dist-runtime/config/rpc.js.map +1 -0
- package/dist-runtime/config/zksyncSolcPath.d.ts +1 -0
- package/dist-runtime/config/zksyncSolcPath.js +61 -0
- package/dist-runtime/config/zksyncSolcPath.js.map +1 -0
- package/dist-runtime/migrate.d.ts +13 -0
- package/dist-runtime/migrate.js +208 -0
- package/dist-runtime/migrate.js.map +1 -0
- package/dist-runtime/package.json +1 -0
- package/dist-runtime/projectHardhat.d.ts +4 -0
- package/dist-runtime/projectHardhat.js +16 -0
- package/dist-runtime/projectHardhat.js.map +1 -0
- package/dist-runtime/runtime-identity.json +4 -0
- package/dist-runtime/template-migration.json +293 -0
- package/dist-runtime/workflow/checkCode.d.ts +1 -0
- package/dist-runtime/workflow/checkCode.js +16 -0
- package/dist-runtime/workflow/checkCode.js.map +1 -0
- package/dist-runtime/workflow/checkCodeFinalize.d.ts +1 -0
- package/dist-runtime/workflow/checkCodeFinalize.js +11 -0
- package/dist-runtime/workflow/checkCodeFinalize.js.map +1 -0
- package/dist-runtime/workflow/checkCodePlan.d.ts +1 -0
- package/dist-runtime/workflow/checkCodePlan.js +11 -0
- package/dist-runtime/workflow/checkCodePlan.js.map +1 -0
- package/dist-runtime/workflow/cli.d.ts +1 -0
- package/dist-runtime/workflow/cli.js +302 -0
- package/dist-runtime/workflow/cli.js.map +1 -0
- package/dist-runtime/workflow/commitContractInfo.d.ts +1 -0
- package/dist-runtime/workflow/commitContractInfo.js +64 -0
- package/dist-runtime/workflow/commitContractInfo.js.map +1 -0
- package/dist-runtime/workflow/create2Hashes.d.ts +1 -0
- package/dist-runtime/workflow/create2Hashes.js +76 -0
- package/dist-runtime/workflow/create2Hashes.js.map +1 -0
- package/dist-runtime/workflow/forkSourceProxy.d.ts +1 -0
- package/dist-runtime/workflow/forkSourceProxy.js +151 -0
- package/dist-runtime/workflow/forkSourceProxy.js.map +1 -0
- package/dist-runtime/workflow/importState.d.ts +1 -0
- package/dist-runtime/workflow/importState.js +193 -0
- package/dist-runtime/workflow/importState.js.map +1 -0
- package/dist-runtime/workflow/lib/authority.d.ts +28 -0
- package/dist-runtime/workflow/lib/authority.js +122 -0
- package/dist-runtime/workflow/lib/authority.js.map +1 -0
- package/dist-runtime/workflow/lib/calldata.d.ts +2 -0
- package/dist-runtime/workflow/lib/calldata.js +8 -0
- package/dist-runtime/workflow/lib/calldata.js.map +1 -0
- package/dist-runtime/workflow/lib/calls.d.ts +23 -0
- package/dist-runtime/workflow/lib/calls.js +316 -0
- package/dist-runtime/workflow/lib/calls.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/args.d.ts +2 -0
- package/dist-runtime/workflow/lib/checkCode/args.js +68 -0
- package/dist-runtime/workflow/lib/checkCode/args.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/command.d.ts +5 -0
- package/dist-runtime/workflow/lib/checkCode/command.js +35 -0
- package/dist-runtime/workflow/lib/checkCode/command.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.d.ts +6 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.js +125 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.d.ts +17 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.js +174 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/index.d.ts +3 -0
- package/dist-runtime/workflow/lib/checkCode/index.js +20 -0
- package/dist-runtime/workflow/lib/checkCode/index.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/plan.d.ts +22 -0
- package/dist-runtime/workflow/lib/checkCode/plan.js +145 -0
- package/dist-runtime/workflow/lib/checkCode/plan.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeReport.d.ts +25 -0
- package/dist-runtime/workflow/lib/checkCodeReport.js +102 -0
- package/dist-runtime/workflow/lib/checkCodeReport.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.d.ts +87 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js +964 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -0
- package/dist-runtime/workflow/lib/cliTool.d.ts +10 -0
- package/dist-runtime/workflow/lib/cliTool.js +25 -0
- package/dist-runtime/workflow/lib/cliTool.js.map +1 -0
- package/dist-runtime/workflow/lib/config.d.ts +33 -0
- package/dist-runtime/workflow/lib/config.js +100 -0
- package/dist-runtime/workflow/lib/config.js.map +1 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.d.ts +82 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.js +441 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.js.map +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +49 -0
- package/dist-runtime/workflow/lib/create2.js +194 -0
- package/dist-runtime/workflow/lib/create2.js.map +1 -0
- package/dist-runtime/workflow/lib/create2Hashes.d.ts +22 -0
- package/dist-runtime/workflow/lib/create2Hashes.js +57 -0
- package/dist-runtime/workflow/lib/create2Hashes.js.map +1 -0
- package/dist-runtime/workflow/lib/deploymentInfo.d.ts +40 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js +240 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -0
- package/dist-runtime/workflow/lib/deploymentRecords.d.ts +137 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js +374 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -0
- package/dist-runtime/workflow/lib/deployments.d.ts +21 -0
- package/dist-runtime/workflow/lib/deployments.js +240 -0
- package/dist-runtime/workflow/lib/deployments.js.map +1 -0
- package/dist-runtime/workflow/lib/erc1967.d.ts +5 -0
- package/dist-runtime/workflow/lib/erc1967.js +29 -0
- package/dist-runtime/workflow/lib/erc1967.js.map +1 -0
- package/dist-runtime/workflow/lib/errors.d.ts +6 -0
- package/dist-runtime/workflow/lib/errors.js +77 -0
- package/dist-runtime/workflow/lib/errors.js.map +1 -0
- package/dist-runtime/workflow/lib/executionId.d.ts +7 -0
- package/dist-runtime/workflow/lib/executionId.js +26 -0
- package/dist-runtime/workflow/lib/executionId.js.map +1 -0
- package/dist-runtime/workflow/lib/executionPlan.d.ts +85 -0
- package/dist-runtime/workflow/lib/executionPlan.js +450 -0
- package/dist-runtime/workflow/lib/executionPlan.js.map +1 -0
- package/dist-runtime/workflow/lib/executionProgress.d.ts +5 -0
- package/dist-runtime/workflow/lib/executionProgress.js +100 -0
- package/dist-runtime/workflow/lib/executionProgress.js.map +1 -0
- package/dist-runtime/workflow/lib/external.d.ts +62 -0
- package/dist-runtime/workflow/lib/external.js +282 -0
- package/dist-runtime/workflow/lib/external.js.map +1 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.d.ts +64 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.js +638 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -0
- package/dist-runtime/workflow/lib/forkSnapshot.d.ts +34 -0
- package/dist-runtime/workflow/lib/forkSnapshot.js +167 -0
- package/dist-runtime/workflow/lib/forkSnapshot.js.map +1 -0
- package/dist-runtime/workflow/lib/gateTool.d.ts +16 -0
- package/dist-runtime/workflow/lib/gateTool.js +177 -0
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -0
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +22 -0
- package/dist-runtime/workflow/lib/gateToolSync.js +253 -0
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -0
- package/dist-runtime/workflow/lib/lock.d.ts +52 -0
- package/dist-runtime/workflow/lib/lock.js +269 -0
- package/dist-runtime/workflow/lib/lock.js.map +1 -0
- package/dist-runtime/workflow/lib/migrationState.d.ts +103 -0
- package/dist-runtime/workflow/lib/migrationState.js +920 -0
- package/dist-runtime/workflow/lib/migrationState.js.map +1 -0
- package/dist-runtime/workflow/lib/operatorExecution.d.ts +28 -0
- package/dist-runtime/workflow/lib/operatorExecution.js +134 -0
- package/dist-runtime/workflow/lib/operatorExecution.js.map +1 -0
- package/dist-runtime/workflow/lib/parameters.d.ts +58 -0
- package/dist-runtime/workflow/lib/parameters.js +322 -0
- package/dist-runtime/workflow/lib/parameters.js.map +1 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.d.ts +29 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js +277 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js.map +1 -0
- package/dist-runtime/workflow/lib/proxy.d.ts +18 -0
- package/dist-runtime/workflow/lib/proxy.js +19 -0
- package/dist-runtime/workflow/lib/proxy.js.map +1 -0
- package/dist-runtime/workflow/lib/registryCommit.d.ts +33 -0
- package/dist-runtime/workflow/lib/registryCommit.js +319 -0
- package/dist-runtime/workflow/lib/registryCommit.js.map +1 -0
- package/dist-runtime/workflow/lib/release.d.ts +57 -0
- package/dist-runtime/workflow/lib/release.js +256 -0
- package/dist-runtime/workflow/lib/release.js.map +1 -0
- package/dist-runtime/workflow/lib/releaseFinalize.d.ts +14 -0
- package/dist-runtime/workflow/lib/releaseFinalize.js +571 -0
- package/dist-runtime/workflow/lib/releaseFinalize.js.map +1 -0
- package/dist-runtime/workflow/lib/releaseParameters.d.ts +43 -0
- package/dist-runtime/workflow/lib/releaseParameters.js +184 -0
- package/dist-runtime/workflow/lib/releaseParameters.js.map +1 -0
- package/dist-runtime/workflow/lib/reporter.d.ts +39 -0
- package/dist-runtime/workflow/lib/reporter.js +452 -0
- package/dist-runtime/workflow/lib/reporter.js.map +1 -0
- package/dist-runtime/workflow/lib/resultPaths.d.ts +17 -0
- package/dist-runtime/workflow/lib/resultPaths.js +29 -0
- package/dist-runtime/workflow/lib/resultPaths.js.map +1 -0
- package/dist-runtime/workflow/lib/runtimeVersion.d.ts +10 -0
- package/dist-runtime/workflow/lib/runtimeVersion.js +46 -0
- package/dist-runtime/workflow/lib/runtimeVersion.js.map +1 -0
- package/dist-runtime/workflow/lib/signer.d.ts +10 -0
- package/dist-runtime/workflow/lib/signer.js +105 -0
- package/dist-runtime/workflow/lib/signer.js.map +1 -0
- package/dist-runtime/workflow/lib/signerIdentity.d.ts +1 -0
- package/dist-runtime/workflow/lib/signerIdentity.js +23 -0
- package/dist-runtime/workflow/lib/signerIdentity.js.map +1 -0
- package/dist-runtime/workflow/lib/simulation.d.ts +35 -0
- package/dist-runtime/workflow/lib/simulation.js +282 -0
- package/dist-runtime/workflow/lib/simulation.js.map +1 -0
- package/dist-runtime/workflow/lib/simulationCallers.d.ts +44 -0
- package/dist-runtime/workflow/lib/simulationCallers.js +260 -0
- package/dist-runtime/workflow/lib/simulationCallers.js.map +1 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.d.ts +1 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.js +43 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.js.map +1 -0
- package/dist-runtime/workflow/lib/state.d.ts +6 -0
- package/dist-runtime/workflow/lib/state.js +25 -0
- package/dist-runtime/workflow/lib/state.js.map +1 -0
- package/dist-runtime/workflow/lib/staticValidation.d.ts +22 -0
- package/dist-runtime/workflow/lib/staticValidation.js +124 -0
- package/dist-runtime/workflow/lib/staticValidation.js.map +1 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.d.ts +27 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.js +52 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.js.map +1 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.d.ts +57 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.js +344 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.js.map +1 -0
- package/dist-runtime/workflow/reconcileExternal.d.ts +1 -0
- package/dist-runtime/workflow/reconcileExternal.js +87 -0
- package/dist-runtime/workflow/reconcileExternal.js.map +1 -0
- package/dist-runtime/workflow/reconcileExternalRun.d.ts +1 -0
- package/dist-runtime/workflow/reconcileExternalRun.js +77 -0
- package/dist-runtime/workflow/reconcileExternalRun.js.map +1 -0
- package/dist-runtime/workflow/releaseFinalize.d.ts +1 -0
- package/dist-runtime/workflow/releaseFinalize.js +11 -0
- package/dist-runtime/workflow/releaseFinalize.js.map +1 -0
- package/dist-runtime/workflow/run.d.ts +40 -0
- package/dist-runtime/workflow/run.js +858 -0
- package/dist-runtime/workflow/run.js.map +1 -0
- package/dist-runtime/workflow/staticValidate.d.ts +1 -0
- package/dist-runtime/workflow/staticValidate.js +26 -0
- package/dist-runtime/workflow/staticValidate.js.map +1 -0
- package/dist-runtime/workflow/steps/call.d.ts +3 -0
- package/dist-runtime/workflow/steps/call.js +9 -0
- package/dist-runtime/workflow/steps/call.js.map +1 -0
- package/dist-runtime/workflow/steps/check.d.ts +3 -0
- package/dist-runtime/workflow/steps/check.js +9 -0
- package/dist-runtime/workflow/steps/check.js.map +1 -0
- package/dist-runtime/workflow/steps/custom.d.ts +3 -0
- package/dist-runtime/workflow/steps/custom.js +33 -0
- package/dist-runtime/workflow/steps/custom.js.map +1 -0
- package/dist-runtime/workflow/steps/deploy.d.ts +3 -0
- package/dist-runtime/workflow/steps/deploy.js +595 -0
- package/dist-runtime/workflow/steps/deploy.js.map +1 -0
- package/dist-runtime/workflow/steps/upgrade.d.ts +3 -0
- package/dist-runtime/workflow/steps/upgrade.js +465 -0
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -0
- package/dist-runtime/workflow/steps/view.d.ts +3 -0
- package/dist-runtime/workflow/steps/view.js +9 -0
- package/dist-runtime/workflow/steps/view.js.map +1 -0
- package/package.json +26 -5
- package/runtime/config/hardhatAdapters.ts +50 -0
- package/runtime/config/networks.ts +296 -0
- package/runtime/config/openzeppelin.ts +173 -0
- package/runtime/config/rpc.ts +27 -0
- package/runtime/config/zksyncSolcPath.ts +59 -0
- package/runtime/hardhat-types.d.ts +2 -0
- package/runtime/migrate.ts +154 -0
- package/runtime/projectHardhat.ts +10 -0
- package/runtime/template-migration.json +293 -0
- package/runtime/workflow/checkCode.ts +13 -0
- package/runtime/workflow/checkCodeFinalize.ts +8 -0
- package/runtime/workflow/checkCodePlan.ts +8 -0
- package/runtime/workflow/cli.ts +356 -0
- package/runtime/workflow/commitContractInfo.ts +63 -0
- package/runtime/workflow/create2Hashes.ts +79 -0
- package/runtime/workflow/forkSourceProxy.ts +193 -0
- package/runtime/workflow/importState.ts +190 -0
- package/runtime/workflow/lib/authority.ts +170 -0
- package/runtime/workflow/lib/calldata.ts +9 -0
- package/runtime/workflow/lib/calls.ts +407 -0
- package/runtime/workflow/lib/checkCode/args.ts +76 -0
- package/runtime/workflow/lib/checkCode/command.ts +36 -0
- package/runtime/workflow/lib/checkCode/dependencies.ts +112 -0
- package/runtime/workflow/lib/checkCode/finalize.ts +198 -0
- package/runtime/workflow/lib/checkCode/index.ts +18 -0
- package/runtime/workflow/lib/checkCode/plan.ts +163 -0
- package/runtime/workflow/lib/checkCodeReport.ts +133 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +1225 -0
- package/runtime/workflow/lib/cliTool.ts +31 -0
- package/runtime/workflow/lib/config.ts +130 -0
- package/runtime/workflow/lib/contractInfoCandidates.ts +690 -0
- package/runtime/workflow/lib/create2.ts +278 -0
- package/runtime/workflow/lib/create2Hashes.ts +83 -0
- package/runtime/workflow/lib/deploymentInfo.ts +286 -0
- package/runtime/workflow/lib/deploymentRecords.ts +576 -0
- package/runtime/workflow/lib/deployments.ts +276 -0
- package/runtime/workflow/lib/erc1967.ts +57 -0
- package/runtime/workflow/lib/errors.ts +95 -0
- package/runtime/workflow/lib/executionId.ts +35 -0
- package/runtime/workflow/lib/executionPlan.ts +550 -0
- package/runtime/workflow/lib/executionProgress.ts +127 -0
- package/runtime/workflow/lib/external.ts +372 -0
- package/runtime/workflow/lib/externalExecutionScanner.ts +892 -0
- package/runtime/workflow/lib/forkSnapshot.ts +231 -0
- package/runtime/workflow/lib/gateTool.ts +261 -0
- package/runtime/workflow/lib/gateToolSync.ts +398 -0
- package/runtime/workflow/lib/lock.ts +388 -0
- package/runtime/workflow/lib/migrationState.ts +1246 -0
- package/runtime/workflow/lib/operatorExecution.ts +174 -0
- package/runtime/workflow/lib/parameters.ts +437 -0
- package/runtime/workflow/lib/pendingDeploymentReuse.ts +428 -0
- package/runtime/workflow/lib/proxy.ts +45 -0
- package/runtime/workflow/lib/registryCommit.ts +455 -0
- package/runtime/workflow/lib/release.ts +329 -0
- package/runtime/workflow/lib/releaseFinalize.ts +711 -0
- package/runtime/workflow/lib/releaseParameters.ts +248 -0
- package/runtime/workflow/lib/reporter.ts +502 -0
- package/runtime/workflow/lib/resultPaths.ts +49 -0
- package/runtime/workflow/lib/runtimeVersion.ts +28 -0
- package/runtime/workflow/lib/signer.ts +124 -0
- package/runtime/workflow/lib/signerIdentity.ts +22 -0
- package/runtime/workflow/lib/simulation.ts +415 -0
- package/runtime/workflow/lib/simulationCallers.ts +335 -0
- package/runtime/workflow/lib/sourceRpcPolicy.ts +41 -0
- package/runtime/workflow/lib/state.ts +25 -0
- package/runtime/workflow/lib/staticValidation.ts +142 -0
- package/runtime/workflow/lib/zksyncForkCapability.ts +80 -0
- package/runtime/workflow/lib/zksyncForkRunner.ts +505 -0
- package/runtime/workflow/reconcileExternal.ts +86 -0
- package/runtime/workflow/reconcileExternalRun.ts +88 -0
- package/runtime/workflow/releaseFinalize.ts +8 -0
- package/runtime/workflow/run.ts +1072 -0
- package/runtime/workflow/staticValidate.ts +23 -0
- package/runtime/workflow/steps/call.ts +10 -0
- package/runtime/workflow/steps/check.ts +10 -0
- package/runtime/workflow/steps/custom.ts +43 -0
- package/runtime/workflow/steps/deploy.ts +771 -0
- package/runtime/workflow/steps/upgrade.ts +598 -0
- package/runtime/workflow/steps/view.ts +10 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runUpgradeStep = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const projectHardhat_1 = require("../../projectHardhat");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const authority_1 = require("../lib/authority");
|
|
11
|
+
const deployments_1 = require("../lib/deployments");
|
|
12
|
+
const gateTool_1 = require("../lib/gateTool");
|
|
13
|
+
const gateToolSync_1 = require("../lib/gateToolSync");
|
|
14
|
+
const erc1967_1 = require("../lib/erc1967");
|
|
15
|
+
const lock_1 = require("../lib/lock");
|
|
16
|
+
const parameters_1 = require("../lib/parameters");
|
|
17
|
+
const create2_1 = require("../lib/create2");
|
|
18
|
+
const proxy_1 = require("../lib/proxy");
|
|
19
|
+
const signer_1 = require("../lib/signer");
|
|
20
|
+
const simulation_1 = require("../lib/simulation");
|
|
21
|
+
const resolveInContext = (context, value) => (0, parameters_1.resolveValue)(value, {
|
|
22
|
+
targetId: context.targetId,
|
|
23
|
+
target: context.target,
|
|
24
|
+
params: context.targetParams,
|
|
25
|
+
state: context.state,
|
|
26
|
+
});
|
|
27
|
+
const resolveObject = (context, value) => {
|
|
28
|
+
const resolved = resolveInContext(context, value || {});
|
|
29
|
+
if (!resolved || typeof resolved !== "object" || Array.isArray(resolved))
|
|
30
|
+
return {};
|
|
31
|
+
return resolved;
|
|
32
|
+
};
|
|
33
|
+
const resolveArray = (context, value, label) => {
|
|
34
|
+
const resolved = resolveInContext(context, value || []);
|
|
35
|
+
if (!Array.isArray(resolved))
|
|
36
|
+
throw new Error(`${label} must resolve to an array`);
|
|
37
|
+
return resolved;
|
|
38
|
+
};
|
|
39
|
+
const stringField = (source, key) => (typeof source[key] === "string" && source[key] ? String(source[key]) : undefined);
|
|
40
|
+
const proxyReference = (context, step) => {
|
|
41
|
+
const proxyObject = resolveObject(context, step.proxy);
|
|
42
|
+
const rawProxy = stringField(proxyObject, "address")
|
|
43
|
+
|| stringField(proxyObject, "name")
|
|
44
|
+
|| stringField(proxyObject, "contract")
|
|
45
|
+
|| (typeof step.proxy === "string" ? String(resolveInContext(context, step.proxy)) : undefined)
|
|
46
|
+
|| (typeof step.address === "string" ? String(resolveInContext(context, step.address)) : undefined);
|
|
47
|
+
if (!rawProxy)
|
|
48
|
+
throw new Error(`Step ${step.id} requires proxy address or deployment name`);
|
|
49
|
+
const registryDeployment = (0, ethers_1.isAddress)(rawProxy)
|
|
50
|
+
? undefined
|
|
51
|
+
: (0, deployments_1.resolveDeployment)((0, deployments_1.loadContractInfo)(context.root, context.config), context.targetId, rawProxy);
|
|
52
|
+
if (!(0, ethers_1.isAddress)(rawProxy) && !registryDeployment) {
|
|
53
|
+
throw new Error(`Missing contractInfo address: ${context.targetId}.${rawProxy}`);
|
|
54
|
+
}
|
|
55
|
+
const proxyAddress = (0, ethers_1.isAddress)(rawProxy) ? rawProxy : registryDeployment.address;
|
|
56
|
+
const defaultSaveAs = (0, ethers_1.isAddress)(rawProxy)
|
|
57
|
+
? (0, deployments_1.actualContractName)(String(step.contract))
|
|
58
|
+
: registryDeployment.key.split(":", 1)[0];
|
|
59
|
+
const saveAs = (0, deployments_1.deploymentInstanceId)(String(step.saveAs || defaultSaveAs));
|
|
60
|
+
const registryKey = registryDeployment?.key || (0, deployments_1.contractInfoKey)(saveAs, String(step.contract));
|
|
61
|
+
return {
|
|
62
|
+
proxyAddress,
|
|
63
|
+
saveAs,
|
|
64
|
+
contractInfoKey: registryKey,
|
|
65
|
+
proxy: {
|
|
66
|
+
kind: stringField(proxyObject, "kind")
|
|
67
|
+
|| (typeof step.proxyKind === "string" ? step.proxyKind : "uups"),
|
|
68
|
+
initializer: proxyObject.initializer === false
|
|
69
|
+
? false
|
|
70
|
+
: stringField(proxyObject, "initializer"),
|
|
71
|
+
unsafeAllow: Array.isArray(proxyObject.unsafeAllow)
|
|
72
|
+
? proxyObject.unsafeAllow.map((item) => String(item))
|
|
73
|
+
: undefined,
|
|
74
|
+
constructorArgs: proxyObject.constructorArgs === undefined
|
|
75
|
+
? undefined
|
|
76
|
+
: resolveArray(context, proxyObject.constructorArgs, `Step ${step.id} proxy.constructorArgs`),
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const upgradeCall = (context, step) => {
|
|
81
|
+
const call = resolveObject(context, step.call);
|
|
82
|
+
const fn = stringField(call, "fn") || stringField(call, "method");
|
|
83
|
+
return fn
|
|
84
|
+
? { fn, args: resolveArray(context, call.args || [], `Step ${step.id} call.args`) }
|
|
85
|
+
: undefined;
|
|
86
|
+
};
|
|
87
|
+
const requiredPlanTransaction = (transactions, purpose) => {
|
|
88
|
+
const selected = transactions.filter((transaction) => transaction.purpose === purpose);
|
|
89
|
+
if (selected.length !== 1) {
|
|
90
|
+
throw new Error(`GateTool plan must contain exactly one ${purpose} transaction`);
|
|
91
|
+
}
|
|
92
|
+
return selected[0];
|
|
93
|
+
};
|
|
94
|
+
const implementationDeployment = (deployments) => {
|
|
95
|
+
const selected = deployments.filter((deployment) => deployment.role === "implementation");
|
|
96
|
+
if (selected.length !== 1) {
|
|
97
|
+
throw new Error("GateTool plan must contain exactly one implementation deployment");
|
|
98
|
+
}
|
|
99
|
+
return selected[0];
|
|
100
|
+
};
|
|
101
|
+
const transactionEnvelope = (transaction) => ({
|
|
102
|
+
target: transaction.to,
|
|
103
|
+
value: transaction.value,
|
|
104
|
+
data: transaction.data,
|
|
105
|
+
operation: transaction.operation,
|
|
106
|
+
...(transaction.factoryDeps === undefined
|
|
107
|
+
? {}
|
|
108
|
+
: { scheme: "zksync-eravm", factoryDeps: transaction.factoryDeps }),
|
|
109
|
+
});
|
|
110
|
+
const assertUupsChainState = async (proxy, implementation) => {
|
|
111
|
+
const [proxyCode, implementationCode, currentImplementation] = await Promise.all([
|
|
112
|
+
projectHardhat_1.ethers.provider.getCode(proxy),
|
|
113
|
+
projectHardhat_1.ethers.provider.getCode(implementation),
|
|
114
|
+
(0, erc1967_1.getERC1967Implementation)(projectHardhat_1.ethers.provider, proxy),
|
|
115
|
+
]);
|
|
116
|
+
if (!proxyCode || proxyCode === "0x") {
|
|
117
|
+
throw new Error(`UUPS proxy is missing deployed code at ${proxy}`);
|
|
118
|
+
}
|
|
119
|
+
if (!implementationCode || implementationCode === "0x") {
|
|
120
|
+
throw new Error(`UUPS implementation is missing deployed code at ${implementation}`);
|
|
121
|
+
}
|
|
122
|
+
if (!currentImplementation
|
|
123
|
+
|| currentImplementation.toLowerCase() !== implementation.toLowerCase()) {
|
|
124
|
+
throw new Error(`UUPS proxy ${proxy} does not point to GateTool implementation ${implementation}`);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const runUpgradeStep = async (context, step) => {
|
|
128
|
+
if (!context.signer || !context.signerAddress) {
|
|
129
|
+
throw new Error(`Upgrade step ${step.id} requires a signer`);
|
|
130
|
+
}
|
|
131
|
+
const contractName = String(step.contract);
|
|
132
|
+
const proxy = proxyReference(context, step);
|
|
133
|
+
if ((proxy.proxy.kind || "uups") !== "uups") {
|
|
134
|
+
throw new Error(`Upgrade step ${step.id} only supports UUPS proxies`);
|
|
135
|
+
}
|
|
136
|
+
if (context.mode === "simulate") {
|
|
137
|
+
await (0, simulation_1.assertSimulationUupsSourceState)(context.simulation, proxy.proxyAddress);
|
|
138
|
+
}
|
|
139
|
+
const call = upgradeCall(context, step);
|
|
140
|
+
const actualContract = (0, deployments_1.actualContractName)(contractName);
|
|
141
|
+
const targetCreate2 = context.target.create2;
|
|
142
|
+
const targetMulticall = context.target.multicall;
|
|
143
|
+
const scheme = targetCreate2?.scheme || "evm";
|
|
144
|
+
if (scheme !== "evm" && scheme !== "zksync-eravm") {
|
|
145
|
+
throw new Error(`Upgrade step ${step.id} target create2 scheme is invalid`);
|
|
146
|
+
}
|
|
147
|
+
if (!targetCreate2?.factory || !targetMulticall?.controlledMulticall) {
|
|
148
|
+
throw new Error(`Upgrade step ${step.id} requires target create2 factory and controlledMulticall`);
|
|
149
|
+
}
|
|
150
|
+
const constructorArgs = resolveArray(context, step.constructorArgs || proxy.proxy.constructorArgs || [], `Step ${step.id} constructorArgs`);
|
|
151
|
+
const implementationSalt = (0, proxy_1.deriveImplementationSalt)(context.executionId, contractName, proxy.proxyAddress);
|
|
152
|
+
const request = {
|
|
153
|
+
version: 1,
|
|
154
|
+
kind: "uups-upgrade",
|
|
155
|
+
scheme,
|
|
156
|
+
network: projectHardhat_1.network.name,
|
|
157
|
+
target: context.targetId,
|
|
158
|
+
contract: contractName,
|
|
159
|
+
constructorArgs,
|
|
160
|
+
factory: targetCreate2.factory,
|
|
161
|
+
proxyKind: "uups",
|
|
162
|
+
proxy: proxy.proxyAddress,
|
|
163
|
+
implementationSalt,
|
|
164
|
+
...(proxy.proxy.unsafeAllow ? { unsafeAllow: proxy.proxy.unsafeAllow } : {}),
|
|
165
|
+
...(call ? { call: { method: call.fn, args: call.args } } : {}),
|
|
166
|
+
};
|
|
167
|
+
const gateToolEvidenceDir = path_1.default.join(context.taskDir, "results", context.targetId, context.executionId, "gate-tool", context.mode);
|
|
168
|
+
const prepared = await (0, gateTool_1.prepareGateToolWorkflow)({
|
|
169
|
+
root: context.root,
|
|
170
|
+
evidenceDir: gateToolEvidenceDir,
|
|
171
|
+
evidenceName: step.id,
|
|
172
|
+
request,
|
|
173
|
+
readBlockTag: context.mode === "simulate"
|
|
174
|
+
? context.simulation.snapshot?.blockNumber
|
|
175
|
+
: undefined,
|
|
176
|
+
});
|
|
177
|
+
const implementation = implementationDeployment(prepared.plan.deployments);
|
|
178
|
+
const implementationCall = prepared.plan.transactions.find((transaction) => transaction.purpose === "deploy-implementation");
|
|
179
|
+
const proxyUpgradeCall = requiredPlanTransaction(prepared.plan.transactions, "upgrade-proxy");
|
|
180
|
+
const gateToolPlan = path_1.default.relative(context.root, prepared.planPath).split(path_1.default.sep).join("/");
|
|
181
|
+
const preparedChange = {
|
|
182
|
+
stepId: step.id,
|
|
183
|
+
kind: "upgrade",
|
|
184
|
+
instanceId: proxy.saveAs,
|
|
185
|
+
actualContract,
|
|
186
|
+
contractInfoKey: proxy.contractInfoKey,
|
|
187
|
+
strategy: "gate-tool",
|
|
188
|
+
proxyKind: "uups",
|
|
189
|
+
proxyAddress: proxy.proxyAddress,
|
|
190
|
+
implementationAddress: implementation.address,
|
|
191
|
+
implementationSalt,
|
|
192
|
+
constructorArgs,
|
|
193
|
+
factory: targetCreate2.factory,
|
|
194
|
+
gateTool: {
|
|
195
|
+
outputPath: gateToolPlan,
|
|
196
|
+
data: prepared.plan,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
if (context.parameterLockExecutionId) {
|
|
200
|
+
(0, lock_1.recordParameterLockImplementationSalts)(context.taskDir, context.parameterLockExecutionId, { [`${step.id}.implementation`]: implementationSalt });
|
|
201
|
+
}
|
|
202
|
+
const recorder = context.mode === "execute" ? context.deploymentRecorder : undefined;
|
|
203
|
+
if (context.mode === "execute" && !recorder) {
|
|
204
|
+
throw new Error(`Upgrade step ${step.id} requires an execution deployment recorder`);
|
|
205
|
+
}
|
|
206
|
+
recorder?.prepare(preparedChange);
|
|
207
|
+
const proxyContract = await projectHardhat_1.ethers.getContractAt(String(step.abi || contractName), proxy.proxyAddress, context.signer);
|
|
208
|
+
const upgradeAuthority = await (0, authority_1.decideAuthority)(proxyContract, context.target, context.signerAddress);
|
|
209
|
+
if (context.mode === "simulate"
|
|
210
|
+
&& !context.configuredSimulationCaller
|
|
211
|
+
&& !context.executionPlanner) {
|
|
212
|
+
(0, authority_1.assertSelectedSimulationSignerAuthorized)(upgradeAuthority, step.id);
|
|
213
|
+
}
|
|
214
|
+
const implementationMulticall = implementationCall
|
|
215
|
+
? (0, create2_1.prepareControlledMulticallTransaction)(targetMulticall.controlledMulticall, [{
|
|
216
|
+
target: implementationCall.to,
|
|
217
|
+
value: implementationCall.value,
|
|
218
|
+
data: implementationCall.data,
|
|
219
|
+
...(implementationCall.factoryDeps === undefined
|
|
220
|
+
? {}
|
|
221
|
+
: { factoryDeps: implementationCall.factoryDeps }),
|
|
222
|
+
}], scheme)
|
|
223
|
+
: undefined;
|
|
224
|
+
const multicall = implementationMulticall
|
|
225
|
+
? await projectHardhat_1.ethers.getContractAt("Multicall3", targetMulticall.controlledMulticall, context.signer)
|
|
226
|
+
: undefined;
|
|
227
|
+
const implementationAuthority = multicall
|
|
228
|
+
? await (0, authority_1.decideControlledMulticallAuthority)(multicall, targetCreate2.factory, context.target, context.signerAddress)
|
|
229
|
+
: undefined;
|
|
230
|
+
if (scheme === "zksync-eravm"
|
|
231
|
+
&& (upgradeAuthority.mode !== "execute"
|
|
232
|
+
|| implementationAuthority?.mode === "calldata")) {
|
|
233
|
+
throw new Error(`Upgrade step ${step.id} requires unsupported zkSync external Admin execution`);
|
|
234
|
+
}
|
|
235
|
+
if (!context.executionPlanner) {
|
|
236
|
+
const configuredCallerSimulation = context.mode === "simulate"
|
|
237
|
+
&& context.configuredSimulationCaller === true;
|
|
238
|
+
if (!configuredCallerSimulation
|
|
239
|
+
&& (upgradeAuthority.mode !== "execute"
|
|
240
|
+
|| implementationAuthority?.mode === "calldata")) {
|
|
241
|
+
throw new Error(`Upgrade step ${step.id} requires a locked mixed-authority execution plan`);
|
|
242
|
+
}
|
|
243
|
+
let implementationTxHash;
|
|
244
|
+
if (implementationMulticall) {
|
|
245
|
+
const tx = await (0, create2_1.sendPreparedControlledMulticallTransaction)(implementationMulticall, context.signer);
|
|
246
|
+
implementationTxHash = tx.hash;
|
|
247
|
+
}
|
|
248
|
+
const upgradeTx = await (0, create2_1.sendPreparedWorkflowTransaction)(transactionEnvelope(proxyUpgradeCall), context.signer);
|
|
249
|
+
await assertUupsChainState(proxy.proxyAddress, implementation.address);
|
|
250
|
+
const gateToolSync = context.mode === "execute"
|
|
251
|
+
? await (0, gateToolSync_1.syncGateToolUups)({
|
|
252
|
+
root: context.root,
|
|
253
|
+
evidenceDir: gateToolEvidenceDir,
|
|
254
|
+
evidenceName: step.id,
|
|
255
|
+
scheme: prepared.plan.scheme,
|
|
256
|
+
network: projectHardhat_1.network.name,
|
|
257
|
+
target: context.targetId,
|
|
258
|
+
manifestDir: context.target.openzeppelin.manifestDir,
|
|
259
|
+
proxy: proxy.proxyAddress,
|
|
260
|
+
implementation: implementation.address,
|
|
261
|
+
contract: actualContract,
|
|
262
|
+
constructorArgs,
|
|
263
|
+
transactionHash: upgradeTx.hash,
|
|
264
|
+
})
|
|
265
|
+
: undefined;
|
|
266
|
+
if (context.mode === "execute") {
|
|
267
|
+
recorder?.apply({
|
|
268
|
+
...preparedChange,
|
|
269
|
+
implementationTxHash,
|
|
270
|
+
txHash: upgradeTx.hash,
|
|
271
|
+
gateToolSync,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
context.state.set(`${proxy.saveAs}Upgrade`, {
|
|
275
|
+
proxyAddress: proxy.proxyAddress,
|
|
276
|
+
implementationAddress: implementation.address,
|
|
277
|
+
implementationSalt,
|
|
278
|
+
implementationTxHash,
|
|
279
|
+
txHash: upgradeTx.hash,
|
|
280
|
+
gateToolPlan,
|
|
281
|
+
gateToolSync: gateToolSync?.outputPath,
|
|
282
|
+
});
|
|
283
|
+
context.reporter.result("execution", {
|
|
284
|
+
stepId: step.id,
|
|
285
|
+
kind: step.kind,
|
|
286
|
+
mode: "execute",
|
|
287
|
+
scheme,
|
|
288
|
+
contract: contractName,
|
|
289
|
+
actualContract,
|
|
290
|
+
saveAs: proxy.saveAs,
|
|
291
|
+
contractInfoKey: proxy.contractInfoKey,
|
|
292
|
+
proxy: proxy.proxyAddress,
|
|
293
|
+
implementationAddress: implementation.address,
|
|
294
|
+
implementationTxHash,
|
|
295
|
+
txHash: upgradeTx.hash,
|
|
296
|
+
gateToolPlan,
|
|
297
|
+
});
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
let implementationTransactionId;
|
|
301
|
+
let implementationTxHash;
|
|
302
|
+
let implementationExternal = false;
|
|
303
|
+
if (implementationMulticall && implementationAuthority) {
|
|
304
|
+
const implementationExecutor = implementationAuthority.mode === "execute"
|
|
305
|
+
? context.signerAddress
|
|
306
|
+
: implementationAuthority.executor;
|
|
307
|
+
if (!implementationExecutor) {
|
|
308
|
+
throw new Error(`Upgrade step ${step.id} cannot resolve implementation executor`);
|
|
309
|
+
}
|
|
310
|
+
const planned = context.executionPlanner.add({
|
|
311
|
+
stepId: `${step.id}-implementation`,
|
|
312
|
+
executor: implementationExecutor,
|
|
313
|
+
to: implementationMulticall.target,
|
|
314
|
+
value: implementationMulticall.value,
|
|
315
|
+
data: implementationMulticall.data,
|
|
316
|
+
operation: 0,
|
|
317
|
+
...(implementationMulticall.scheme === undefined
|
|
318
|
+
? {}
|
|
319
|
+
: { scheme: implementationMulticall.scheme }),
|
|
320
|
+
...(implementationMulticall.factoryDeps === undefined
|
|
321
|
+
? {}
|
|
322
|
+
: { factoryDeps: implementationMulticall.factoryDeps }),
|
|
323
|
+
});
|
|
324
|
+
implementationTransactionId = planned.transactionId;
|
|
325
|
+
implementationExternal = planned.route === "external";
|
|
326
|
+
if (planned.executionAction === "replay") {
|
|
327
|
+
implementationTxHash = planned.transactionHash;
|
|
328
|
+
}
|
|
329
|
+
else if (planned.route === "external" && context.mode !== "simulate") {
|
|
330
|
+
context.externalCalls.push({
|
|
331
|
+
transactionId: planned.transactionId,
|
|
332
|
+
stepId: planned.stepId,
|
|
333
|
+
to: planned.to,
|
|
334
|
+
value: planned.value,
|
|
335
|
+
data: planned.data,
|
|
336
|
+
operation: planned.operation,
|
|
337
|
+
method: implementationMulticall.method,
|
|
338
|
+
args: implementationMulticall.calls,
|
|
339
|
+
executor: planned.executor,
|
|
340
|
+
reason: implementationAuthority.reason,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
const selectedSigner = planned.route === "external"
|
|
345
|
+
? await (0, signer_1.impersonateWorkflowSimulationSigner)(planned.executor)
|
|
346
|
+
: context.signer;
|
|
347
|
+
const tx = await (0, create2_1.sendPreparedControlledMulticallTransaction)(implementationMulticall, selectedSigner);
|
|
348
|
+
implementationTxHash = tx.hash;
|
|
349
|
+
if (context.mode === "execute" && planned.route === "operator") {
|
|
350
|
+
context.operatorReceipts.push({
|
|
351
|
+
transactionId: planned.transactionId,
|
|
352
|
+
transactionHash: tx.hash,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const upgradeExecutor = upgradeAuthority.mode === "execute"
|
|
358
|
+
? context.signerAddress
|
|
359
|
+
: upgradeAuthority.executor;
|
|
360
|
+
if (!upgradeExecutor)
|
|
361
|
+
throw new Error(`Upgrade step ${step.id} cannot resolve proxy executor`);
|
|
362
|
+
const upgradeEnvelope = transactionEnvelope(proxyUpgradeCall);
|
|
363
|
+
const upgradeTransaction = context.executionPlanner.add({
|
|
364
|
+
stepId: step.id,
|
|
365
|
+
executor: upgradeExecutor,
|
|
366
|
+
to: upgradeEnvelope.target,
|
|
367
|
+
value: upgradeEnvelope.value,
|
|
368
|
+
data: upgradeEnvelope.data,
|
|
369
|
+
operation: 0,
|
|
370
|
+
...(upgradeEnvelope.scheme === undefined ? {} : { scheme: upgradeEnvelope.scheme }),
|
|
371
|
+
...(upgradeEnvelope.factoryDeps === undefined
|
|
372
|
+
? {}
|
|
373
|
+
: { factoryDeps: upgradeEnvelope.factoryDeps }),
|
|
374
|
+
});
|
|
375
|
+
if (context.mode === "execute") {
|
|
376
|
+
recorder?.bindProxyTransaction(step.id, upgradeTransaction.transactionId);
|
|
377
|
+
}
|
|
378
|
+
let upgradeTxHash;
|
|
379
|
+
if (upgradeTransaction.executionAction === "replay") {
|
|
380
|
+
upgradeTxHash = upgradeTransaction.transactionHash;
|
|
381
|
+
}
|
|
382
|
+
else if (upgradeTransaction.route === "external" && context.mode !== "simulate") {
|
|
383
|
+
context.externalCalls.push({
|
|
384
|
+
transactionId: upgradeTransaction.transactionId,
|
|
385
|
+
stepId: upgradeTransaction.stepId,
|
|
386
|
+
to: upgradeTransaction.to,
|
|
387
|
+
value: upgradeTransaction.value,
|
|
388
|
+
data: upgradeTransaction.data,
|
|
389
|
+
operation: upgradeTransaction.operation,
|
|
390
|
+
method: "upgradeToAndCall",
|
|
391
|
+
args: [implementation.address],
|
|
392
|
+
executor: upgradeTransaction.executor,
|
|
393
|
+
reason: upgradeAuthority.reason,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
const selectedSigner = upgradeTransaction.route === "external"
|
|
398
|
+
? await (0, signer_1.impersonateWorkflowSimulationSigner)(upgradeTransaction.executor)
|
|
399
|
+
: context.signer;
|
|
400
|
+
const tx = await (0, create2_1.sendPreparedWorkflowTransaction)(upgradeEnvelope, selectedSigner);
|
|
401
|
+
upgradeTxHash = tx.hash;
|
|
402
|
+
if (context.mode === "execute" && upgradeTransaction.route === "operator") {
|
|
403
|
+
context.operatorReceipts.push({
|
|
404
|
+
transactionId: upgradeTransaction.transactionId,
|
|
405
|
+
transactionHash: tx.hash,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (context.mode === "execute"
|
|
410
|
+
&& !implementationExternal
|
|
411
|
+
&& upgradeTransaction.route === "operator") {
|
|
412
|
+
await assertUupsChainState(proxy.proxyAddress, implementation.address);
|
|
413
|
+
const gateToolSync = await (0, gateToolSync_1.syncGateToolUups)({
|
|
414
|
+
root: context.root,
|
|
415
|
+
evidenceDir: gateToolEvidenceDir,
|
|
416
|
+
evidenceName: step.id,
|
|
417
|
+
scheme: prepared.plan.scheme,
|
|
418
|
+
network: projectHardhat_1.network.name,
|
|
419
|
+
target: context.targetId,
|
|
420
|
+
manifestDir: context.target.openzeppelin.manifestDir,
|
|
421
|
+
proxy: proxy.proxyAddress,
|
|
422
|
+
implementation: implementation.address,
|
|
423
|
+
contract: actualContract,
|
|
424
|
+
constructorArgs,
|
|
425
|
+
transactionHash: upgradeTxHash || "",
|
|
426
|
+
});
|
|
427
|
+
recorder?.apply({
|
|
428
|
+
...preparedChange,
|
|
429
|
+
implementationTxHash,
|
|
430
|
+
txHash: upgradeTxHash,
|
|
431
|
+
gateToolSync,
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
else if (context.mode === "simulate") {
|
|
435
|
+
await assertUupsChainState(proxy.proxyAddress, implementation.address);
|
|
436
|
+
}
|
|
437
|
+
context.state.set(`${proxy.saveAs}Upgrade`, {
|
|
438
|
+
proxyAddress: proxy.proxyAddress,
|
|
439
|
+
implementationAddress: implementation.address,
|
|
440
|
+
implementationSalt,
|
|
441
|
+
implementationTxHash,
|
|
442
|
+
txHash: upgradeTxHash,
|
|
443
|
+
external: implementationExternal || upgradeTransaction.route === "external",
|
|
444
|
+
gateToolPlan,
|
|
445
|
+
});
|
|
446
|
+
context.reporter.result("execution", {
|
|
447
|
+
stepId: step.id,
|
|
448
|
+
kind: step.kind,
|
|
449
|
+
mode: upgradeTransaction.route,
|
|
450
|
+
scheme,
|
|
451
|
+
implementationTransactionId,
|
|
452
|
+
upgradeTransactionId: upgradeTransaction.transactionId,
|
|
453
|
+
contract: contractName,
|
|
454
|
+
actualContract,
|
|
455
|
+
saveAs: proxy.saveAs,
|
|
456
|
+
contractInfoKey: proxy.contractInfoKey,
|
|
457
|
+
proxy: proxy.proxyAddress,
|
|
458
|
+
implementationAddress: implementation.address,
|
|
459
|
+
implementationTxHash,
|
|
460
|
+
txHash: upgradeTxHash,
|
|
461
|
+
gateToolPlan,
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
exports.runUpgradeStep = runUpgradeStep;
|
|
465
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../runtime/workflow/steps/upgrade.ts"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BAAoB;YACpB,MAAM,EAAE,aAAa;YACrB,YAAY;SACb,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACvC,MAAM,oBAAoB,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,SAAS,EAAE;QAC1C,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,qBAAqB,EAAE,cAAc,CAAC,OAAO;QAC7C,kBAAkB;QAClB,oBAAoB;QACpB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,sBAAsB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU;QAC3E,YAAY;KACb,CAAC,CAAC;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,kBAAkB,CAAC,KAAK;QAC9B,MAAM;QACN,2BAA2B;QAC3B,oBAAoB,EAAE,kBAAkB,CAAC,aAAa;QACtD,QAAQ,EAAE,YAAY;QACtB,cAAc;QACd,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,KAAK,EAAE,KAAK,CAAC,YAAY;QACzB,qBAAqB,EAAE,cAAc,CAAC,OAAO;QAC7C,oBAAoB;QACpB,MAAM,EAAE,aAAa;QACrB,YAAY;KACb,CAAC,CAAC;AACL,CAAC,CAAC;AAzZW,QAAA,cAAc,kBAyZzB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runViewStep = void 0;
|
|
4
|
+
const calls_1 = require("../lib/calls");
|
|
5
|
+
const runViewStep = async (context, step) => {
|
|
6
|
+
await (0, calls_1.runContractViewCalls)(context, step);
|
|
7
|
+
};
|
|
8
|
+
exports.runViewStep = runViewStep;
|
|
9
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../runtime/workflow/steps/view.ts"],"names":[],"mappings":";;;AAEA,wCAAoD;AAE7C,MAAM,WAAW,GAAG,KAAK,EAC9B,OAAwB,EACxB,IAAkB,EACH,EAAE;IACjB,MAAM,IAAA,4BAAoB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gate-evm-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Gate 智能合约工具集 - 字节码检查、合约升级验证、合约状态同步",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,16 @@
|
|
|
23
23
|
"types": "./dist/sync/index.d.ts",
|
|
24
24
|
"import": "./dist/sync/index.js",
|
|
25
25
|
"require": "./dist-cjs/sync/index.js"
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
|
+
"./runtime/*": {
|
|
28
|
+
"types": "./dist-runtime/workflow/*.d.ts",
|
|
29
|
+
"default": "./dist-runtime/workflow/*.js"
|
|
30
|
+
},
|
|
31
|
+
"./runtime-config/*": {
|
|
32
|
+
"types": "./dist-runtime/config/*.d.ts",
|
|
33
|
+
"default": "./dist-runtime/config/*.js"
|
|
34
|
+
},
|
|
35
|
+
"./runtime-source/*": "./runtime/*.ts"
|
|
27
36
|
},
|
|
28
37
|
"typesVersions": {
|
|
29
38
|
"*": {
|
|
@@ -38,21 +47,30 @@
|
|
|
38
47
|
],
|
|
39
48
|
"sync": [
|
|
40
49
|
"dist/sync/index.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"runtime/*": [
|
|
52
|
+
"dist-runtime/workflow/*.d.ts"
|
|
53
|
+
],
|
|
54
|
+
"runtime-config/*": [
|
|
55
|
+
"dist-runtime/config/*.d.ts"
|
|
41
56
|
]
|
|
42
57
|
}
|
|
43
58
|
},
|
|
44
59
|
"bin": {
|
|
45
|
-
"gate-tool": "./bin/cli.js"
|
|
60
|
+
"gate-tool": "./bin/cli.js",
|
|
61
|
+
"gate-workflow": "./bin/workflow.cjs"
|
|
46
62
|
},
|
|
47
63
|
"files": [
|
|
48
64
|
"bin/",
|
|
49
65
|
"dist/",
|
|
50
66
|
"dist-cjs/",
|
|
51
67
|
"README.md",
|
|
52
|
-
"contractInfo.example.json"
|
|
68
|
+
"contractInfo.example.json",
|
|
69
|
+
"dist-runtime/",
|
|
70
|
+
"runtime/"
|
|
53
71
|
],
|
|
54
72
|
"scripts": {
|
|
55
|
-
"build": "tsc && tsc -p tsconfig.custody-cjs.json && node scripts/write-cjs-package.mjs",
|
|
73
|
+
"build": "tsc && tsc -p tsconfig.custody-cjs.json && node scripts/write-cjs-package.mjs && tsc -p tsconfig.runtime.json && node scripts/write-runtime-package.mjs",
|
|
56
74
|
"dev": "tsc --watch",
|
|
57
75
|
"start": "node bin/cli.js",
|
|
58
76
|
"pretest": "npm run build",
|
|
@@ -79,6 +97,7 @@
|
|
|
79
97
|
"fs-extra": "^11.2.0",
|
|
80
98
|
"ora": "^7.0.1",
|
|
81
99
|
"prompts": "^2.4.2",
|
|
100
|
+
"semver": "^7.8.5",
|
|
82
101
|
"yaml": "2.8.1",
|
|
83
102
|
"zksync-ethers": "6.15.0"
|
|
84
103
|
},
|
|
@@ -93,9 +112,11 @@
|
|
|
93
112
|
"@types/fs-extra": "^11.0.4",
|
|
94
113
|
"@types/node": "^24.7.2",
|
|
95
114
|
"@types/prompts": "^2.4.9",
|
|
115
|
+
"@types/semver": "^7.8.0",
|
|
96
116
|
"ethers": "^6.15.0",
|
|
97
117
|
"ethers5": "npm:ethers@5.7.2",
|
|
98
118
|
"hardhat": "2.27.1",
|
|
119
|
+
"ts-node": "10.9.2",
|
|
99
120
|
"typescript": "^5.9.3"
|
|
100
121
|
},
|
|
101
122
|
"peerDependencies": {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { HardhatUserConfig } from "hardhat/types";
|
|
2
|
+
import { withZkSyncSolcOnPath } from "./zksyncSolcPath";
|
|
3
|
+
|
|
4
|
+
export function registerZkSyncSolcAdapter(subtask: typeof import("hardhat/config").subtask, taskName: string): void {
|
|
5
|
+
subtask(taskName).setAction(async (args, hre, runSuper) => {
|
|
6
|
+
if ((hre.network as { zksync?: boolean }).zksync !== true) return runSuper(args);
|
|
7
|
+
const solcPath = (args as { solcPath?: unknown }).solcPath;
|
|
8
|
+
if (typeof solcPath !== "string" || !solcPath.trim()) {
|
|
9
|
+
throw new Error("zkSync compilation requires Hardhat to provide solcPath");
|
|
10
|
+
}
|
|
11
|
+
return withZkSyncSolcOnPath(solcPath, () => runSuper(args));
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function requestedHardhatNetwork(argv: string[], env: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
16
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
17
|
+
const argument = argv[index];
|
|
18
|
+
if (argument === "--network") {
|
|
19
|
+
const value = argv[index + 1]?.trim();
|
|
20
|
+
if (!value || value.startsWith("-")) {
|
|
21
|
+
throw new Error("--network requires a network name");
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (argument.startsWith("--network=")) {
|
|
26
|
+
const value = argument.slice("--network=".length).trim();
|
|
27
|
+
if (!value) throw new Error("--network requires a network name");
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return env.HARDHAT_NETWORK?.trim() || undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/** Returns a config with scheme-specific output paths, preserving compiler settings. */
|
|
36
|
+
export function withTemplateArtifactPaths(config: HardhatUserConfig, argv: string[] = process.argv, env: NodeJS.ProcessEnv = process.env): HardhatUserConfig {
|
|
37
|
+
const selectedHardhatNetwork = requestedHardhatNetwork(argv, env);
|
|
38
|
+
const selectedNetworkConfig = selectedHardhatNetwork
|
|
39
|
+
? config.networks?.[selectedHardhatNetwork] as ({ zksync?: boolean } | undefined)
|
|
40
|
+
: undefined;
|
|
41
|
+
const useZkSyncArtifacts = selectedNetworkConfig?.zksync === true;
|
|
42
|
+
return {
|
|
43
|
+
...config,
|
|
44
|
+
paths: {
|
|
45
|
+
...config.paths,
|
|
46
|
+
cache: useZkSyncArtifacts ? "./cache-zk" : "./cache",
|
|
47
|
+
artifacts: useZkSyncArtifacts ? "./artifacts-zk" : "./artifacts",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|