Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume DEWISME
CI
Commits
90a12fa9
Commit
90a12fa9
authored
2 weeks ago
by
Quentin Hamitouche
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deploy script
parent
bf1fc45d
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
deploy.js
scripts/deploy.js
+10
-22
No files found.
scripts/deploy.js
View file @
90a12fa9
...
...
@@ -2,32 +2,20 @@
const
hre
=
require
(
"hardhat"
);
async
function
main
()
{
console
.
log
(
"Déploiement du contrat Voting..."
);
const
[
deployer
]
=
await
hre
.
ethers
.
getSigners
();
console
.
log
(
"Deploying contracts with the account:"
,
deployer
.
address
);
try
{
// Récupération du compte de déploiement
const
[
deployer
]
=
await
hre
.
ethers
.
getSigners
();
console
.
log
(
"Déploiement avec le compte:"
,
deployer
.
address
);
const
Voting
=
await
hre
.
ethers
.
getContractFactory
(
"Voting"
);
// Compilation du contrat
const
Voting
=
await
hre
.
ethers
.
getContractFactory
(
"Voting"
);
// Déploiement du contrat
const
voting
=
await
Voting
.
deploy
();
// Attente de la confirmation du déploiement
await
voting
.
deployed
();
console
.
log
(
"Contrat Voting déployé à l'adresse:"
,
voting
.
address
);
}
catch
(
error
)
{
console
.
error
(
"Erreur détaillée:"
,
error
);
throw
error
;
}
const
voting
=
await
Voting
.
deploy
(
deployer
.
address
);
const
address
=
await
voting
.
getAddress
()
console
.
log
(
"Voting contract deployed to:"
,
address
);
}
// Exécution du script de déploiement avec gestion des erreurs
main
()
.
then
(()
=>
process
.
exit
(
0
))
.
catch
((
error
)
=>
{
console
.
error
(
"Erreur lors du déploiement:"
,
error
);
process
.
exit
(
1
);
});
\ No newline at end of file
console
.
error
(
error
);
process
.
exit
(
1
);
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment