Skip to content

chore(entropy): deployment script for entropy upgrades #2697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require("dotenv").config({ path: ".env" });
import { utils, Wallet } from "zksync-web3";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { assert } from "chai";
import { writeFileSync } from "fs";
import { ethers } from "ethers";

function envOrErr(name: string): string {
const res = process.env[name];
if (res === undefined) {
throw new Error(`${name} environment variable is not set.`);
}
return res;
}

export default async function (hre: HardhatRuntimeEnvironment) {
// Initialize the wallet.
const wallet = Wallet.fromMnemonic(envOrErr("MNEMONIC"));

// Create deployer object and load the artifact of the contract we want to deploy.
const deployer = new Deployer(hre, wallet);

// Deposit some funds to L2 in order to be able to perform L2 transactions. Uncomment
// this if the deployment account is unfunded.
//
// const depositAmount = ethers.utils.parseEther("0.005");
// const depositHandle = await deployer.zkWallet.deposit({
// to: deployer.zkWallet.address,
// token: utils.ETH_ADDRESS,
// amount: depositAmount,
// });
// // Wait until the deposit is processed on zkSync
// await depositHandle.wait();

const entropyImplArtifact = await deployer.loadArtifact("EntropyUpgradable");
const entropyImplContract = await deployer.deploy(entropyImplArtifact);

console.log(
`Deployed Entropy implementation contract on ${entropyImplContract.address}`,
);
console.log(
"Please use this address as the candidate new implementation in the deployment script.",
);
}
Loading