Skip to content

Commit

Permalink
fix: update zksync-ethers import syntax v5 (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-bozin-txfusion authored Sep 19, 2024
1 parent f16dcb0 commit 7ed1290
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/zksync-ethers-example/deploy/001_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ export default async function (hre: HardhatRuntimeEnvironment) {
const tx2 = await greeter.setGreeting('Hello, world again with name!');
await tx2.wait();
console.info(chalk.green(`Greeter greeting set to: ${await greeter.greet()}`));

const newContractFactory = new hre.zksyncEthers.ContractFactory(artifact.abi, artifact.bytecode, wallet);
const deployedContract = await newContractFactory.deploy('Hello World with new contract factory.');
console.info(chalk.green(`Contract with new ContractFactory deployed to ${deployedContract.address}`));

const newContract = new hre.zksyncEthers.Contract(deployedContract.address, artifact.abi, wallet);
console.info(await newContract.greet());
}
7 changes: 7 additions & 0 deletions examples/zksync-ethers-example/deploy/002_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,11 @@ export default async function (hre: HardhatRuntimeEnvironment) {
console.info(chalk.green(`Greeter from getContractAt set to: ${await contract3.greet()}`));
const contract3Runner = contract3.signer as Signer;
console.info(chalk.green('Runner from getContractAt set to: ', await contract3Runner.getAddress()));

const newContractFactory = new hre.ethers.ContractFactory(artifact.abi, artifact.bytecode, signer);
const deployedContract = await newContractFactory.deploy('Hello World with new contract factory.');
console.info(chalk.green(`Contract with new ContractFactory deployed to ${deployedContract}`));

const newContract = new hre.ethers.Contract(deployedContract.address, artifact.abi, signer);
console.info(await newContract.greet());
}
2 changes: 1 addition & 1 deletion packages/hardhat-zksync-ethers/src/extension-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ZkSyncGenerator implements Generator {

public populateExtension(): any {
return lazyObject(() => {
const { zksyncEthers } = require('zksync-ethers');
const zksyncEthers = require('zksync-ethers');
const { ethWeb3Provider, zkWeb3Provider } = createProviders(this._hre);
const { ethers } = require('ethers');

Expand Down

0 comments on commit 7ed1290

Please sign in to comment.