Skip to content

Commit

Permalink
♻️ Update to latest zksync deps
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Nov 22, 2023
1 parent 9a0e59d commit 31a9cfb
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 94 deletions.
14 changes: 12 additions & 2 deletions deploy/deploy-zksync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { Wallet } from "zksync2-js";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { delay } from "../scripts/deploy";

export default async function main(hre: HardhatRuntimeEnvironment) {
// Get the private key from the configured network
Expand All @@ -22,10 +23,19 @@ export default async function main(hre: HardhatRuntimeEnvironment) {
const wallet = new Wallet(PRIVATE_KEY);
const deployer = new Deployer(hre, wallet);

const constructorArgs = ["Hello, Hardhat!"];
const artifact = await deployer.loadArtifact("Greeter");
const contract = await deployer.deploy(artifact, ["Hello, Hardhat!"]);
const contract = await deployer.deploy(artifact, constructorArgs);

await contract.waitForDeployment();
const contractAddress = await contract.getAddress();

console.log("Greeter deployed to:", await contract.getAddress());
console.log("Greeter deployed to:", contractAddress);

await delay(30000); // Wait for 30 seconds before verifying the contract

await hre.run("verify:verify", {
address: contractAddress,
constructorArguments: constructorArgs,
});
}
5 changes: 5 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "xdeployer";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-verify";
import "@matterlabs/hardhat-zksync-zksync2js";
import "@truffle/dashboard-hardhat-plugin";
import "hardhat-gas-reporter";
import "hardhat-abi-exporter";
Expand Down Expand Up @@ -653,6 +654,10 @@ const config: HardhatUserConfig = {
spacing: 2,
pretty: true,
},
sourcify: {
// Enable Sourcify verification by default
enabled: true,
},
etherscan: {
// Add your own API key by getting an account at etherscan (https://etherscan.io), snowtrace (https://snowtrace.io) etc.
// This is used for verification purposes when you want to `npx hardhat verify` your contract using Hardhat
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,24 @@
},
"devDependencies": {
"@matterlabs/hardhat-zksync-deploy": "^1.0.0",
"@matterlabs/hardhat-zksync-solc": "^1.0.0",
"@matterlabs/hardhat-zksync-verify": "^1.0.0",
"@matterlabs/hardhat-zksync-solc": "^1.0.1",
"@matterlabs/hardhat-zksync-verify": "^1.1.0",
"@matterlabs/hardhat-zksync-zksync2js": "0.0.1-beta.2",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-foundry": "^1.1.1",
"@nomicfoundation/hardhat-ledger": "^1.0.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.1.1",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.1",
"@openzeppelin/contracts": "^5.0.0",
"@tenderly/hardhat-tenderly": "^2.0.1",
"@truffle/dashboard-hardhat-plugin": "^0.2.15",
"@typechain/ethers-v6": "^0.4.3",
"@typechain/hardhat": "^8.0.3",
"@types/chai": "^4.3.10",
"@types/mocha": "^10.0.4",
"@types/node": "^20.9.2",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.9.4",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"chai": "^4.3.10",
Expand Down
Loading

0 comments on commit 31a9cfb

Please sign in to comment.