Skip to content

Commit

Permalink
Merge pull request #9 from matter-labs/feat/m6
Browse files Browse the repository at this point in the history
updates for M6
  • Loading branch information
uF4No authored Mar 22, 2023
2 parents 6c15b92 + bc525c5 commit 2cbbf4b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 46 deletions.
24 changes: 7 additions & 17 deletions deploy/deploy-factory.ts
Original file line number Diff line number Diff line change
@@ -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('<WALLET_PRIVATE_KEY>');
const wallet = new Wallet("<WALLET_PRIVATE_KEY>");
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);
Expand Down
18 changes: 9 additions & 9 deletions deploy/deploy-multisig.ts
Original file line number Diff line number Diff line change
@@ -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 = '<FACTORY-ADDRESS>';
const AA_FACTORY_ADDRESS = "<FACTORY-ADDRESS>";

export default async function (hre: HardhatRuntimeEnvironment) {
const provider = new Provider('https://zksync2-testnet.zksync.dev');
const wallet = new Wallet('<WALLET-PRIVATE-KEY>').connect(provider);
const factoryArtifact = await hre.artifacts.readArtifact('AAFactory');
const provider = new Provider("https://zksync2-testnet.zksync.dev");
const wallet = new Wallet("<WALLET_PRIVATE_KEY>").connect(provider);
const factoryArtifact = await hre.artifacts.readArtifact("AAFactory");

const aaFactory = new ethers.Contract(
AA_FACTORY_ADDRESS,
Expand Down Expand Up @@ -36,15 +36,15 @@ 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}`);

await (
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();

Expand Down
20 changes: 10 additions & 10 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -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/<API_KEY>`)
url: "https://zksync2-testnet.zksync.dev",
ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
zksync: true,
},
},
solidity: {
version: '0.8.16',
version: "0.8.16",
},
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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==

0 comments on commit 2cbbf4b

Please sign in to comment.