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
2909ae74
Commit
2909ae74
authored
Mar 19, 2025
by
timothe 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t
parent
0de29dc9
Pipeline
#3113
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
deploy.js
scripts/deploy.js
+20
-12
No files found.
scripts/deploy.js
View file @
2909ae74
// Script de déploiement du contrat Voting
// Script de déploiement du contrat Voting
const
{
ethers
}
=
require
(
"hardhat"
);
const
hre
=
require
(
"hardhat"
);
async
function
main
()
{
async
function
main
()
{
console
.
log
(
"Déploiement du contrat Voting..."
);
console
.
log
(
"Déploiement du contrat Voting..."
);
// Récupération du compte de déploiement
try
{
const
[
deployer
]
=
await
ethers
.
getSigners
();
// Utiliser directement l'API ethers depuis hardhat
console
.
log
(
"Déploiement avec le compte:"
,
deployer
.
address
);
const
ethers
=
hre
.
ethers
;
// Récupération du compte de déploiement
const
[
deployer
]
=
await
ethers
.
getSigners
();
console
.
log
(
"Déploiement avec le compte:"
,
deployer
.
address
);
// Compilation du contrat
// Compilation du contrat
const
Voting
=
await
ethers
.
getContractFactory
(
"Voting"
);
const
Voting
=
await
ethers
.
getContractFactory
(
"Voting"
);
// Déploiement du contrat
// Déploiement du contrat
const
voting
=
await
Voting
.
deploy
();
const
voting
=
await
Voting
.
deploy
();
// Attente de la confirmation du déploiement
// Attente de la confirmation du déploiement
await
voting
.
deployed
();
await
voting
.
deployed
();
console
.
log
(
"Contrat Voting déployé à l'adresse:"
,
voting
.
address
);
console
.
log
(
"Contrat Voting déployé à l'adresse:"
,
voting
.
address
);
}
catch
(
error
)
{
console
.
error
(
"Erreur détaillée:"
,
error
);
throw
error
;
}
}
}
// Exécution du script de déploiement avec gestion des erreurs
// Exécution du script de déploiement avec gestion des erreurs
...
...
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