Skip to content

Commit ba50072

Browse files
author
Tim McMackin
committed
Updated deployment script
1 parent 8e70113 commit ba50072

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
// scripts/deploy.js
2-
const hre = require("hardhat");
2+
import { network } from "hardhat";
33

44
async function main() {
5-
// Get the deployer account
6-
const [deployer] = await hre.ethers.getSigners();
7-
console.log("Deploying contract with account:", deployer.address);
85

9-
// Compile & get the contract factory
10-
const MyContract = await ethers.getContractFactory("PredictxtzContract");
6+
const { viem, networkName } = await network.connect();
117

12-
// Deploy the contract
13-
const DeployedContract = await MyContract.deploy();
14-
await DeployedContract.deployed();
8+
console.log(`Deploying contract to ${networkName}...`);
159

16-
console.log("Contract deployed to:", DeployedContract.address);
10+
const deployedContract = await viem.deployContract("PredictxtzContract");
11+
12+
console.log("Contract deployed to:", deployedContract.address);
1713
}
1814

1915
main()
2016
.then(() => process.exit(0))
2117
.catch((error) => {
2218
console.error("Deployment failed:", error);
2319
process.exit(1);
24-
});
20+
});

0 commit comments

Comments
 (0)