File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,23 @@ async function main() {
6262 throw new Error ( "ElectionDatabase address is missing" ) ;
6363 }
6464
65+ try {
66+ const voterDatabaseContract = await hre . viem . getContractAt (
67+ "VoterDatabase" ,
68+ voterDatabaseAddress
69+ ) ;
70+ const candidateDatabaseContract = await hre . viem . getContractAt (
71+ "CandidateDatabase" ,
72+ candidateDatabaseAddress
73+ ) ;
74+
75+ await voterDatabaseContract . write . addAdmin ( [ electionDatabaseAddress ] ) ;
76+ await candidateDatabaseContract . write . addAdmin ( [ electionDatabaseAddress ] ) ;
77+ } catch ( error ) {
78+ console . error ( error ) ;
79+ throw error ;
80+ }
81+
6582 if (
6683 hre . network . config . chainId === sepolia . id &&
6784 process . env . ETHERSCAN_API_KEY
@@ -84,6 +101,7 @@ main()
84101 process . exit ( 0 ) ;
85102 } )
86103 . catch ( ( error ) => {
104+ console . log ( "Something went wrong! See the logs for more information." ) ;
87105 console . error ( error ) ;
88106 process . exit ( 1 ) ;
89107 } ) ;
You can’t perform that action at this time.
0 commit comments