Skip to content

Commit 5c5c90f

Browse files
authored
Remove defender.proposeUpgrade and dependencies for Defender legacy (#1041)
1 parent 0710619 commit 5c5c90f

File tree

15 files changed

+32
-1241
lines changed

15 files changed

+32
-1241
lines changed

docs/modules/ROOT/pages/api-hardhat-upgrades.adoc

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -544,55 +544,6 @@ Similar to `prepareUpgrade`. This method validates and deploys the new implement
544544

545545
* `@openzeppelin/[email protected]`
546546

547-
[[defender-propose-upgrade]]
548-
== defender.proposeUpgrade
549-
550-
[source,ts]
551-
----
552-
async function proposeUpgrade(
553-
proxyAddress: string,
554-
ImplFactory: ContractFactory,
555-
opts?: {
556-
unsafeAllow?: ValidationError[],
557-
unsafeAllowRenames?: boolean,
558-
unsafeSkipStorageCheck?: boolean,
559-
constructorArgs?: unknown[],
560-
timeout?: number,
561-
pollingInterval?: number,
562-
redeployImplementation?: 'always' | 'never' | 'onchange',
563-
kind?: 'uups' | 'transparent' | 'beacon',
564-
title?: string,
565-
description?: string,
566-
multisig?: string,
567-
proxyAdmin?: string,
568-
},
569-
): Promise<{
570-
url: string,
571-
txResponse?: ethers.providers.TransactionResponse,
572-
}>
573-
----
574-
575-
NOTE: This method requires configuring a Defender Team API Key.
576-
577-
Proposes an upgrade using https://docs.openzeppelin.com/defender/admin[Defender Admin].
578-
579-
Similar to `prepareUpgrade`. This method validates and deploys the new implementation contract, but also creates an upgrade proposal in Defender Admin, for review and approval by the upgrade administrators. Supported for UUPS or Transparent proxies. Not currently supported for beacon proxies or beacons. For beacons, use `prepareUpgrade` along with a custom action in Defender Admin to upgrade the beacon to the deployed implementation.
580-
581-
*Parameters:*
582-
583-
* `proxyAddress` - the proxy address.
584-
* `ImplFactory` - the new implementation contract.
585-
* `opts` - an object with options:
586-
** `title`: title of the upgrade proposal as seen in Defender Admin, defaults to `Upgrade to 0x12345678` (using the first 8 digits of the new implementation address)
587-
** `description`: description of the upgrade proposal as seen in Defender Admin, defaults to the full implementation address.
588-
** `multisig`: address of the multisignature wallet contract with the rights to execute the upgrade. This is autodetected in https://docs.openzeppelin.com/contracts/api/proxy#TransparentUpgradeableProxy[Transparent proxies], but required for https://docs.openzeppelin.com/contracts/api/proxy#UUPSUpgradeable[UUPS proxies] (read more https://docs.openzeppelin.com/contracts/api/proxy#transparent-vs-uups[here]). Both Gnosis Safe and Gnosis MultisigWallet multisigs are supported.
589-
** `proxyAdmin`: address of the https://docs.openzeppelin.com/contracts/api/proxy#ProxyAdmin[`ProxyAdmin`] contract that manages the proxy, if exists. This is autodetected in https://docs.openzeppelin.com/contracts/api/proxy#TransparentUpgradeableProxy[Transparent proxies], but required for https://docs.openzeppelin.com/contracts/api/proxy#UUPSUpgradeable[UUPS proxies] (read more https://docs.openzeppelin.com/contracts/api/proxy#transparent-vs-uups[here]), though UUPS proxies typically do not require the usage of a ProxyAdmin.
590-
** additional options as described in <<common-options>>.
591-
592-
*Returns:*
593-
594-
* an object with the URL of the Defender proposal, and the ethers transaction response corresponding to the deployment of the new implementation contract. Note that if the new implementation contract was originally imported as a result of `forceImport`, the ethers transaction response will be undefined.
595-
596547
[[admin-change-proxy-admin]]
597548
== admin.changeProxyAdmin
598549

packages/plugin-hardhat/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.2.0 (2024-06-24)
4+
5+
- **Breaking change**: Remove `defender.proposeUpgrade` from Defender legacy. Defender users should use `defender.proposeUpgradeWithApproval` instead.
6+
37
## 3.1.1 (2024-06-03)
48

59
- Defender: Fix proxy deployments when using `constructorArgs` option, support arbitrary constructor arguments. ([#1029](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/1029))

packages/plugin-hardhat/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openzeppelin/hardhat-upgrades",
3-
"version": "3.1.1",
3+
"version": "3.2.0",
44
"description": "",
55
"repository": "https://github.com/OpenZeppelin/openzeppelin-upgrades/tree/master/packages/plugin-hardhat",
66
"license": "MIT",
@@ -35,8 +35,6 @@
3535
"sinon": "^18.0.0"
3636
},
3737
"dependencies": {
38-
"@openzeppelin/defender-admin-client": "^1.52.0",
39-
"@openzeppelin/defender-base-client": "^1.52.0",
4038
"@openzeppelin/defender-sdk-base-client": "^1.10.0",
4139
"@openzeppelin/defender-sdk-deploy-client": "^1.10.0",
4240
"@openzeppelin/defender-sdk-network-client": "^1.10.0",

packages/plugin-hardhat/src/defender-v1/propose-upgrade.ts

Lines changed: 0 additions & 99 deletions
This file was deleted.

packages/plugin-hardhat/src/defender-v1/utils.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/plugin-hardhat/src/defender-v1/verify-deployment.ts

Lines changed: 0 additions & 101 deletions
This file was deleted.

packages/plugin-hardhat/src/index.ts

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ import type {
2424
GetDeployApprovalProcessFunction,
2525
GetUpgradeApprovalProcessFunction,
2626
} from './defender/get-approval-process';
27-
import type { ProposeUpgradeFunction } from './defender-v1/propose-upgrade';
28-
import type {
29-
VerifyDeployFunction,
30-
VerifyDeployWithUploadedArtifactFunction,
31-
GetVerifyDeployArtifactFunction,
32-
GetVerifyDeployBuildInfoFunction,
33-
GetBytecodeDigestFunction,
34-
} from './defender-v1/verify-deployment';
3527

3628
export interface HardhatUpgrades {
3729
deployProxy: DeployFunction;
@@ -59,16 +51,7 @@ export interface HardhatUpgrades {
5951
};
6052
}
6153

62-
export interface DefenderV1HardhatUpgrades {
63-
proposeUpgrade: ProposeUpgradeFunction;
64-
verifyDeployment: VerifyDeployFunction;
65-
verifyDeploymentWithUploadedArtifact: VerifyDeployWithUploadedArtifactFunction;
66-
getDeploymentArtifact: GetVerifyDeployArtifactFunction;
67-
getDeploymentBuildInfo: GetVerifyDeployBuildInfoFunction;
68-
getBytecodeDigest: GetBytecodeDigestFunction;
69-
}
70-
71-
export interface DefenderHardhatUpgrades extends HardhatUpgrades, DefenderV1HardhatUpgrades {
54+
export interface DefenderHardhatUpgrades extends HardhatUpgrades {
7255
deployContract: DeployContractFunction;
7356
proposeUpgradeWithApproval: ProposeUpgradeWithApprovalFunction;
7457
getDeployApprovalProcess: GetDeployApprovalProcessFunction;
@@ -256,26 +239,6 @@ function makeUpgradesFunctions(hre: HardhatRuntimeEnvironment): HardhatUpgrades
256239
return makeFunctions(hre, false);
257240
}
258241

259-
function makeDefenderV1Functions(hre: HardhatRuntimeEnvironment): DefenderV1HardhatUpgrades {
260-
const {
261-
makeVerifyDeploy,
262-
makeVerifyDeployWithUploadedArtifact,
263-
makeGetVerifyDeployBuildInfo,
264-
makeGetVerifyDeployArtifact,
265-
makeGetBytecodeDigest,
266-
} = require('./defender-v1/verify-deployment');
267-
const { makeProposeUpgrade } = require('./defender-v1/propose-upgrade');
268-
269-
return {
270-
proposeUpgrade: makeProposeUpgrade(hre),
271-
verifyDeployment: makeVerifyDeploy(hre),
272-
verifyDeploymentWithUploadedArtifact: makeVerifyDeployWithUploadedArtifact(hre),
273-
getDeploymentArtifact: makeGetVerifyDeployArtifact(hre),
274-
getDeploymentBuildInfo: makeGetVerifyDeployBuildInfo(hre),
275-
getBytecodeDigest: makeGetBytecodeDigest(hre),
276-
};
277-
}
278-
279242
function makeDefenderFunctions(hre: HardhatRuntimeEnvironment): DefenderHardhatUpgrades {
280243
const { makeDeployContract } = require('./deploy-contract');
281244
const { makeProposeUpgradeWithApproval } = require('./defender/propose-upgrade-with-approval');
@@ -285,7 +248,6 @@ function makeDefenderFunctions(hre: HardhatRuntimeEnvironment): DefenderHardhatU
285248

286249
return {
287250
...makeFunctions(hre, true),
288-
...makeDefenderV1Functions(hre),
289251
deployContract: makeDeployContract(hre, true),
290252
proposeUpgradeWithApproval: makeProposeUpgradeWithApproval(hre, true),
291253
getDeployApprovalProcess: makeGetDeployApprovalProcess(hre),

0 commit comments

Comments
 (0)