File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
etherlink-prediction/backend/scripts Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 11// scripts/deploy.js
2- const hre = require ( "hardhat" ) ;
2+ import { network } from "hardhat" ;
33
44async 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
1915main ( )
2016 . then ( ( ) => process . exit ( 0 ) )
2117 . catch ( ( error ) => {
2218 console . error ( "Deployment failed:" , error ) ;
2319 process . exit ( 1 ) ;
24- } ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments