diff --git a/packages/integration-tests/src/playbook/deploy/deploy-greeter.ts b/packages/integration-tests/src/playbook/deploy/deploy-greeter.ts index a8d50db77..02eab9eed 100644 --- a/packages/integration-tests/src/playbook/deploy/deploy-greeter.ts +++ b/packages/integration-tests/src/playbook/deploy/deploy-greeter.ts @@ -1,6 +1,5 @@ import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; -import { localConfig } from "../../config"; import { Buffer, Path } from "../../constants"; import { Helper } from "../../helper"; import getWallet from "../utils/getWallet"; diff --git a/packages/integration-tests/src/playbook/deploy/deploy-paymaster.ts b/packages/integration-tests/src/playbook/deploy/deploy-paymaster.ts index c1db63b72..46d476b75 100644 --- a/packages/integration-tests/src/playbook/deploy/deploy-paymaster.ts +++ b/packages/integration-tests/src/playbook/deploy/deploy-paymaster.ts @@ -37,18 +37,18 @@ export default async function (hre: HardhatRuntimeEnvironment) { await helper.writeFile(Path.absolutePathToBufferFiles, Buffer.paymasterDeployTx, deployTransaction.hash); // TODO: fix - // await ( - // await deployer.zkWallet.sendTransaction({ - // to: paymaster.address, - // value: parseEther("0.03"), - // }) - // ).wait(); + await ( + await deployer.zkWallet.sendTransaction({ + to: paymaster.address, + value: parseEther("0.03"), + }) + ).wait(); - // await // We will give the empty wallet 3 units of the token: - // (await erc20.mint(emptyWallet.address, 3)).wait(); + await // We will give the empty wallet 3 units of the token: + (await erc20.mint(emptyWallet.address, 3)).wait(); - // console.log("Minted 3 tokens for the empty wallet"); - // console.log(`Done!`); + console.log("Minted 3 tokens for the empty wallet"); + console.log(`Done!`); - // return deployTransaction.hash; + return deployTransaction.hash; } diff --git a/packages/integration-tests/src/playbook/deploy/erc20toL1.ts b/packages/integration-tests/src/playbook/deploy/erc20toL1.ts index 0be570bc1..8a20c5cb6 100644 --- a/packages/integration-tests/src/playbook/deploy/erc20toL1.ts +++ b/packages/integration-tests/src/playbook/deploy/erc20toL1.ts @@ -7,14 +7,14 @@ import { Helper } from "../../helper"; const helper = new Helper(); async function main() { // TODO: fix - // const [deployer] = await ethers.getSigners(); - // console.log("Deploying contracts with the account:", deployer.address); - // const weiAmount = (await deployer.getBalance()).toString(); - // console.log("Account balance:", await ethers.utils.formatEther(weiAmount)); - // const contract = await ethers.getContractFactory("L1"); - // const token = await contract.deploy(Wallets.richWalletAddress, localConfig.l1GasLimit); - // const contractAddress = await token.getAddress(); - // await helper.writeFile(Path.absolutePathToBufferFiles, Buffer.L1, contractAddress); + const [deployer] = await ethers.getSigners(); + console.log("Deploying contracts with the account:", deployer.address); + const weiAmount = (await deployer.getBalance()).toString(); + console.log("Account balance:", await ethers.utils.formatEther(weiAmount)); + const contract = await ethers.getContractFactory("L1"); + const token = await contract.deploy(Wallets.richWalletAddress, localConfig.l1GasLimit); + const contractAddress = await token.getAddress(); + await helper.writeFile(Path.absolutePathToBufferFiles, Buffer.L1, contractAddress); } main() diff --git a/packages/integration-tests/src/playbook/deploy/erc20toL2.ts b/packages/integration-tests/src/playbook/deploy/erc20toL2.ts index 90826b786..f241bfa07 100644 --- a/packages/integration-tests/src/playbook/deploy/erc20toL2.ts +++ b/packages/integration-tests/src/playbook/deploy/erc20toL2.ts @@ -1,6 +1,5 @@ import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; -// import { localConfig } from "../../config"; import { Buffer, Path } from "../../constants"; import { Helper } from "../../helper"; import getWallet from "../utils/getWallet"; diff --git a/packages/integration-tests/src/playbook/deploy/use-multitransferETH.ts b/packages/integration-tests/src/playbook/deploy/use-multitransferETH.ts index 596085f50..59fb7e6ac 100644 --- a/packages/integration-tests/src/playbook/deploy/use-multitransferETH.ts +++ b/packages/integration-tests/src/playbook/deploy/use-multitransferETH.ts @@ -1,5 +1,5 @@ import * as ethers from "ethers"; -import { Provider, Wallet } from "zksync-web3"; +import { Provider, Wallet } from "zksync-ethers"; import { localConfig } from "../../config"; import { Buffer, Path, Token, Wallets } from "../../constants"; @@ -21,9 +21,9 @@ export default async function callMultiTransferETH(hre: HardhatRuntimeEnvironmen const customTokenI = await helper.readFile(Path.absolutePathToBufferFiles, Buffer.L2); const customTokenII = await helper.readFile(Path.absolutePathToBufferFiles, Buffer.L2deposited); // amount of funds - const ethAmount = ethers.utils.parseEther("0.0001"); - const customTokenIAmount = ethers.utils.parseUnits("0.01", 18); - const customTokenIIAmount = ethers.utils.parseUnits("0.01", 18); + const ethAmount = ethers.parseEther("0.0001"); + const customTokenIAmount = ethers.parseUnits("0.01", 18); + const customTokenIIAmount = ethers.parseUnits("0.01", 18); console.log(`Running deploy script for the contract`); @@ -34,12 +34,12 @@ export default async function callMultiTransferETH(hre: HardhatRuntimeEnvironmen const attachedContract = await hre.ethers.getContractAt(contractName, contractAddress, signer); // top up the contract / transfer - const ethTransfer = await makeTransfer(etherAddress, ethers.utils.parseEther("0.101")); - const customToken1Transfer = await makeTransfer(customTokenI, ethers.utils.parseUnits("1", 18)); - const customToken2Transfer = await makeTransfer(customTokenII, ethers.utils.parseUnits("1", 18)); + const ethTransfer = await makeTransfer(etherAddress, ethers.parseEther("0.101")); + const customToken1Transfer = await makeTransfer(customTokenI, ethers.parseUnits("1", 18)); + const customToken2Transfer = await makeTransfer(customTokenII, ethers.parseUnits("1", 18)); const multiTransferResult = await makeMultiTransfer(); - async function makeTransfer(token: string, amount: ethers.BigNumber) { + async function makeTransfer(token: string, amount: ethers.BigNumberish) { const transfer = await wallet.transfer({ to: contractAddress, token: token, @@ -54,6 +54,7 @@ export default async function callMultiTransferETH(hre: HardhatRuntimeEnvironmen return transferReceipt.transactionHash; } + // TODO FIX //call the deployed contract. async function makeMultiTransfer() { const transferFromContract = await attachedContract.multiTransfer( @@ -73,24 +74,19 @@ export default async function callMultiTransferETH(hre: HardhatRuntimeEnvironmen // Show the contract balance console.log( - `Getting ETH balance from contract API: "${ethers.utils.formatUnits( - await provider.getBalance(contractAddress), - 18 - )}"` + `Getting ETH balance from contract API: "${ethers.formatUnits(await provider.getBalance(contractAddress), 18)}"` ); // Show the balance of wallets + console.log(`balance of wallet 1 is: "${ethers.formatUnits(await provider.getBalance(richWalletAddress), 18)}" ETH`); console.log( - `balance of wallet 1 is: "${ethers.utils.formatUnits(await provider.getBalance(richWalletAddress), 18)}" ETH` - ); - console.log( - `balance of wallet 2 is: "${ethers.utils.formatUnits( + `balance of wallet 2 is: "${ethers.formatUnits( await provider.getBalance(mainWalletAddress, "latest", customTokenI), 18 )}" Custom token I` ); console.log( - `balance of wallet 3 is: "${ethers.utils.formatUnits( + `balance of wallet 3 is: "${ethers.formatUnits( await provider.getBalance(secondaryWalletAddress, "latest", customTokenII), 18 )}" Custom token II`