mirror of
https://github.com/luxfhe/example-redact.git
synced 2026-10-30 18:13:20 +00:00
29 lines
868 B
TypeScript
29 lines
868 B
TypeScript
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
import { DeployFunction } from "hardhat-deploy/types";
|
|
import { Contract } from "ethers";
|
|
|
|
const deployMulticall3: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|
const chainId = await hre.getChainId();
|
|
console.log("chainId:", chainId);
|
|
if (chainId !== "31337") {
|
|
console.log("Skipping Multicall3 deployment on non-Hardhat chain", chainId);
|
|
return;
|
|
}
|
|
|
|
const { deployer } = await hre.getNamedAccounts();
|
|
const { deploy } = hre.deployments;
|
|
|
|
await deploy("Multicall3", {
|
|
from: deployer,
|
|
args: [],
|
|
log: true,
|
|
autoMine: true,
|
|
});
|
|
|
|
const multicall3 = await hre.ethers.getContract<Contract>("Multicall3", deployer);
|
|
console.log("Multicall3 deployed at:", multicall3.target);
|
|
};
|
|
|
|
export default deployMulticall3;
|
|
deployMulticall3.tags = ["Multicall3"];
|