File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed
Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change 11async function main ( ) {
2- const [ deployer ] = await ethers . getSigners ( ) ;
3- console . log ( "Deploying contracts with the account:" , deployer . address ) ;
4-
5- const Token = await ethers . getContractFactory ( "Token" ) ;
6- const token = await Token . deploy ( ) ;
7-
8- console . log ( "Token deployed to:" , token . address ) ;
9- }
10-
11- main ( )
12- . then ( ( ) => process . exit ( 0 ) )
13- . catch ( ( error ) => {
14- console . error ( error ) ;
15- process . exit ( 1 ) ;
16- } ) ;
17-
2+ const [ deployer ] = await ethers . getSigners ( ) ;
3+ console . log ( "Deploying contracts with the account:" , deployer . address ) ;
4+
5+ const Token = await ethers . getContractFactory ( "Token" ) ;
6+ const token = await Token . deploy ( ) ;
7+
8+ await token . deployed ( ) ; // Ensure the contract is deployed before accessing its address
9+
10+ console . log ( "Token deployed to:" , token . address ) ; // This should print the correct address
11+ }
12+
13+ main ( )
14+ . then ( ( ) => process . exit ( 0 ) )
15+ . catch ( ( error ) => {
16+ console . error ( error ) ;
17+ process . exit ( 1 ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments