Skip to content

Commit 5aab212

Browse files
authored
feat(host-contracts): improve and fix upgrade tasks (#327)
1 parent a26061d commit 5aab212

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

host-contracts/tasks/upgradeProxy.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ task('task:upgradeACL')
8383
'newImplementation',
8484
'The new implementation solidity contract path and name, eg: examples/ACLUpgradedExample.sol:ACLUpgradedExample',
8585
)
86-
.addParam('privateKey', 'The deployer private key')
8786
.addOptionalParam(
8887
'verifyContract',
8988
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
90-
false,
89+
true,
9190
types.boolean,
9291
)
9392
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
93+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
9494
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.acl'));
9595
const proxyAddress = parsedEnv.ACL_CONTRACT_ADDRESS;
9696
await upgradeCurrentToNewACL(
97-
taskArguments.privateKey,
97+
privateKey,
9898
proxyAddress,
9999
taskArguments.currentImplementation,
100100
taskArguments.newImplementation,
@@ -114,18 +114,18 @@ task('task:upgradeFHEVMExecutor')
114114
'newImplementation',
115115
'The new implementation solidity contract path and name, eg: examples/FHEVMExecutorUpgradedExample.sol:FHEVMExecutorUpgradedExample',
116116
)
117-
.addParam('privateKey', 'The deployer private key')
118117
.addOptionalParam(
119118
'verifyContract',
120119
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
121-
false,
120+
true,
122121
types.boolean,
123122
)
124123
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
124+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
125125
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.exec'));
126-
const proxyAddress = parsedEnv.TFHE_EXECUTOR_CONTRACT_ADDRESS;
126+
const proxyAddress = parsedEnv.FHEVM_EXECUTOR_CONTRACT_ADDRESS;
127127
await upgradeCurrentToNew(
128-
taskArguments.privateKey,
128+
privateKey,
129129
proxyAddress,
130130
taskArguments.currentImplementation,
131131
taskArguments.newImplementation,
@@ -145,18 +145,18 @@ task('task:upgradeKMSVerifier')
145145
'newImplementation',
146146
'The new implementation solidity contract path and name, eg: examples/KMSVerifierUpgradedExample.sol:KMSVerifierUpgradedExample',
147147
)
148-
.addParam('privateKey', 'The deployer private key')
149148
.addOptionalParam(
150149
'verifyContract',
151150
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
152-
false,
151+
true,
153152
types.boolean,
154153
)
155154
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
155+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
156156
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.kmsverifier'));
157157
const proxyAddress = parsedEnv.KMS_VERIFIER_CONTRACT_ADDRESS;
158158
await upgradeCurrentToNew(
159-
taskArguments.privateKey,
159+
privateKey,
160160
proxyAddress,
161161
taskArguments.currentImplementation,
162162
taskArguments.newImplementation,
@@ -176,18 +176,18 @@ task('task:upgradeInputVerifier')
176176
'newImplementation',
177177
'The new implementation solidity contract path and name, eg: contracts/InputVerifier2.sol:InputVerifier',
178178
)
179-
.addParam('privateKey', 'The deployer private key')
180179
.addOptionalParam(
181180
'verifyContract',
182181
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
183-
false,
182+
true,
184183
types.boolean,
185184
)
186185
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
186+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
187187
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.inputverifier'));
188188
const proxyAddress = parsedEnv.INPUT_VERIFIER_CONTRACT_ADDRESS;
189189
await upgradeCurrentToNew(
190-
taskArguments.privateKey,
190+
privateKey,
191191
proxyAddress,
192192
taskArguments.currentImplementation,
193193
taskArguments.newImplementation,
@@ -207,18 +207,18 @@ task('task:upgradeHCULimit')
207207
'newImplementation',
208208
'The new implementation solidity contract path and name, eg: examples/HCULimitUpgradedExample.sol:HCULimitUpgradedExample',
209209
)
210-
.addParam('privateKey', 'The deployer private key')
211210
.addOptionalParam(
212211
'verifyContract',
213212
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
214-
false,
213+
true,
215214
types.boolean,
216215
)
217216
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
217+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
218218
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.hculimit'));
219219
const proxyAddress = parsedEnv.HCU_LIMIT_CONTRACT_ADDRESS;
220220
await upgradeCurrentToNew(
221-
taskArguments.privateKey,
221+
privateKey,
222222
proxyAddress,
223223
taskArguments.currentImplementation,
224224
taskArguments.newImplementation,
@@ -238,18 +238,18 @@ task('task:upgradeDecryptionOracleContract')
238238
'newImplementation',
239239
'The new implementation solidity contract path and name, eg: example/DecryptionOracleUpgradedExample.sol:DecryptionOracleUpgradedExample',
240240
)
241-
.addParam('privateKey', 'The deployer private key')
242241
.addOptionalParam(
243242
'verifyContract',
244243
'Verify new implementation on Etherscan (for eg if deploying on Sepolia or Mainnet)',
245-
false,
244+
true,
246245
types.boolean,
247246
)
248247
.setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) {
248+
const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY');
249249
const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.decryptionoracle'));
250250
const proxyAddress = parsedEnv.DECRYPTION_ORACLE_ADDRESS;
251251
await upgradeCurrentToNew(
252-
taskArguments.privateKey,
252+
privateKey,
253253
proxyAddress,
254254
taskArguments.currentImplementation,
255255
taskArguments.newImplementation,

0 commit comments

Comments
 (0)