gate-evm-tools 1.0.27 → 1.0.28
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/dist-runtime/config/hardhatAdapters.d.ts +2 -0
- package/dist-runtime/config/hardhatAdapters.js +8 -0
- package/dist-runtime/config/hardhatAdapters.js.map +1 -1
- package/dist-runtime/config/networks.d.ts +25 -1
- package/dist-runtime/config/networks.js +8 -2
- package/dist-runtime/config/networks.js.map +1 -1
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/workflow/lib/controlledMulticallAbi.d.ts +2 -0
- package/dist-runtime/workflow/lib/controlledMulticallAbi.js +10 -0
- package/dist-runtime/workflow/lib/controlledMulticallAbi.js.map +1 -0
- package/dist-runtime/workflow/lib/parameters.js +3 -2
- package/dist-runtime/workflow/lib/parameters.js.map +1 -1
- package/dist-runtime/workflow/steps/deploy.js +2 -1
- package/dist-runtime/workflow/steps/deploy.js.map +1 -1
- package/dist-runtime/workflow/steps/upgrade.js +2 -1
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -1
- package/docs/direct-package-acceptance.md +20 -0
- package/docs/external-infrastructure-acceptance.md +33 -0
- package/docs/network-runtime-acceptance.md +18 -0
- package/docs/plans/2026-09-09-workflow-extraction.md +16 -0
- package/docs/superpowers/plans/2026-07-22-manifest-bootstrap-transaction.md +50 -0
- package/docs/superpowers/plans/2026-07-22-manifest-review-remediation.md +49 -0
- package/docs/superpowers/plans/2026-08-17-custody-hardhat-signers.md +227 -0
- package/docs/superpowers/plans/2026-09-09-remove-template-infrastructure-contracts.md +11 -0
- package/docs/workflow-reference.md +1181 -0
- package/docs/workflow-runtime-acceptance.md +17 -0
- package/docs/workflow-runtime.md +56 -0
- package/package.json +3 -2
- package/runtime/config/hardhatAdapters.ts +8 -0
- package/runtime/config/networks.ts +20 -11
- package/runtime/workflow/lib/controlledMulticallAbi.ts +6 -0
- package/runtime/workflow/lib/parameters.ts +3 -2
- package/runtime/workflow/steps/deploy.ts +2 -1
- package/runtime/workflow/steps/upgrade.ts +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Local workflow extraction acceptance — 2026-09-09
|
|
2
|
+
|
|
3
|
+
Implemented in EvmGateTools and EvmHardhatCli. SmartFlowAI required no source changes because legacy script entrypoints and project-owned state remain intact.
|
|
4
|
+
|
|
5
|
+
- GateTool build and tests: 123 passed, including historical proxy-artifact compatibility, runtime binding mismatch/unversioned resume rejection, and migration custom/symlink refusal.
|
|
6
|
+
- Template build and full suite: 370 passed. Existing source fixture coverage now consumes TypeScript from the installed package, including deployment, UUPS preparation/retry, external reconciliation and reporter concurrency.
|
|
7
|
+
- GateFlow existing full-template integrity and rpc.env suites: 19 passed. This is adapter regression coverage, not a complete UI SuperTask run.
|
|
8
|
+
- Installed tarball in an isolated generated full project, updated package.json/package-lock.json and completed `npm ci --ignore-scripts`.
|
|
9
|
+
- Compiled-package integration: 9 Hardhat tests passed; direct `npx --no-install gate-workflow` two-custom-step local simulation succeeded; invocation outside the project with `--project-root` resolved the correct project and custom scripts.
|
|
10
|
+
- Baseline migration: 70 files replaced with compatibility exports, every backup compared byte-for-byte, repeat apply performed no changes. Custom/missing/symlinked paths are refused.
|
|
11
|
+
- `git diff --check` passed in both modified repositories.
|
|
12
|
+
|
|
13
|
+
Local artifact and durable logs: `/Users/vector/gate/local-packages/workflow-extraction/`. `acceptance.json` records the tarball SHA256 and installed runtime digest. The fixture is `full-runtime-check`. The runtime loaded by this fixture was compared with the built runtime identity.
|
|
14
|
+
|
|
15
|
+
No npm publication, git commit/push, live SuperTask modification or remote transaction broadcast occurred. Solidity/compiler settings and implementation/proxy salt policy were preserved. Local Hardhat tests use the in-process chain; zkSync and UUPS retry coverage uses existing test fixtures, not live-network acceptance.
|
|
16
|
+
|
|
17
|
+
The template dependency is intentionally the unpublished `1.1.0-local.0` preview. Before publication or distribution, choose a released exact version and regenerate dependency locks. Existing projects require one migration of compatible script exports plus dependency/lockfile installation; subsequent compatible runtime updates use the package. Customized workflows and already-started unversioned executions require the documented manual transition.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Packaged workflow runtime (local preview)
|
|
2
|
+
|
|
3
|
+
GateTool owns the full-template workflow implementation. New templates have no `scripts/workflow` or `scripts/config` forwarding directory: npm scripts call `gate-workflow`, and Hardhat/tests import package exports directly. Existing npm command names remain supported. Contracts, config.yaml/config.json, rpc.env, task YAML, salts, business scripts and result files remain project-owned. Compiler settings and deployment/vanity behavior are unchanged.
|
|
4
|
+
|
|
5
|
+
The release version is `1.0.27`. Publish GateTool before distributing a template that depends on it. Install the built tarball with `npm install --save-dev --save-exact /path/to/gate-evm-tools-1.0.27.tgz`. Commit the resulting dependency and existing lockfile together when ready; do not change lockfile formats. Keep the tarball accessible for `npm ci`. Before npm publication, use the explicit local tarball installation above for validation; after publication, install the exact registry version and refresh the lockfile.
|
|
6
|
+
|
|
7
|
+
Commands run from the project root:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx --no-install gate-workflow --help
|
|
11
|
+
npx --no-install gate-workflow static-validate --task TASK
|
|
12
|
+
npx --no-install gate-workflow run --task TASK --network hardhat --target hardhat --mode simulate --executionId NEW_ID --no-compile
|
|
13
|
+
npx --no-install gate-workflow migrate
|
|
14
|
+
npx --no-install gate-workflow migrate --apply
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`--project-root /absolute/project` selects another project explicitly. No manual `--require ts-node/register` is needed for the packaged CLI. Hardhat and its configuration are loaded from the selected project. The workflow runtime requires the full-template Hardhat 2 / ethers 6 plugin setup; the existing GateTool core ethers 5 support does not imply workflow support for ethers 5.
|
|
18
|
+
|
|
19
|
+
Migration defaults to a reviewable JSON plan. Apply removes recognized baseline files or exact compatibility shims, rewrites recognized npm commands and static imports to package exports, and backs up all changed files in `.gate-workflow-backup-*`. Missing helpers are already migrated. Customized files, symlinks and unresolved executable references block the entire operation before writing. The installed package exports, declared version and npm lock version are checked first. Dependency/lockfile installation is a separate explicit npm step above. Custom workflows require a manual merge. This utility does not migrate live execution state or generate project config. To roll back, restore the backup scripts and the prior package/lockfile pair, then reinstall from that lockfile.
|
|
20
|
+
|
|
21
|
+
Simulate/execute binds each target and execution ID to the package version and build digest (runtime and GateTool code). A changed build or unversioned existing execution is rejected. Finish existing tasks with their original scripts/package, or reconcile confirmed transactions and prepare a new execution. Do not delete binding records to bypass this check.
|
|
22
|
+
|
|
23
|
+
Custom steps remain in the project and export default/main/run. Migration rewrites recognized imports through project shims to package exports. Type-only imports may use `gate-evm-tools/runtime/run` (`WorkflowContext`) and `gate-evm-tools/runtime/lib/parameters` (`WorkflowStep`). Modules under runtime/lib are compatibility surfaces tied to the pinned package; upgrade them together. Runtime TypeScript sources ship for source-level regression fixtures; production invokes compiled JavaScript.
|
|
24
|
+
|
|
25
|
+
Validation is local and without broadcast. This preview is not an npm release and does not switch an active SuperTask automatically.
|
|
26
|
+
|
|
27
|
+
## Network and Hardhat adapters
|
|
28
|
+
|
|
29
|
+
The project owns its complete network list in `hardhat.config.ts`. `createNetworkHelpers({ accounts, env? })` supplies RPC routing, account injection and validated fork inputs without choosing remote networks. `env` defaults to process.env; load rpc.env/.env before calling the helper. Edit the existing `networks` entries to override fields or add a network. Keep one network list during migration, preserving confirmed custom fields and the original compiler settings.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { createNetworkHelpers } from 'gate-evm-tools/runtime-config/networks';
|
|
33
|
+
// After rpc.env/.env loading and project account resolution:
|
|
34
|
+
const { remoteNetwork } = createNetworkHelpers({ accounts });
|
|
35
|
+
const config = {
|
|
36
|
+
// Keep compiler settings and other network entries from your project.
|
|
37
|
+
networks: {
|
|
38
|
+
bscDev: {
|
|
39
|
+
...remoteNetwork({
|
|
40
|
+
route: 'bsc', publicFallback: 'https://bsc.drpc.org',
|
|
41
|
+
useBaseRpc: true, chainId: 56,
|
|
42
|
+
rpcUrl: process.env.BSC_DEV_RPC_URL,
|
|
43
|
+
}),
|
|
44
|
+
timeout: 60_000,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The deprecated `createTemplateNetworks` export retains historical defaults only for compatibility with already-generated projects. New templates do not load it; updating GateTool does not replace their inline network declarations.
|
|
51
|
+
|
|
52
|
+
Register `registerZkSyncSolcAdapter(subtask, TASK_COMPILE_SOLIDITY_RUN_SOLC)` with the project's Hardhat API; the package must not initialize an HRE during config loading. `withTemplateArtifactPaths(config)` selects EVM or zkSync artifact/cache directories and leaves compiler configuration unchanged. Manifest environment binding still precedes loading the upgrades plugin; rpc.env and credential resolution remain explicit in the project. Neither helper reads project env files or changes compiler versions.
|
|
53
|
+
|
|
54
|
+
The RPC resolver and zkSync solc PATH adapter are also exported under `runtime-config/rpc` and `runtime-config/zksyncSolcPath`; new templates import these exports directly. Migration now recognizes 72 baseline helper/workflow files. Migration rewrites recognized Hardhat imports but preserves compiler/settings/overrides. Merge new helper calls into older inline configs separately while retaining the old toolchain for overlay projects. Network infrastructure/config.yaml profiles and business data stay project-owned.
|
|
55
|
+
|
|
56
|
+
After this one-time migration, compatible runtime upgrades require updating the exact GateTool dependency and existing lockfile, without copying workflow scripts. Breaking configuration/API changes still require their documented migration. Finish active execution bindings on their original build before upgrading.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gate-evm-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "Gate 智能合约工具集 - 字节码检查、合约升级验证、合约状态同步",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"README.md",
|
|
68
68
|
"contractInfo.example.json",
|
|
69
69
|
"dist-runtime/",
|
|
70
|
-
"runtime/"
|
|
70
|
+
"runtime/",
|
|
71
|
+
"docs/"
|
|
71
72
|
],
|
|
72
73
|
"scripts": {
|
|
73
74
|
"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",
|
|
@@ -48,3 +48,11 @@ export function withTemplateArtifactPaths(config: HardhatUserConfig, argv: strin
|
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
/** Include the canonical dependency in the project compilation graph without a local Solidity shim. */
|
|
53
|
+
export function registerWorkflowDependencyCompiler(subtask: typeof import("hardhat/config").subtask, taskName: string): void {
|
|
54
|
+
subtask(taskName).setAction(async (args, _hre, runSuper) => {
|
|
55
|
+
const sourceNames: string[] = await runSuper(args);
|
|
56
|
+
return [...new Set([...sourceNames, "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"])];
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -7,8 +7,18 @@ export interface TemplateNetworkOptions {
|
|
|
7
7
|
overrides?: NonNullable<HardhatUserConfig["networks"]>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export interface RemoteNetworkOptions {
|
|
11
|
+
route: string;
|
|
12
|
+
publicFallback: string;
|
|
13
|
+
useBaseRpc: boolean;
|
|
14
|
+
chainId: number;
|
|
15
|
+
ethNetwork?: string;
|
|
16
|
+
zksync?: boolean;
|
|
17
|
+
rpcUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Generic loaders only: network names and chain declarations belong to the project. */
|
|
21
|
+
export function createNetworkHelpers({ accounts, env = process.env }: Omit<TemplateNetworkOptions, "overrides">) {
|
|
12
22
|
const hardhatForking = env.HARDHAT_FORK_RPC_URL
|
|
13
23
|
? { url: env.HARDHAT_FORK_RPC_URL }
|
|
14
24
|
: undefined;
|
|
@@ -23,15 +33,7 @@ export function createTemplateNetworks({ accounts, env = process.env, overrides
|
|
|
23
33
|
throw new Error("HARDHAT_FORK_CHAIN_ID must be a positive safe integer");
|
|
24
34
|
}
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
route: string;
|
|
28
|
-
publicFallback: string;
|
|
29
|
-
useBaseRpc: boolean;
|
|
30
|
-
chainId: number;
|
|
31
|
-
ethNetwork?: string;
|
|
32
|
-
zksync?: boolean;
|
|
33
|
-
rpcUrl?: string;
|
|
34
|
-
}
|
|
36
|
+
|
|
35
37
|
|
|
36
38
|
const remoteNetwork = ({
|
|
37
39
|
route,
|
|
@@ -66,6 +68,13 @@ export function createTemplateNetworks({ accounts, env = process.env, overrides
|
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
return { remoteNetwork, hardhatForking, hardhatForkChainId, zkSyncForkRpcUrl };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @deprecated Compatibility defaults for older generated projects only. New templates declare networks in hardhat.config.ts. */
|
|
75
|
+
export function createTemplateNetworks({ accounts, env = process.env, overrides = {} }: TemplateNetworkOptions): NonNullable<HardhatUserConfig["networks"]> {
|
|
76
|
+
const { remoteNetwork, hardhatForking, hardhatForkChainId, zkSyncForkRpcUrl } = createNetworkHelpers({ accounts, env });
|
|
77
|
+
|
|
69
78
|
const networks = {
|
|
70
79
|
hardhat: {
|
|
71
80
|
allowUnlimitedContractSize: false,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** ABI for querying deployed controlled Multicall authority; no project artifact required. */
|
|
2
|
+
export const CONTROLLED_MULTICALL_AUTHORITY_ABI = [
|
|
3
|
+
"function callers(address caller) view returns (bool)",
|
|
4
|
+
"function factoryCallers(address factory, address caller) view returns (bool)",
|
|
5
|
+
"function owner() view returns (address)",
|
|
6
|
+
];
|
|
@@ -266,9 +266,10 @@ export const validateDeployCreate2Strategy = (steps: WorkflowStep[]): void => {
|
|
|
266
266
|
if (step.upgradeableStrategy !== "uups-placeholder-proxy") {
|
|
267
267
|
throw new Error(`Deploy step ${step.id} requires upgradeableStrategy: uups-placeholder-proxy`);
|
|
268
268
|
}
|
|
269
|
-
if (String(step.contract) !== "contracts/workflow/UUPSPlaceholder.sol:UUPSPlaceholder"
|
|
269
|
+
if (String(step.contract) !== "contracts/workflow/UUPSPlaceholder.sol:UUPSPlaceholder"
|
|
270
|
+
&& step.contract !== asObject(step.firstUpgrade).contract) {
|
|
270
271
|
throw new Error(
|
|
271
|
-
`Deploy step ${step.id} must
|
|
272
|
+
`Deploy step ${step.id} must use the same business implementation in contract and firstUpgrade.contract`,
|
|
272
273
|
);
|
|
273
274
|
}
|
|
274
275
|
if (!asObject(step.firstUpgrade).contract) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTROLLED_MULTICALL_AUTHORITY_ABI } from "../lib/controlledMulticallAbi";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import { ethers, network } from "../../projectHardhat";
|
|
3
4
|
import type {
|
|
@@ -286,7 +287,7 @@ const runGateToolControlledMulticall = async (
|
|
|
286
287
|
create2.scheme,
|
|
287
288
|
);
|
|
288
289
|
const multicall = await ethers.getContractAt(
|
|
289
|
-
|
|
290
|
+
CONTROLLED_MULTICALL_AUTHORITY_ABI,
|
|
290
291
|
create2.controlledMulticall,
|
|
291
292
|
context.signer,
|
|
292
293
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTROLLED_MULTICALL_AUTHORITY_ABI } from "../lib/controlledMulticallAbi";
|
|
1
2
|
import { isAddress } from "ethers";
|
|
2
3
|
import { ethers, network } from "../../projectHardhat";
|
|
3
4
|
import path from "path";
|
|
@@ -327,7 +328,7 @@ export const runUpgradeStep = async (
|
|
|
327
328
|
: undefined;
|
|
328
329
|
const multicall = implementationMulticall
|
|
329
330
|
? await ethers.getContractAt(
|
|
330
|
-
|
|
331
|
+
CONTROLLED_MULTICALL_AUTHORITY_ABI,
|
|
331
332
|
targetMulticall.controlledMulticall,
|
|
332
333
|
context.signer,
|
|
333
334
|
)
|