diff --git a/.changeset/ten-spiders-trade.md b/.changeset/ten-spiders-trade.md new file mode 100644 index 0000000000..91eebf52f7 --- /dev/null +++ b/.changeset/ten-spiders-trade.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': patch +--- + +Added ZKSync signer support using zksync-ethers package diff --git a/typescript/cli/package.json b/typescript/cli/package.json index 7940f8e756..3a249e154c 100644 --- a/typescript/cli/package.json +++ b/typescript/cli/package.json @@ -43,7 +43,8 @@ "eslint-plugin-import": "^2.31.0", "mocha": "^10.2.0", "prettier": "^2.8.8", - "typescript": "5.3.3" + "typescript": "5.3.3", + "zksync-ethers": "^5.10.0" }, "scripts": { "hyperlane": "node ./dist/cli.js", diff --git a/typescript/cli/src/context/strategies/signer/MultiProtocolSignerFactory.ts b/typescript/cli/src/context/strategies/signer/MultiProtocolSignerFactory.ts index 030f11b5f4..d6f83572fb 100644 --- a/typescript/cli/src/context/strategies/signer/MultiProtocolSignerFactory.ts +++ b/typescript/cli/src/context/strategies/signer/MultiProtocolSignerFactory.ts @@ -1,5 +1,6 @@ import { password } from '@inquirer/prompts'; import { Signer, Wallet } from 'ethers'; +import { Wallet as ZKSyncWallet } from 'zksync-ethers'; import { ChainName, @@ -57,7 +58,6 @@ class EthereumSignerStrategy extends BaseMultiProtocolSigner { } // 99% overlap with EthereumSignerStrategy for the sake of keeping MultiProtocolSignerFactory clean -// TODO: import ZKSync signer class ZKSyncSignerStrategy extends BaseMultiProtocolSigner { async getSignerConfig(chain: ChainName): Promise { const submitter = this.config[chain]?.submitter as { @@ -74,6 +74,6 @@ class ZKSyncSignerStrategy extends BaseMultiProtocolSigner { } getSigner(config: SignerConfig): Signer { - return new Wallet(config.privateKey); + return new ZKSyncWallet(config.privateKey); } } diff --git a/yarn.lock b/yarn.lock index 4f4fa8eb36..da261caf33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7351,6 +7351,7 @@ __metadata: typescript: "npm:5.3.3" yaml: "npm:2.4.5" yargs: "npm:^17.7.2" + zksync-ethers: "npm:^5.10.0" zod: "npm:^3.21.2" zod-validation-error: "npm:^3.3.0" zx: "npm:^8.1.4" @@ -22645,7 +22646,7 @@ __metadata: languageName: node linkType: hard -"ethers@npm:^5.1.0, ethers@npm:^5.3.1, ethers@npm:^5.7.0, ethers@npm:^5.7.1, ethers@npm:^5.7.2": +"ethers@npm:^5.1.0, ethers@npm:^5.3.1, ethers@npm:^5.7.0, ethers@npm:^5.7.1, ethers@npm:^5.7.2, ethers@npm:~5.7.0": version: 5.7.2 resolution: "ethers@npm:5.7.2" dependencies: @@ -37893,6 +37894,17 @@ __metadata: languageName: node linkType: hard +"zksync-ethers@npm:^5.10.0": + version: 5.10.0 + resolution: "zksync-ethers@npm:5.10.0" + dependencies: + ethers: "npm:~5.7.0" + peerDependencies: + ethers: ~5.7.0 + checksum: 10/826719e2e40731e1104cf8a0c16c758526de6ca9e907d0483eb5bd80b635f02e3cce012115b75d68976a8dd746d63d4f83d576cc3bddc18a02a49d2bc023347f + languageName: node + linkType: hard + "zksync-web3@npm:^0.14.3": version: 0.14.4 resolution: "zksync-web3@npm:0.14.4"