From bc525c55a6398b016566b361b2466f4356dc3f3a Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 22 Mar 2023 18:31:47 +0000 Subject: [PATCH] updates for M6 --- deploy/deploy-factory.ts | 24 +++++++----------------- deploy/deploy-multisig.ts | 18 +++++++++--------- hardhat.config.ts | 20 ++++++++++---------- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 5 files changed, 36 insertions(+), 46 deletions(-) diff --git a/deploy/deploy-factory.ts b/deploy/deploy-factory.ts index 505f46f..75aa432 100644 --- a/deploy/deploy-factory.ts +++ b/deploy/deploy-factory.ts @@ -1,23 +1,13 @@ -import { utils, Wallet } from 'zksync-web3'; -import * as ethers from 'ethers'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; +import { utils, Wallet } from "zksync-web3"; +import * as ethers from "ethers"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; export default async function (hre: HardhatRuntimeEnvironment) { - const wallet = new Wallet(''); + const wallet = new Wallet(""); const deployer = new Deployer(hre, wallet); - const factoryArtifact = await deployer.loadArtifact('AAFactory'); - const aaArtifact = await deployer.loadArtifact('TwoUserMultisig'); - - // Deposit some funds to L2 in order to be able to perform L2 transactions. - // You can remove the depositing step if the `wallet` has enough funds on zkSync - const depositAmount = ethers.utils.parseEther('0.001'); - const depositHandle = await deployer.zkWallet.deposit({ - to: deployer.zkWallet.address, - token: utils.ETH_ADDRESS, - amount: depositAmount, - }); - await depositHandle.wait(); + const factoryArtifact = await deployer.loadArtifact("AAFactory"); + const aaArtifact = await deployer.loadArtifact("TwoUserMultisig"); // Getting the bytecodeHash of the account const bytecodeHash = utils.hashBytecode(aaArtifact.bytecode); diff --git a/deploy/deploy-multisig.ts b/deploy/deploy-multisig.ts index d81efd1..907acc1 100644 --- a/deploy/deploy-multisig.ts +++ b/deploy/deploy-multisig.ts @@ -1,14 +1,14 @@ -import { utils, Wallet, Provider, EIP712Signer, types } from 'zksync-web3'; -import * as ethers from 'ethers'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { utils, Wallet, Provider, EIP712Signer, types } from "zksync-web3"; +import * as ethers from "ethers"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; // Put the address of your AA factory -const AA_FACTORY_ADDRESS = ''; +const AA_FACTORY_ADDRESS = ""; export default async function (hre: HardhatRuntimeEnvironment) { - const provider = new Provider('https://zksync2-testnet.zksync.dev'); - const wallet = new Wallet('').connect(provider); - const factoryArtifact = await hre.artifacts.readArtifact('AAFactory'); + const provider = new Provider("https://zksync2-testnet.zksync.dev"); + const wallet = new Wallet("").connect(provider); + const factoryArtifact = await hre.artifacts.readArtifact("AAFactory"); const aaFactory = new ethers.Contract( AA_FACTORY_ADDRESS, @@ -36,7 +36,7 @@ export default async function (hre: HardhatRuntimeEnvironment) { AA_FACTORY_ADDRESS, await aaFactory.aaBytecodeHash(), salt, - abiCoder.encode(['address', 'address'], [owner1.address, owner2.address]) + abiCoder.encode(["address", "address"], [owner1.address, owner2.address]) ); console.log(`Multisig deployed on address ${multisigAddress}`); @@ -44,7 +44,7 @@ export default async function (hre: HardhatRuntimeEnvironment) { await wallet.sendTransaction({ to: multisigAddress, // You can increase the amount of ETH sent to the multisig - value: ethers.utils.parseEther('0.003'), + value: ethers.utils.parseEther("0.006"), }) ).wait(); diff --git a/hardhat.config.ts b/hardhat.config.ts index 0be1f2c..9e2b197 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,26 +1,26 @@ -require('@matterlabs/hardhat-zksync-deploy'); -require('@matterlabs/hardhat-zksync-solc'); +require("@matterlabs/hardhat-zksync-deploy"); +require("@matterlabs/hardhat-zksync-solc"); module.exports = { zksolc: { - version: '1.3.1', - compilerSource: 'binary', + version: "1.3.5", + compilerSource: "binary", settings: { - isSystem: true - } + isSystem: true, + }, }, - defaultNetwork: 'zkSyncTestnet', + defaultNetwork: "zkSyncTestnet", networks: { hardhat: { zksync: true, }, zkSyncTestnet: { - url: 'https://zksync2-testnet.zksync.dev', - ethNetwork: 'goerli', // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/`) + url: "https://zksync2-testnet.zksync.dev", + ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/`) zksync: true, }, }, solidity: { - version: '0.8.16', + version: "0.8.16", }, }; diff --git a/package.json b/package.json index 5556719..583d9de 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "dependencies": { "@matterlabs/hardhat-zksync-deploy": "^0.6.1", "@matterlabs/hardhat-zksync-solc": "^0.3.14", - "@matterlabs/zksync-contracts": "^0.5.2", + "@matterlabs/zksync-contracts": "^0.6.0", "@openzeppelin/contracts": "^4.7.3", "@openzeppelin/contracts-upgradeable": "^4.7.3", "hardhat": "^2.12.0", - "zksync-web3": "^0.13.0" + "zksync-web3": "^0.14.3" } } diff --git a/yarn.lock b/yarn.lock index 84a414f..614349a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -390,10 +390,10 @@ chalk "4.1.2" dockerode "^3.3.4" -"@matterlabs/zksync-contracts@^0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@matterlabs/zksync-contracts/-/zksync-contracts-0.5.2.tgz#1488c967f1d60ad9f00121a70d89a79f9a18dc01" - integrity sha512-4hLKAsCGlTa/vC0u/j0rgX2TT5OV8cALNcxG5ismi2TqoTvx7I0kQUPEPl/AZshTb652Y0SMKJc6ayLJgolr1g== +"@matterlabs/zksync-contracts@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@matterlabs/zksync-contracts/-/zksync-contracts-0.6.0.tgz#c94da2b3e8feaff69c3f5b2219ee11d860eb8904" + integrity sha512-DRVoyKM4dNV15UZdHS+IE4u7pPpJ/dYC6I8jRmVIf1tLwPuX7vzXiw3qpiW48lgeflA76h9FZnp7IcRWpsrbFw== "@metamask/eth-sig-util@^4.0.0": version "4.0.1" @@ -2899,7 +2899,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zksync-web3@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.13.0.tgz#979633eb507c8501185ebacbaa543e91c8ab423c" - integrity sha512-7E16RMVTi+6+AyjeRNn3e6CNbQ29UCoFO2osTjkPBgQjTortA0aqjrVAyAEi7o4g22Q2iLsPD2T7llUmTI8bBw== +zksync-web3@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.3.tgz#64ac2a16d597464c3fc4ae07447a8007631c57c9" + integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ==