Skip to content

Commit

Permalink
fix: update zksync-ethers import syntax (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-bozin-txfusion authored Sep 19, 2024
1 parent e800cf3 commit 684d5be
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 @@ -47,4 +47,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 ${await deployedContract.getAddress()}`))

const newContract = new hre.zksyncEthers.Contract(await deployedContract.getAddress(),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 @@ -99,4 +99,11 @@ export default async function (hre: HardhatRuntimeEnvironment) {
console.info(chalk.green(`Greeter from getContractAt set to: ${await contract3.greet()}`));
const contract3Runner = contract3.runner 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 ${await deployedContract.getAddress()}`))

const newContract = new hre.ethers.Contract(await deployedContract.getAddress(),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 684d5be

Please sign in to comment.