diff --git a/examples/basic-example/package.json b/examples/basic-example/package.json index 6adde7a37..5c7521a60 100644 --- a/examples/basic-example/package.json +++ b/examples/basic-example/package.json @@ -36,8 +36,8 @@ "ethers": "^6.12.2", "zksync-ethers": "^6.11.2", "@matterlabs/zksync-contracts": "^0.6.1", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2" + "@openzeppelin/contracts": "^4.9.6", + "@openzeppelin/contracts-upgradeable": "^4.9.6" }, "prettier": { "tabWidth": 4, diff --git a/examples/node-example/package.json b/examples/node-example/package.json index e864c180f..c044f60bf 100644 --- a/examples/node-example/package.json +++ b/examples/node-example/package.json @@ -42,8 +42,8 @@ "ethers": "^6.12.2", "zksync-ethers": "^6.11.2", "@matterlabs/zksync-contracts": "^0.6.1", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2" + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2" }, "prettier": { "tabWidth": 4, diff --git a/examples/noninline-libraries-example/package.json b/examples/noninline-libraries-example/package.json index 2a9675f26..8af9880b7 100644 --- a/examples/noninline-libraries-example/package.json +++ b/examples/noninline-libraries-example/package.json @@ -36,8 +36,8 @@ "ethers": "^6.12.2", "zksync-ethers": "^6.11.2", "@matterlabs/zksync-contracts": "^0.6.1", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2" + "@openzeppelin/contracts": "^5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2" }, "prettier": { "tabWidth": 4, diff --git a/examples/upgradable-example-l1/contracts/BoxUups.sol b/examples/upgradable-example-l1/contracts/BoxUups.sol index 0b3345dd7..0bd67e5bb 100644 --- a/examples/upgradable-example-l1/contracts/BoxUups.sol +++ b/examples/upgradable-example-l1/contracts/BoxUups.sol @@ -11,7 +11,7 @@ contract BoxUups is Initializable, UUPSUpgradeable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } diff --git a/examples/upgradable-example-l1/package.json b/examples/upgradable-example-l1/package.json index a786e41ae..6fbd4d022 100644 --- a/examples/upgradable-example-l1/package.json +++ b/examples/upgradable-example-l1/package.json @@ -15,7 +15,7 @@ "clean": "rimraf dist" }, "devDependencies": { - "@openzeppelin/contracts": "^4.9.2", + "@openzeppelin/contracts": "^5.0.2", "@types/node": "^18.11.17", "@typescript-eslint/eslint-plugin": "6.13.1", "@typescript-eslint/parser": "6.13.1", @@ -35,7 +35,8 @@ "@matterlabs/hardhat-zksync-solc": "workspace:^", "@matterlabs/hardhat-zksync-upgradable": "workspace:^", "@matterlabs/hardhat-zksync-verify": "workspace:^", - "@openzeppelin/contracts-upgradeable": "^4.9.2", + "@nomicfoundation/hardhat-ethers": "3.0.6", + "@openzeppelin/contracts-upgradeable": "^5.0.2", "chalk": "^4.1.2", "ethers": "^6.12.2", "hardhat": "^2.22.5", diff --git a/examples/upgradable-example-l1/scripts/deploy-box-uups.ts b/examples/upgradable-example-l1/scripts/deploy-box-uups.ts index e660872e4..553ac7039 100644 --- a/examples/upgradable-example-l1/scripts/deploy-box-uups.ts +++ b/examples/upgradable-example-l1/scripts/deploy-box-uups.ts @@ -2,7 +2,7 @@ import * as hre from 'hardhat'; async function main() { const Box = await hre.ethers.getContractFactory("BoxUups"); - const box = await hre.upgrades.deployProxy(Box,[42],{ initializer: 'initialize'}); + const box = await hre.upgrades.deployProxy(Box,[42],{ initializer: 'initialize' }); await box.waitForDeployment() console.info("Box deployed address: " + await box.getAddress()) } diff --git a/examples/upgradable-example-l1/scripts/upgrade-box-uups.ts b/examples/upgradable-example-l1/scripts/upgrade-box-uups.ts index 902084bc1..72aef9544 100644 --- a/examples/upgradable-example-l1/scripts/upgrade-box-uups.ts +++ b/examples/upgradable-example-l1/scripts/upgrade-box-uups.ts @@ -2,7 +2,7 @@ import * as hre from 'hardhat'; async function main() { const Box = await hre.ethers.getContractFactory("BoxUups"); - const box = await hre.upgrades.deployProxy(Box,[42],{ initializer: 'initialize'}); + const box = await hre.upgrades.deployProxy(Box,[42],{ initializer: 'initialize' }); await box.waitForDeployment() console.info("Box deployed address: " + await box.getAddress()) diff --git a/examples/upgradable-example/contracts/BoxUups.sol b/examples/upgradable-example/contracts/BoxUups.sol index 0b3345dd7..0bd67e5bb 100644 --- a/examples/upgradable-example/contracts/BoxUups.sol +++ b/examples/upgradable-example/contracts/BoxUups.sol @@ -11,7 +11,7 @@ contract BoxUups is Initializable, UUPSUpgradeable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } diff --git a/examples/upgradable-example/package.json b/examples/upgradable-example/package.json index 65528bd2a..50129ff0a 100644 --- a/examples/upgradable-example/package.json +++ b/examples/upgradable-example/package.json @@ -15,7 +15,7 @@ "clean": "rimraf dist" }, "devDependencies": { - "@openzeppelin/contracts": "^4.9.2", + "@openzeppelin/contracts": "^5.0.2", "@types/node": "^18.11.17", "@typescript-eslint/eslint-plugin": "6.13.1", "@typescript-eslint/parser": "6.13.1", @@ -38,7 +38,9 @@ "@matterlabs/hardhat-zksync-solc": "workspace:^", "@matterlabs/hardhat-zksync-upgradable": "workspace:^", "@matterlabs/hardhat-zksync-verify": "workspace:^", - "@openzeppelin/contracts-upgradeable": "^4.9.2", + "@nomicfoundation/hardhat-ethers": "3.0.6", + "@openzeppelin/contracts-upgradeable": "^5.0.2", + "@openzeppelin/hardhat-upgrades": "^3.2.1", "chalk": "^4.1.2", "zksync": "^0.13.1" }, diff --git a/examples/upgradable-example/scripts/deploy-box-uups.ts b/examples/upgradable-example/scripts/deploy-box-uups.ts index c7c70881d..32ac0dde2 100644 --- a/examples/upgradable-example/scripts/deploy-box-uups.ts +++ b/examples/upgradable-example/scripts/deploy-box-uups.ts @@ -14,7 +14,7 @@ async function main() { const deployer = new Deployer(hre, zkWallet); const contract = await deployer.loadArtifact(contractName); - const box = await hre.upgrades.deployProxy(deployer.zkWallet, contract, [42], { initializer: 'initialize' }); + const box = await hre.upgrades.deployProxy(deployer.zkWallet, contract, [42], { initializer: 'initialize'}); await box.waitForDeployment(); diff --git a/packages/hardhat-zksync-upgradable/README.md b/packages/hardhat-zksync-upgradable/README.md index c6783b18a..d7a913f25 100644 --- a/packages/hardhat-zksync-upgradable/README.md +++ b/packages/hardhat-zksync-upgradable/README.md @@ -282,7 +282,7 @@ const config: HardhatUserConfig = { ### 🕹 Command list -`yarn hardhat deploy-zksync:proxy --contract-name [] [--constructor-args ] [--initializer ] [--no-compile] [--deployment-type-impl ] [--salt-impl ] [--deployment-type-proxy ] [--salt-proxy ]` +`yarn hardhat deploy-zksync:proxy --contract-name [] [--constructor-args ] [--initializer ] [--no-compile] [--initial-owner ] [--deployment-type-impl ] [--salt-impl ] [--deployment-type-proxy ] [--salt-proxy ]` When executed, this command will automatically determine whether the deployment is for a Transparent or UUPS proxy. If the Transparent proxy is chosen, it will deploy implementation, admin, and proxy. @@ -293,7 +293,7 @@ If the UUPS proxy is chosen, it will deploy implementation and proxy. When executed, this command upgrade UUPS or Transparent implementation. To upgrade a implementation we need to specify proxy address, add `--proxy-address ` argument, e.g. `yarn hardhat upgrade-zksync:proxy --contract-name BoxV2 --proxy-address 0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520`. -`yarn hardhat deploy-zksync:beacon --contract-name [] [--constructor-args ] [--initializer ] [--deployment-type-impl ] [--salt-impl ] [--deployment-type-proxy ] [--salt-proxy ] [--no-compile]` +`yarn hardhat deploy-zksync:beacon --contract-name [] [--constructor-args ] [--initializer ] [--deployment-type-impl ] [--salt-impl ] [--deployment-type-proxy ] [--salt-proxy ] [--initial-owner ] [--no-compile]` When executed, this command deploys the provided implementation, beacon and proxy on the specified network, using the provided contract constructor arguments. @@ -319,6 +319,7 @@ module.exports = [ ``` - To provide a initializer method name at deploy tasks, add `--initializer `, e.g. `hardhat deploy-zksync:proxy --contract-name Contract --initializer store`. If this parameter is omitted, the default value will be `initialize`. - To allows the task to skip the compilation process, add `--no-compile` argument, e.g. `hardhat deploy-zksync:beacon --contract-name Contract --no-compile`. +- To specify inital contract owner, add `--initial-owner` argument, e.g `hardhat deploy-zksync:beacon --contract-name Contract --initial-owner 0xa61464658AfeAf65CccaaFD3a512b69A83B77618`. If this argument is ommited wallet address will be used. - To allows the task to specify which deployer smart contract function will be called for implementation, add `--deployment-type-impl` argument, e.g. `hardhat deploy-zksync:beacon --contract-name Greeter 'Hello' --deployment-type-impl create2`. - To allows the task to specify which deployer smart contract function will be called for proxy, add `--deployment-type-proxy` argument, e.g. `hardhat deploy-zksync:beacon --contract-name Greeter 'Hello' --deployment-type-proxy create2`. - To specify which salt will be used in deployment of the implementation, add `--salt-impl` argument, e.g. `hardhat deploy-zksync:beacon --contract-name Greeter 'Hello' --salt-impl 0x42737956734178574166864921632769419836642485081335718122152413290` diff --git a/packages/hardhat-zksync-upgradable/package.json b/packages/hardhat-zksync-upgradable/package.json index 83d262fc2..f57596fce 100644 --- a/packages/hardhat-zksync-upgradable/package.json +++ b/packages/hardhat-zksync-upgradable/package.json @@ -36,10 +36,12 @@ "@matterlabs/hardhat-zksync-deploy": "workspace:^", "@matterlabs/hardhat-zksync-solc": "workspace:^", "@matterlabs/hardhat-zksync-ethers": "workspace:^", - "@openzeppelin/contracts-hardhat-zksync-upgradable": "npm:@openzeppelin/contracts@^4.9.2", - "@openzeppelin/hardhat-upgrades": "~2.5.1", - "@openzeppelin/upgrades-core": "^1.31.3", - "@openzeppelin/defender-admin-client": "^1.52.0", + "@openzeppelin/contracts-hardhat-zksync-upgradable": "npm:@openzeppelin/contracts@^5.0.2", + "@openzeppelin/hardhat-upgrades": "^3.2.1", + "@openzeppelin/upgrades-core": "^1.37.0", + "@openzeppelin/defender-sdk-base-client": "^1.10.0", + "@openzeppelin/defender-sdk-deploy-client": "^1.10.0", + "@openzeppelin/defender-sdk-network-client": "^1.10.0", "chalk": "^4.1.2", "compare-versions": "^6.1.0", "ethereumjs-util": "^7.1.5", diff --git a/packages/hardhat-zksync-upgradable/src/admin.ts b/packages/hardhat-zksync-upgradable/src/admin.ts index 6bbec59da..c2636475c 100644 --- a/packages/hardhat-zksync-upgradable/src/admin.ts +++ b/packages/hardhat-zksync-upgradable/src/admin.ts @@ -1,62 +1,28 @@ -import chalk from 'chalk'; -import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import { getAdminAddress } from '@openzeppelin/upgrades-core'; -import { Wallet, Contract } from 'zksync-ethers'; -import { Manifest } from './core/manifest'; -import { getAdminFactory } from './proxy-deployment/deploy-proxy-admin'; -import { ZkSyncUpgradablePluginError } from './errors'; +import { Wallet } from 'zksync-ethers'; +import { attachProxyAdminV4 } from './utils/attach-abi'; export type ChangeAdminFunction = (proxyAddress: string, newAdmin: string, wallet: Wallet) => Promise; -export type TransferProxyAdminOwnershipFunction = (newOwner: string, wallet: Wallet) => Promise; -export type GetInstanceFunction = (wallet: Wallet) => Promise; +export type TransferProxyAdminOwnershipFunction = ( + proxyAddress: string, + newOwner: string, + wallet: Wallet, +) => Promise; -export function makeChangeProxyAdmin(hre: HardhatRuntimeEnvironment): ChangeAdminFunction { +export function makeChangeProxyAdmin(): ChangeAdminFunction { return async function changeProxyAdmin(proxyAddress, newAdmin, wallet: Wallet) { - const proxyAdminManifest = await getManifestAdmin(hre, wallet); - const proxyAdminAddress = await getAdminAddress(wallet.provider, proxyAddress); - if ((await proxyAdminManifest.getAddress()) !== proxyAdminAddress) { - throw new ZkSyncUpgradablePluginError('Proxy admin is not the one registered in the network manifest'); - } else if ((await proxyAdminManifest.getAddress()) !== newAdmin) { - await proxyAdminManifest.changeProxyAdmin(proxyAddress, newAdmin); - } + const admin = await attachProxyAdminV4(proxyAdminAddress, wallet); + await admin.changeProxyAdmin(proxyAddress, newAdmin); }; } -export function makeTransferProxyAdminOwnership(hre: HardhatRuntimeEnvironment): TransferProxyAdminOwnershipFunction { - return async function transferProxyAdminOwnership(newOwner, wallet: Wallet) { - const admin = await getManifestAdmin(hre, wallet); +export function makeTransferProxyAdminOwnership(): TransferProxyAdminOwnershipFunction { + return async function transferProxyAdminOwnership(proxyAddress: string, newOwner, wallet: Wallet) { + const proxyAdminAddress = await getAdminAddress(wallet.provider, proxyAddress); + const admin = await attachProxyAdminV4(proxyAdminAddress, wallet); await admin.transferOwnership(newOwner); - - const manifest = await Manifest.forNetwork(wallet.provider); - const { proxies } = await manifest.read(); - for (const { address, kind } of proxies) { - if ((await admin.getAddress()) === (await getAdminAddress(wallet.provider, address))) { - console.info(chalk.green(`${address} (${kind}) proxy ownership transfered through admin proxy`)); - } else { - console.info(chalk.red(`${address} (${kind}) proxy ownership not affected by admin proxy`)); - } - } - }; -} - -export function makeGetInstanceFunction(hre: HardhatRuntimeEnvironment): GetInstanceFunction { - return async function getInstance(wallet: Wallet) { - return await getManifestAdmin(hre, wallet); }; } - -export async function getManifestAdmin(hre: HardhatRuntimeEnvironment, wallet: Wallet): Promise { - const manifest = await Manifest.forNetwork(wallet.provider); - const manifestAdmin = await manifest.getAdmin(); - const proxyAdminAddress = manifestAdmin?.address; - - if (proxyAdminAddress === undefined) { - throw new ZkSyncUpgradablePluginError('No ProxyAdmin was found in the network manifest'); - } - - const adminFactory = await getAdminFactory(hre, wallet); - return adminFactory.attach(proxyAdminAddress); -} diff --git a/packages/hardhat-zksync-upgradable/src/core/validate.ts b/packages/hardhat-zksync-upgradable/src/core/validate.ts index 619fef4ee..d01c9415c 100644 --- a/packages/hardhat-zksync-upgradable/src/core/validate.ts +++ b/packages/hardhat-zksync-upgradable/src/core/validate.ts @@ -253,25 +253,25 @@ function* getStateVariableErrors( ): Generator { for (const varDecl of contractDef.nodes) { if (isNodeType('VariableDeclaration', varDecl)) { - if (!varDecl.constant && !isNullish(varDecl.value)) { + if (varDecl.mutability === 'immutable') { if ( - !skipCheck('state-variable-assignment', contractDef) && - !skipCheck('state-variable-assignment', varDecl) + !skipCheck('state-variable-immutable', contractDef) && + !skipCheck('state-variable-immutable', varDecl) ) { yield { - kind: 'state-variable-assignment', + kind: 'state-variable-immutable', name: varDecl.name, src: decodeSrc(varDecl), }; } - } - if (varDecl.mutability === 'immutable') { + } else if (!varDecl.constant && !isNullish(varDecl.value)) { + // Assignments are only a concern for non-immutable variables if ( - !skipCheck('state-variable-immutable', contractDef) && - !skipCheck('state-variable-immutable', varDecl) + !skipCheck('state-variable-assignment', contractDef) && + !skipCheck('state-variable-assignment', varDecl) ) { yield { - kind: 'state-variable-immutable', + kind: 'state-variable-assignment', name: varDecl.name, src: decodeSrc(varDecl), }; diff --git a/packages/hardhat-zksync-upgradable/src/extension-generator.ts b/packages/hardhat-zksync-upgradable/src/extension-generator.ts index 19a1097e5..c8a9c25a4 100644 --- a/packages/hardhat-zksync-upgradable/src/extension-generator.ts +++ b/packages/hardhat-zksync-upgradable/src/extension-generator.ts @@ -20,11 +20,10 @@ export class ZkSyncGenerator implements Generator { const { makeDeployBeacon } = require('./proxy-deployment/deploy-beacon'); const { makeDeployBeaconProxy } = require('./proxy-deployment/deploy-beacon-proxy'); const { makeUpgradeBeacon } = require('./proxy-upgrade/upgrade-beacon'); - const { makeDeployProxyAdmin } = require('./proxy-deployment/deploy-proxy-admin'); const { makeEstimateGasProxy } = require('./gas-estimation/estimate-gas-proxy'); const { makeEstimateGasBeacon } = require('./gas-estimation/estimate-gas-beacon'); const { makeEstimateGasBeaconProxy } = require('./gas-estimation/estimate-gas-beacon-proxy'); - const { makeGetInstanceFunction, makeChangeProxyAdmin, makeTransferProxyAdminOwnership } = require('./admin'); + const { makeChangeProxyAdmin, makeTransferProxyAdminOwnership } = require('./admin'); return { deployProxy: wrapMakeFunction(this._hre, makeDeployProxy(this._hre)), upgradeProxy: wrapMakeFunction(this._hre, makeUpgradeProxy(this._hre)), @@ -32,9 +31,7 @@ export class ZkSyncGenerator implements Generator { deployBeacon: wrapMakeFunction(this._hre, makeDeployBeacon(this._hre)), deployBeaconProxy: wrapMakeFunction(this._hre, makeDeployBeaconProxy(this._hre)), upgradeBeacon: wrapMakeFunction(this._hre, makeUpgradeBeacon(this._hre)), - deployProxyAdmin: wrapMakeFunction(this._hre, makeDeployProxyAdmin(this._hre)), admin: { - getInstance: wrapMakeFunction(this._hre, makeGetInstanceFunction(this._hre)), changeProxyAdmin: wrapMakeFunction(this._hre, makeChangeProxyAdmin(this._hre)), transferProxyAdminOwnership: wrapMakeFunction(this._hre, makeTransferProxyAdminOwnership(this._hre)), }, diff --git a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon-proxy.ts b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon-proxy.ts index 400ad337b..fdd1b81f3 100644 --- a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon-proxy.ts +++ b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon-proxy.ts @@ -1,14 +1,11 @@ import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import chalk from 'chalk'; -import assert from 'assert'; -import path from 'path'; import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; import { DeployProxyOptions } from '../utils/options'; import { ZkSyncUpgradablePluginError } from '../errors'; import { convertGasPriceToEth } from '../utils/utils-general'; -import { BEACON_PROXY_JSON } from '../constants'; -import { getUpgradableContracts } from '../utils'; +import { getBeaconProxyArtifact } from '../utils/factories'; import { getMockedBeaconData } from './estimate-gas-beacon'; export type EstimateBeaconGasFunction = ( @@ -27,11 +24,7 @@ export function makeEstimateGasBeaconProxy(hre: HardhatRuntimeEnvironment): Esti ) { const { mockedBeaconAddress, data } = await getMockedBeaconData(deployer, hre, args, opts); - const beaconProxyPath = (await hre.artifacts.getArtifactPaths()).find((artifactPath) => - artifactPath.includes(path.sep + getUpgradableContracts().BeaconProxy + path.sep + BEACON_PROXY_JSON), - ); - assert(beaconProxyPath, 'Beacon proxy artifact not found'); - const beaconProxyContract = await import(beaconProxyPath); + const beaconProxyContract = await getBeaconProxyArtifact(hre); try { const beaconProxyGasCost = await deployer.estimateDeployFee(beaconProxyContract, [ diff --git a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon.ts b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon.ts index 791d32e26..9c2525d0c 100644 --- a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon.ts +++ b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-beacon.ts @@ -1,18 +1,15 @@ import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import * as ethers from 'ethers'; import chalk from 'chalk'; -import assert from 'assert'; -import path from 'path'; + import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; import { DeployProxyOptions } from '../utils/options'; import { ZkSyncUpgradablePluginError } from '../errors'; import { convertGasPriceToEth, getInitializerData } from '../utils/utils-general'; -import { UPGRADABLE_BEACON_JSON } from '../constants'; -import { getAdminArtifact } from '../proxy-deployment/deploy-proxy-admin'; import { getChainId } from '../core/provider'; -import { getUpgradableContracts } from '../utils'; +import { getProxyAdminArtifact, getUpgradableBeaconArtifact } from '../utils/factories'; export type EstimateGasFunction = ( deployer: Deployer, @@ -35,7 +32,7 @@ export async function getMockedBeaconData( } const mockedBeaconAddress = await getDeployedBeaconAddress(deployer); - const mockArtifact = await getAdminArtifact(hre); + const mockArtifact = await getProxyAdminArtifact(hre); const data = getInitializerData(new ethers.Interface(mockArtifact.abi), args, opts.initializer); return { mockedBeaconAddress, data }; @@ -74,15 +71,13 @@ export function makeEstimateGasBeacon(hre: HardhatRuntimeEnvironment): EstimateG ), ); } - - const upgradableBeaconPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().UpgradeableBeacon + path.sep + UPGRADABLE_BEACON_JSON), - ); - assert(upgradableBeaconPath, 'Upgradable beacon artifact not found'); - const upgradeableBeaconContract = await import(upgradableBeaconPath); + const upgradeableBeaconContract = await getUpgradableBeaconArtifact(hre); try { - beaconGasCost = await deployer.estimateDeployFee(upgradeableBeaconContract, [mockedBeaconAddress]); + beaconGasCost = await deployer.estimateDeployFee(upgradeableBeaconContract, [ + mockedBeaconAddress, + opts.initialOwner ?? deployer.zkWallet.address, + ]); if (!quiet) { console.info( chalk.cyan( diff --git a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-proxy.ts b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-proxy.ts index 61e22de92..ae7485527 100644 --- a/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-proxy.ts +++ b/packages/hardhat-zksync-upgradable/src/gas-estimation/estimate-gas-proxy.ts @@ -1,8 +1,7 @@ import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import * as ethers from 'ethers'; import chalk from 'chalk'; -import assert from 'assert'; -import path from 'path'; + import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; @@ -10,9 +9,7 @@ import { ZkSyncUpgradablePluginError } from '../errors'; import { DeployProxyOptions } from '../utils/options'; import { convertGasPriceToEth, getInitializerData } from '../utils/utils-general'; import { getChainId } from '../core/provider'; -import { ERC1967_PROXY_JSON, TUP_JSON } from '../constants'; -import { getAdminArtifact } from '../proxy-deployment/deploy-proxy-admin'; -import { getUpgradableContracts } from '../utils'; +import { getProxyAdminArtifact, getProxyArtifact, getTransparentUpgradeableProxyArtifact } from '../utils/factories'; export type EstimateProxyGasFunction = ( deployer: Deployer, @@ -36,7 +33,7 @@ export function makeEstimateGasProxy(hre: HardhatRuntimeEnvironment): EstimatePr ): Promise { let totalGasCost: bigint; - const mockArtifact = await getAdminArtifact(hre); + const mockArtifact = await getProxyAdminArtifact(hre); const kind = opts.kind; const chainId = await getChainId(deployer.zkWallet.provider); @@ -45,6 +42,8 @@ export function makeEstimateGasProxy(hre: HardhatRuntimeEnvironment): EstimatePr throw new ZkSyncUpgradablePluginError(`Chain id ${chainId} is not supported!`); } + const initialOwner = opts.initialOwner ?? deployer.zkWallet.address; + const mockImplAddress = await getProxyAdminContractAddress(); const data = getInitializerData(new ethers.Interface(mockArtifact.abi), args, opts.initializer); @@ -77,6 +76,7 @@ export function makeEstimateGasProxy(hre: HardhatRuntimeEnvironment): EstimatePr deployer, mockImplAddress, data, + initialOwner, quiet, ); totalGasCost = implGasCost + adminGasCost + proxyGasCost; @@ -109,11 +109,7 @@ async function estimateGasUUPS( data: string, quiet: boolean = false, ): Promise { - const ERC1967ProxyPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().ERC1967Proxy + path.sep + ERC1967_PROXY_JSON), - ); - assert(ERC1967ProxyPath, 'ERC1967Proxy artifact not found'); - const proxyContract = await import(ERC1967ProxyPath); + const proxyContract = await getProxyArtifact(hre); try { const uupsGasCost: bigint = await deployer.estimateDeployFee(proxyContract, [mockImplAddress, data]); @@ -137,10 +133,11 @@ async function estimateGasTransparent( deployer: Deployer, mockImplAddress: string, data: string, + initialOwner?: string, quiet: boolean = false, ): Promise { - const adminArtifact = await getAdminArtifact(hre); - const adminGasCost = await deployer.estimateDeployFee(adminArtifact, []); + const adminArtifact = await getProxyAdminArtifact(hre); + const adminGasCost = await deployer.estimateDeployFee(adminArtifact, [initialOwner ?? deployer.zkWallet.address]); let proxyGasCost; if (!quiet) { console.info( @@ -152,14 +149,14 @@ async function estimateGasTransparent( ); } - const TUPPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().TransparentUpgradeableProxy + path.sep + TUP_JSON), - ); - assert(TUPPath, 'TUP artifact not found'); - const TUPContract = await import(TUPPath); + const TUPContract = await getTransparentUpgradeableProxyArtifact(hre); try { - proxyGasCost = await deployer.estimateDeployFee(TUPContract, [mockImplAddress, mockImplAddress, data]); + proxyGasCost = await deployer.estimateDeployFee(TUPContract, [ + mockImplAddress, + initialOwner ?? deployer.zkWallet.address, + data, + ]); if (!quiet) { console.info( chalk.cyan( diff --git a/packages/hardhat-zksync-upgradable/src/index.ts b/packages/hardhat-zksync-upgradable/src/index.ts index aa5ecc666..f35adb32a 100644 --- a/packages/hardhat-zksync-upgradable/src/index.ts +++ b/packages/hardhat-zksync-upgradable/src/index.ts @@ -9,6 +9,7 @@ import { TASK_COMPILE_SOLIDITY_COMPILE } from 'hardhat/builtin-tasks/task-names' import { RunCompilerArgs } from './interfaces'; import { isFullZkSolcOutput } from './utils/utils-general'; import { validate } from './core/validate'; + import { TASK_DEPLOY_ZKSYNC_BEACON, TASK_DEPLOY_ZKSYNC_PROXY, @@ -42,6 +43,7 @@ task(TASK_DEPLOY_ZKSYNC_BEACON, 'Runs the beaccon deploy for ZKsync network') .addOptionalParam('deploymentTypeProxy', 'Type of deployment for proxy', undefined) .addOptionalParam('saltImpl', 'Salt for implementation deployment', undefined) .addOptionalParam('saltProxy', 'Salt for proxy deployment', undefined) + .addOptionalParam('initialOwner', 'Initial owner of the proxy', undefined) .addFlag('noCompile', 'No compile flag') .setAction(deployZkSyncBeacon); @@ -63,6 +65,7 @@ task(TASK_DEPLOY_ZKSYNC_PROXY, 'Deploy proxy for ZKsync network') .addOptionalParam('deploymentTypeProxy', 'Type of deployment for proxy', undefined) .addOptionalParam('saltImpl', 'Salt for implementation deployment', undefined) .addOptionalParam('saltProxy', 'Salt for proxy deployment', undefined) + .addOptionalParam('initialOwner', 'Initial owner of the proxy', undefined) .addFlag('noCompile', 'No compile flag') .setAction(deployZkSyncProxy); diff --git a/packages/hardhat-zksync-upgradable/src/interfaces.ts b/packages/hardhat-zksync-upgradable/src/interfaces.ts index 2f6ae873c..30a8c4dca 100644 --- a/packages/hardhat-zksync-upgradable/src/interfaces.ts +++ b/packages/hardhat-zksync-upgradable/src/interfaces.ts @@ -13,9 +13,8 @@ import { DeployBeaconArtifact, DeployBeaconFactory } from './proxy-deployment/de import { DeployBeaconProxyArtifact, DeployBeaconProxyFactory } from './proxy-deployment/deploy-beacon-proxy'; import { EstimateProxyGasFunction } from './gas-estimation/estimate-gas-proxy'; import { EstimateBeaconGasFunction } from './gas-estimation/estimate-gas-beacon-proxy'; -import { ChangeAdminFunction, GetInstanceFunction, TransferProxyAdminOwnershipFunction } from './admin'; +import { ChangeAdminFunction, TransferProxyAdminOwnershipFunction } from './admin'; import { ValidateImplementationOptions } from './utils/options'; -import { DeployAdminFunction } from './proxy-deployment/deploy-proxy-admin'; import { UndefinedFunctionType } from './utils'; export type ValidateImplementationFunction = ( @@ -30,9 +29,7 @@ export interface HardhatZksyncUpgrades { deployBeacon: DeployBeaconArtifact & DeployBeaconFactory; deployBeaconProxy: DeployBeaconProxyFactory & DeployBeaconProxyArtifact; upgradeBeacon: UpgradeBeaconFactory & UpgradeBeaconArtifact; - deployProxyAdmin: DeployAdminFunction; admin: { - getInstance: GetInstanceFunction; changeProxyAdmin: ChangeAdminFunction; transferProxyAdminOwnership: TransferProxyAdminOwnershipFunction; }; diff --git a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/propose-upgrade.ts b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/propose-upgrade.ts deleted file mode 100644 index 6ab725051..000000000 --- a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/propose-upgrade.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { - getImplementationAddress, - isBeaconProxy, - isTransparentOrUUPSProxy, - isTransparentProxy, -} from '@openzeppelin/upgrades-core'; -import { ProposalResponse, CreateProposalRequest } from '@openzeppelin/defender-admin-client'; -import { ContractFactory, getCreateAddress, ethers } from 'ethers'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { getAdminClient, getNetwork } from '@openzeppelin/hardhat-upgrades/dist/defender-v1/utils'; -import { UpgradeOptions } from '@openzeppelin/hardhat-upgrades/dist/utils/options'; -import type { VerificationResponse } from './verify-deployment'; - -export interface ExtendedProposalResponse extends ProposalResponse { - txResponse?: ethers.TransactionResponse; - verificationResponse?: VerificationResponse; -} - -export type ProposeUpgradeFunction = ( - proxyAddress: string, - contractNameOrImplFactory: string | ContractFactory, - opts?: ProposalOptions, -) => Promise; - -export interface ProposalOptions extends UpgradeOptions { - title?: string; - description?: string; - proxyAdmin?: string; - multisig?: string; - multisigType?: CreateProposalRequest['viaType']; - bytecodeVerificationReferenceUrl?: string; -} - -export function makeProposeUpgrade(hre: HardhatRuntimeEnvironment): ProposeUpgradeFunction { - return async function proposeUpgrade(proxyAddress, contractNameOrImplFactory, opts = {}) { - const client = getAdminClient(hre); - const network = await getNetwork(hre); - - const { title, description, proxyAdmin, multisig, multisigType, ...moreOpts } = opts; - - if (await isBeaconProxy(hre.network.provider, proxyAddress)) { - throw new Error(`Beacon proxy is not currently supported with defender.proposeUpgrade()`); - } else if ( - !multisig && - (await isTransparentOrUUPSProxy(hre.network.provider, proxyAddress)) && - !(await isTransparentProxy(hre.network.provider, proxyAddress)) - ) { - throw new Error(`Multisig address is a required property for UUPS proxies`); - } else { - // try getting the implementation address so that it will give an error if it's not a transparent/uups proxy - await getImplementationAddress(hre.network.provider, proxyAddress); - } - - const implFactory = - typeof contractNameOrImplFactory === 'string' - ? await hre.ethers.getContractFactory(contractNameOrImplFactory) - : contractNameOrImplFactory; - const contractName = typeof contractNameOrImplFactory === 'string' ? contractNameOrImplFactory : undefined; - const contract = { address: proxyAddress, network, abi: implFactory.interface.formatJson() }; - - const prepareUpgradeResult = await hre.upgrades.prepareUpgrade(proxyAddress, implFactory, { - getTxResponse: true, - ...moreOpts, - }); - - let txResponse; - let newImplementation; - - if (typeof prepareUpgradeResult === 'string') { - newImplementation = prepareUpgradeResult; - } else { - txResponse = prepareUpgradeResult; - newImplementation = getCreateAddress(txResponse); - } - - const verificationResponse = - contractName && opts.bytecodeVerificationReferenceUrl - ? await hre.defender.verifyDeployment( - newImplementation, - contractName, - opts.bytecodeVerificationReferenceUrl, - ) - : undefined; - - const proposalResponse = await client.proposeUpgrade( - { - newImplementation, - title, - description, - proxyAdmin, - via: multisig, - viaType: multisigType, - }, - contract, - ); - - return { - ...proposalResponse, - txResponse, - verificationResponse, - }; - }; -} diff --git a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/verify-deployment.ts b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/verify-deployment.ts deleted file mode 100644 index 64a48b5dc..000000000 --- a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/defender-v1/verify-deployment.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { AdminClient, VerificationRequest } from '@openzeppelin/defender-admin-client'; -import { Artifact, BuildInfo, CompilerOutputBytecode, HardhatRuntimeEnvironment } from 'hardhat/types'; -import { getAdminClient, getNetwork } from '@openzeppelin/hardhat-upgrades/dist/defender-v1/utils'; -import { sha256FromString } from 'ethereumjs-util'; - -export type VerificationResponse = Awaited>; - -type ExtendedArtifact = Artifact & { immutableReferences: CompilerOutputBytecode['immutableReferences'] }; - -export type VerifyDeployFunction = ( - address: string, - contractName: string, - referenceUrl: string, -) => Promise; - -export type VerifyDeployWithUploadedArtifactFunction = ( - address: string, - contractName: string, - artifactUri: string, -) => Promise; - -export type GetVerifyDeployArtifactFunction = (contractName: string) => Promise; - -export type GetVerifyDeployBuildInfoFunction = (contractName: string) => Promise; - -export type GetBytecodeDigestFunction = (contractName: string) => Promise; - -export function makeVerifyDeploy(hre: HardhatRuntimeEnvironment): VerifyDeployFunction { - return async function verifyDeploy(address, contractName, referenceUri) { - const client = getAdminClient(hre); - const contractNetwork = await getNetwork(hre); - const artifact = await getExtendedArtifact(hre, contractName); - - const request: VerificationRequest = { - contractAddress: address, - contractName: artifact.contractName, - solidityFilePath: artifact.sourceName, - contractNetwork, - artifactPayload: JSON.stringify(artifact), - referenceUri, - }; - - return client.verifyDeployment(request); - }; -} - -export function makeVerifyDeployWithUploadedArtifact( - hre: HardhatRuntimeEnvironment, -): VerifyDeployWithUploadedArtifactFunction { - return async function verifyDeploy(address, contractName, artifactUri) { - const client = getAdminClient(hre); - const contractNetwork = await getNetwork(hre); - const artifact = await hre.artifacts.readArtifact(contractName); - - const request: VerificationRequest = { - contractAddress: address, - contractName: artifact.contractName, - solidityFilePath: artifact.sourceName, - artifactUri, - contractNetwork, - }; - - return client.verifyDeployment(request); - }; -} - -export function makeGetVerifyDeployArtifact(hre: HardhatRuntimeEnvironment): GetVerifyDeployArtifactFunction { - return async function getVerifyDeployArtifact(contractName: string): Promise { - return getExtendedArtifact(hre, contractName); - }; -} - -export function makeGetVerifyDeployBuildInfo(hre: HardhatRuntimeEnvironment): GetVerifyDeployBuildInfoFunction { - return async function getVerifyDeployBuildInfo(contractName: string): Promise { - const artifact = await hre.artifacts.readArtifact(contractName); - const fqn = `${artifact.sourceName}:${artifact.contractName}`; - const buildInfo = await hre.artifacts.getBuildInfo(fqn); - if (!buildInfo) { - throw new Error(`Build info for ${fqn} not found`); - } - return buildInfo; - }; -} - -export function makeGetBytecodeDigest(hre: HardhatRuntimeEnvironment) { - return async function getBytecodeDigest(contractName: string): Promise { - const artifact = await hre.artifacts.readArtifact(contractName); - const bytecode = artifact.deployedBytecode; - return sha256FromString(bytecode).toString('hex'); - }; -} - -async function getExtendedArtifact(hre: HardhatRuntimeEnvironment, contractName: string): Promise { - const artifact = await hre.artifacts.readArtifact(contractName); - const fqn = `${artifact.sourceName}:${artifact.contractName}`; - const buildInfo = await hre.artifacts.getBuildInfo(fqn); - const contractBuildInfo = buildInfo?.output.contracts[artifact.sourceName][artifact.contractName]; - const immutableReferences = contractBuildInfo?.evm.deployedBytecode.immutableReferences ?? {}; - return { ...artifact, immutableReferences }; -} diff --git a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/extension-generator.ts b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/extension-generator.ts index 8d4dd3350..0df90662a 100644 --- a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/extension-generator.ts +++ b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/extension-generator.ts @@ -34,11 +34,9 @@ export class OpenzeppelinGenerator implements Generator { const { makeDeployBeaconProxy } = require('@openzeppelin/hardhat-upgrades/dist/deploy-beacon-proxy'); const { makeUpgradeBeacon } = require('@openzeppelin/hardhat-upgrades/dist/upgrade-beacon'); const { makeForceImport } = require('@openzeppelin/hardhat-upgrades/dist/force-import'); - const { makeDeployProxyAdmin } = require('@openzeppelin/hardhat-upgrades/dist/deploy-proxy-admin'); const { makeChangeProxyAdmin, makeTransferProxyAdminOwnership, - makeGetInstanceFunction, } = require('@openzeppelin/hardhat-upgrades/dist/admin'); return { @@ -51,11 +49,9 @@ export class OpenzeppelinGenerator implements Generator { prepareUpgrade: makePrepareUpgrade(this._hre, defender), deployBeacon: makeDeployBeacon(this._hre, defender), // block on defender deployBeaconProxy: makeDeployBeaconProxy(this._hre, defender), - deployProxyAdmin: makeDeployProxyAdmin(this._hre, defender), upgradeBeacon: makeUpgradeBeacon(this._hre, defender), // block on defender forceImport: makeForceImport(this._hre), admin: { - getInstance: makeGetInstanceFunction(this._hre, defender), // block on defender changeProxyAdmin: makeChangeProxyAdmin(this._hre, defender), // block on defender transferProxyAdminOwnership: makeTransferProxyAdminOwnership(this._hre, defender), // block on defender }, diff --git a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/interfaces.ts b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/interfaces.ts index f975ac075..074e0de13 100644 --- a/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/interfaces.ts +++ b/packages/hardhat-zksync-upgradable/src/openzeppelin-hardhat-upgrades/interfaces.ts @@ -6,12 +6,10 @@ import { UpgradeFunction as UpgradeFunctionOZ } from '@openzeppelin/hardhat-upgr import { DeployBeaconFunction as DeployBeaconFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/deploy-beacon'; import { DeployBeaconProxyFunction as DeployBeaconProxyFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/deploy-beacon-proxy'; import { UpgradeBeaconFunction as UpgradeBeaconFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/upgrade-beacon'; -import { DeployAdminFunction as DeployAdminFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/deploy-proxy-admin'; import { ForceImportFunction as ForceImportFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/force-import'; import { ChangeAdminFunction as ChangeAdminFunctionOZ, TransferProxyAdminOwnershipFunction as TransferProxyAdminOwnershipFunctionOZ, - GetInstanceFunction as GetInstanceFunctionOZ, } from '@openzeppelin/hardhat-upgrades/dist/admin'; import { ValidateImplementationFunction as ValidateImplementationFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/validate-implementation'; import { ValidateUpgradeFunction as ValidateUpgradeFunctionOZ } from '@openzeppelin/hardhat-upgrades/dist/validate-upgrade'; @@ -22,14 +20,6 @@ import { GetUpgradeApprovalProcessFunction as GetUpgradeApprovalProcessFunctionOZ, } from '@openzeppelin/hardhat-upgrades/dist/defender/get-approval-process'; -import type { ProposeUpgradeFunction as ProposeUpgradeFunctionOZ } from '../openzeppelin-hardhat-upgrades/defender-v1/propose-upgrade'; -import type { - VerifyDeployFunction as VerifyDeployFunctionOZ, - VerifyDeployWithUploadedArtifactFunction as VerifyDeployWithUploadedArtifactFunctionOZ, - GetVerifyDeployArtifactFunction as GetVerifyDeployArtifactFunctionOZ, - GetVerifyDeployBuildInfoFunction as GetVerifyDeployBuildInfoFunctionOZ, - GetBytecodeDigestFunction as GetBytecodeDigestFunctionOZ, -} from '../openzeppelin-hardhat-upgrades/defender-v1/verify-deployment'; import { UndefinedFunctionType } from '../utils'; export interface HardhatUpgradesOZ { @@ -42,12 +32,9 @@ export interface HardhatUpgradesOZ { deployBeacon: DeployBeaconFunctionOZ; deployBeaconProxy: DeployBeaconProxyFunctionOZ; upgradeBeacon: UpgradeBeaconFunctionOZ; - deployProxyAdmin: DeployAdminFunctionOZ; forceImport: ForceImportFunctionOZ; silenceWarnings: typeof silenceWarnings; admin: { - // property from zksync - getInstance: GetInstanceFunctionOZ; changeProxyAdmin: ChangeAdminFunctionOZ; transferProxyAdminOwnership: TransferProxyAdminOwnershipFunctionOZ; }; @@ -67,15 +54,6 @@ export interface HardhatUpgradesOZ { }; } -export interface DefenderV1HardhatUpgradesOZ { - proposeUpgrade: ProposeUpgradeFunctionOZ; - verifyDeployment: VerifyDeployFunctionOZ; - verifyDeploymentWithUploadedArtifact: VerifyDeployWithUploadedArtifactFunctionOZ; - getDeploymentArtifact: GetVerifyDeployArtifactFunctionOZ; - getDeploymentBuildInfo: GetVerifyDeployBuildInfoFunctionOZ; - getBytecodeDigest: GetBytecodeDigestFunctionOZ; -} - export type DefenderHardhatUpgradesOZ = { deployContract: DeployContractFunctionOZ; proposeUpgradeWithApproval: any; @@ -85,5 +63,4 @@ export type DefenderHardhatUpgradesOZ = { * @deprecated Use `getUpgradeApprovalProcess` instead. */ getDefaultApprovalProcess: GetUpgradeApprovalProcessFunctionOZ; -} & HardhatUpgradesOZ & - DefenderV1HardhatUpgradesOZ; +} & HardhatUpgradesOZ; diff --git a/packages/hardhat-zksync-upgradable/src/plugin.ts b/packages/hardhat-zksync-upgradable/src/plugin.ts index 1ab17f1b3..5f8c26aaa 100644 --- a/packages/hardhat-zksync-upgradable/src/plugin.ts +++ b/packages/hardhat-zksync-upgradable/src/plugin.ts @@ -17,6 +17,7 @@ export async function deployBeacon( deploymentTypeProxy?: DeploymentType; saltImpl?: string; saltProxy?: string; + initialOwner?: string; noCompile?: boolean; }, ): Promise<{ @@ -40,6 +41,7 @@ export async function deployBeacon( const beacon = await hre.upgrades.deployBeacon(factory, { deploymentType: taskArgs.deploymentTypeImpl, salt: taskArgs.saltImpl, + initialOwner: taskArgs.initialOwner, }); await beacon.waitForDeployment(); @@ -73,6 +75,7 @@ export async function deployProxy( deploymentTypeProxy?: DeploymentType; saltImpl?: string; saltProxy?: string; + initialOwner?: string; noCompile?: boolean; }, ): Promise { @@ -96,6 +99,7 @@ export async function deployProxy( deploymentTypeProxy: taskArgs.deploymentTypeProxy, saltProxy: taskArgs.saltProxy, initializer: taskArgs.initializer, + initialOwner: taskArgs.initialOwner, }); await proxy.waitForDeployment(); @@ -139,6 +143,7 @@ export async function upgradeProxy( proxyAddress: string; deploymentType?: DeploymentType; salt?: string; + unsafeStateVariableAssignment?: boolean; noCompile?: boolean; }, ): Promise { diff --git a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon-proxy.ts b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon-proxy.ts index ea13c5282..60ca4f663 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon-proxy.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon-proxy.ts @@ -11,13 +11,10 @@ import * as zk from 'zksync-ethers'; import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import chalk from 'chalk'; -import assert from 'assert'; -import path from 'path'; import { ContractAddressOrInstance, getContractAddress, getInitializerData } from '../utils/utils-general'; import { DeployBeaconProxyOptions } from '../utils/options'; -import { BEACON_PROXY_JSON } from '../constants'; import { Manifest } from '../core/manifest'; -import { getUpgradableContracts } from '../utils'; +import { getBeaconProxyFactory } from '../utils/factories'; import { deploy, DeployTransaction } from './deploy'; export type DeployBeaconProxyFactory = ( @@ -123,18 +120,7 @@ async function deployBeaconProxy( } } - const beaconProxyPath = (await hre.artifacts.getArtifactPaths()).find((artifactPath) => - artifactPath.includes(path.sep + getUpgradableContracts().BeaconProxy + path.sep + BEACON_PROXY_JSON), - ); - assert(beaconProxyPath, 'Beacon proxy artifact not found'); - const beaconProxyContract = await import(beaconProxyPath); - - const beaconProxyFactory = new zk.ContractFactory( - beaconProxyContract.abi, - beaconProxyContract.bytecode, - wallet, - opts.deploymentType, - ); + const beaconProxyFactory = await getBeaconProxyFactory(hre, wallet, opts.deploymentType); const proxyDeployment: Required = { kind: opts.kind!, diff --git a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon.ts b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon.ts index efa49f61b..6ec18692b 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-beacon.ts @@ -6,13 +6,10 @@ import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import * as zk from 'zksync-ethers'; import chalk from 'chalk'; -import assert from 'assert'; -import path from 'path'; -import { UPGRADABLE_BEACON_JSON } from '../constants'; import { extractFactoryDeps, getArtifactFromBytecode } from '../utils/utils-general'; import { ZkSyncUpgradablePluginError } from '../errors'; import { DeployBeaconOptions } from '../utils/options'; -import { getUpgradableContracts } from '../utils'; +import { getUpgradeableBeaconFactory } from '../utils/factories'; import { deployBeaconImpl } from './deploy-impl'; import { deploy, DeployTransaction } from './deploy'; @@ -92,18 +89,13 @@ async function deployProxyBeacon( console.info(chalk.green('Beacon impl deployed at', impl)); } - const upgradableBeaconPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().UpgradeableBeacon + path.sep + UPGRADABLE_BEACON_JSON), - ); - assert(upgradableBeaconPath, 'Upgradable beacon artifact not found'); - const upgradeableBeaconContract = await import(upgradableBeaconPath); + const upgradeableBeaconFactory = await getUpgradeableBeaconFactory(hre, wallet); - const upgradeableBeaconFactory = new zk.ContractFactory( - upgradeableBeaconContract.abi, - upgradeableBeaconContract.bytecode, - wallet, + const beaconDeployment: Required = await deploy( + upgradeableBeaconFactory, + impl, + opts.initialOwner ?? wallet.address, ); - const beaconDeployment: Required = await deploy(upgradeableBeaconFactory, impl); if (!quiet) { console.info(chalk.green('Beacon deployed at: ', beaconDeployment.address)); } diff --git a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-impl.ts b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-impl.ts index dabaabba5..2bca4d648 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-impl.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-impl.ts @@ -13,7 +13,6 @@ import { TransactionResponse } from 'zksync-ethers/src/types'; import { DeployProxyOptions, UpgradeOptions, withDefaults } from '../utils/options'; import { validateBeaconImpl, validateProxyImpl } from '../validations/validate-impl'; import { readValidations } from '../validations/validations'; - import { fetchOrDeployGetDeployment } from '../core/impl-store'; import { FORMAT_TYPE_MINIMAL, IMPL_CONTRACT_NOT_DEPLOYED_ERROR } from '../constants'; import { ZkSyncUpgradablePluginError } from '../errors'; diff --git a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy-admin.ts b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy-admin.ts deleted file mode 100644 index 2f19cb887..000000000 --- a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy-admin.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { HardhatRuntimeEnvironment } from 'hardhat/types'; -import * as zk from 'zksync-ethers'; -import path from 'path'; -import assert from 'assert'; -import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; -import { DeploymentType } from 'zksync-ethers/build/types'; -import { DeployProxyAdminOptions } from '../utils/options'; -import { PROXY_ADMIN_JSON } from '../constants'; -import { fetchOrDeployAdmin } from '../core/impl-store'; -import { getUpgradableContracts } from '../utils'; -import { deploy } from './deploy'; - -export type DeployAdminFunction = (wallet?: zk.Wallet, opts?: DeployProxyAdminOptions) => Promise; - -export function makeDeployProxyAdmin(hre: HardhatRuntimeEnvironment): any { - return async function deployProxyAdmin(wallet: zk.Wallet, opts: DeployProxyAdminOptions = {}) { - const adminFactory = await getAdminFactory(hre, wallet, opts.deploymentType); - return await fetchOrDeployAdmin( - wallet.provider, - () => - deploy(adminFactory, { - customData: { - salt: opts.salt, - paymasterParams: opts.paymasterParams, - ...opts.otherCustomData, - }, - }), - opts, - ); - }; -} - -export async function getAdminArtifact(hre: HardhatRuntimeEnvironment): Promise { - const proxyAdminPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().ProxyAdmin + path.sep + PROXY_ADMIN_JSON), - ); - assert(proxyAdminPath, 'Proxy admin artifact not found'); - return await import(proxyAdminPath); -} - -export async function getAdminFactory( - hre: HardhatRuntimeEnvironment, - wallet: zk.Wallet, - deploymentType?: DeploymentType, -): Promise> { - const proxyAdminContract = await getAdminArtifact(hre); - return new zk.ContractFactory( - proxyAdminContract.abi, - proxyAdminContract.bytecode, - wallet, - deploymentType, - ); -} diff --git a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy.ts b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy.ts index 3c1959029..5a46a7654 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-deployment/deploy-proxy.ts @@ -1,18 +1,19 @@ import type { HardhatRuntimeEnvironment } from 'hardhat/types'; import * as zk from 'zksync-ethers'; import chalk from 'chalk'; -import path from 'path'; import { BeaconProxyUnsupportedError } from '@openzeppelin/upgrades-core'; import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; -import assert from 'assert'; import { extractFactoryDeps, getArtifactFromBytecode, getInitializerData } from '../utils/utils-general'; -import { ERC1967_PROXY_JSON, TUP_JSON } from '../constants'; import { Manifest, ProxyDeployment } from '../core/manifest'; import { ZkSyncUpgradablePluginError } from '../errors'; import { DeployProxyOptions } from '../utils/options'; -import { getUpgradableContracts } from '../utils'; +import { + getProxyFactory, + getTransparentUpgradeableProxyArtifact, + getTransparentUpgradeableProxyFactory, +} from '../utils/factories'; import { deployProxyImpl } from './deploy-impl'; import { DeployTransaction, deploy } from './deploy'; @@ -132,14 +133,6 @@ async function deployProxy( const data = getInitializerData(factory.interface, args, opts.initializer); - const customDataProxy = { - customData: { - salt: opts.saltProxy, - paymasterParams: opts.paymasterProxyParams, - ...opts.otherCustomData, - }, - }; - if (kind === 'uups') { if (await manifest.getAdmin()) { if (!quiet) { @@ -159,18 +152,17 @@ async function deployProxy( } case 'uups': { - const ERC1967ProxyPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().ERC1967Proxy + path.sep + ERC1967_PROXY_JSON), - ); - assert(ERC1967ProxyPath, 'ERC1967Proxy artifact not found'); - const proxyContract = await import(ERC1967ProxyPath); - const proxyFactory = new zk.ContractFactory( - proxyContract.abi, - proxyContract.bytecode, - wallet, - opts.deploymentTypeProxy, - ); - proxyDeployment = { kind, ...(await deploy(proxyFactory, impl, data, customDataProxy)) }; + const proxyFactory = await getProxyFactory(hre, wallet, opts.deploymentTypeProxy); + + const customDataProxyUups = { + customData: { + salt: opts.saltProxy, + paymasterParams: opts.paymasterProxyParams, + ...opts.otherCustomData, + }, + }; + + proxyDeployment = { kind, ...(await deploy(proxyFactory, impl, data, customDataProxyUups)) }; if (!quiet) { console.info(chalk.green(`UUPS proxy was deployed to ${proxyDeployment.address}`)); @@ -179,27 +171,21 @@ async function deployProxy( } case 'transparent': { - const adminAddress = await hre.upgrades.deployProxyAdmin(wallet, { - paymasterParams: opts.paymasterProxyParams, - }); + const TUPFactory = await getTransparentUpgradeableProxyFactory(hre, wallet, opts.deploymentTypeProxy); + const TUPArtifact = await getTransparentUpgradeableProxyArtifact(hre); - if (!quiet) { - console.info(chalk.green(`Admin was deployed to ${adminAddress}`)); - } + const initialOwner = opts.initialOwner ?? wallet.address; + + const customDataProxyTup = { + customData: { + salt: opts.saltProxy, + factoryDeps: await extractFactoryDeps(hre, TUPArtifact), + paymasterParams: opts.paymasterProxyParams, + ...opts.otherCustomData, + }, + }; - const TUPPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().TransparentUpgradeableProxy + path.sep + TUP_JSON), - ); - assert(TUPPath, 'TUP artifact not found'); - const TUPContract = await import(TUPPath); - - const TUPFactory = new zk.ContractFactory( - TUPContract.abi, - TUPContract.bytecode, - wallet, - opts.deploymentTypeProxy, - ); - proxyDeployment = { kind, ...(await deploy(TUPFactory, impl, adminAddress, data, customDataProxy)) }; + proxyDeployment = { kind, ...(await deploy(TUPFactory, impl, initialOwner, data, customDataProxyTup)) }; if (!quiet) { console.info(chalk.green(`Transparent proxy was deployed to ${proxyDeployment.address}`)); diff --git a/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-beacon.ts b/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-beacon.ts index 86f3cb6ce..1ffb5c2a7 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-beacon.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-beacon.ts @@ -1,10 +1,8 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; import * as zk from 'zksync-ethers'; -import path from 'path'; import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import chalk from 'chalk'; -import assert from 'assert'; import { ContractAddressOrInstance, extractFactoryDeps, @@ -13,9 +11,8 @@ import { } from '../utils/utils-general'; import { UpgradeBeaconOptions } from '../utils/options'; import { deployBeaconImpl } from '../proxy-deployment/deploy-impl'; -import { UPGRADABLE_BEACON_JSON } from '../constants'; import { ZkSyncUpgradablePluginError } from '../errors'; -import { getUpgradableContracts } from '../utils'; +import { getUpgradeableBeaconFactory } from '../utils/factories'; export type UpgradeBeaconFactory = ( beacon: ContractAddressOrInstance, @@ -81,17 +78,7 @@ async function upgradeBeacon( console.info(chalk.green('New beacon impl deployed at', nextImpl)); } - const upgradableBeaconPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().UpgradeableBeacon + path.sep + UPGRADABLE_BEACON_JSON), - ); - assert(upgradableBeaconPath, 'Upgradable beacon artifact not found'); - const upgradeableBeaconContract = await import(upgradableBeaconPath); - - const upgradeableBeaconFactory = new zk.ContractFactory( - upgradeableBeaconContract.abi, - upgradeableBeaconContract.bytecode, - wallet, - ); + const upgradeableBeaconFactory = await getUpgradeableBeaconFactory(hre, wallet); const beaconContract = upgradeableBeaconFactory.attach(beaconImplementationAddress); const upgradeTx = await beaconContract.upgradeTo(nextImpl); diff --git a/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-proxy.ts b/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-proxy.ts index 530435641..e4c087d94 100644 --- a/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-proxy.ts +++ b/packages/hardhat-zksync-upgradable/src/proxy-upgrade/upgrade-proxy.ts @@ -1,21 +1,22 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; import * as zk from 'zksync-ethers'; import { TransactionResponse } from 'zksync-ethers/src/types'; -import path from 'path'; -import { getAdminAddress, getCode, isEmptySlot } from '@openzeppelin/upgrades-core'; +import { getAdminAddress, getCode, getUpgradeInterfaceVersion, isEmptySlot } from '@openzeppelin/upgrades-core'; import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; import chalk from 'chalk'; -import assert from 'assert'; import { ContractAddressOrInstance } from '../interfaces'; import { UpgradeProxyOptions } from '../utils/options'; import { extractFactoryDeps, getArtifactFromBytecode, getContractAddress } from '../utils/utils-general'; import { deployProxyImpl } from '../proxy-deployment/deploy-impl'; -import { Manifest } from '../core/manifest'; -import { ITUP_JSON, PROXY_ADMIN_JSON } from '../constants'; import { ZkSyncUpgradablePluginError } from '../errors'; -import { getUpgradableContracts } from '../utils'; +import { + attachITransparentUpgradeableProxyV4, + attachITransparentUpgradeableProxyV5, + attachProxyAdminV4, + attachProxyAdminV5, +} from '../utils/attach-abi'; export type UpgradeProxyFactory = ( proxy: ContractAddressOrInstance, @@ -111,44 +112,37 @@ async function getUpgrader(hre: HardhatRuntimeEnvironment, proxyAddress: string, const adminBytecode = await getCode(provider, adminAddress); if (isEmptySlot(adminAddress) || adminBytecode === '0x') { - const TUPPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().TransparentUpgradeableProxy + path.sep + ITUP_JSON), - ); - assert(TUPPath, 'Transparent upgradeable proxy artifact not found'); - const transparentUpgradeableProxyContract = await import(TUPPath); - - const transparentUpgradeableProxyFactory = new zk.ContractFactory( - transparentUpgradeableProxyContract.abi, - transparentUpgradeableProxyContract.bytecode, - wallet, - ); - const proxy = transparentUpgradeableProxyFactory.attach(proxyAddress); - - return (nextImpl, call) => (call ? proxy.upgradeToAndCall(nextImpl, call) : proxy.upgradeTo(nextImpl)); + const upgradeInterfaceVersion = await getUpgradeInterfaceVersion(provider, proxyAddress); + if (upgradeInterfaceVersion === '5.0.0') { + const proxyV5 = await attachITransparentUpgradeableProxyV5(proxyAddress, wallet); + return (nextImpl, call) => proxyV5.upgradeToAndCall(nextImpl, call ?? '0x'); + } + if (upgradeInterfaceVersion !== undefined) { + // Log as debug if the interface version is an unknown string. + // Do not throw an error because this could be caused by a fallback function. + console.debug( + `Unknown UPGRADE_INTERFACE_VERSION ${upgradeInterfaceVersion} for proxy at ${proxyAddress}. Expected 5.0.0`, + ); + } + const proxyV4 = await attachITransparentUpgradeableProxyV4(proxyAddress, wallet); + return (nextImpl, call) => (call ? proxyV4.upgradeToAndCall(nextImpl, call) : proxyV4.upgradeTo(nextImpl)); } else { - const manifest = await Manifest.forNetwork(provider); - - const proxyAdminPath = (await hre.artifacts.getArtifactPaths()).find((x) => - x.includes(path.sep + getUpgradableContracts().ProxyAdmin + path.sep + PROXY_ADMIN_JSON), - ); - assert(proxyAdminPath, 'Proxy admin artifact not found'); - const proxyAdminContract = await import(proxyAdminPath); - - const proxyAdminFactory = new zk.ContractFactory( - proxyAdminContract.abi, - proxyAdminContract.bytecode, - wallet, - ); + const upgradeInterfaceVersion = await getUpgradeInterfaceVersion(provider, adminAddress); - const admin = proxyAdminFactory.attach(adminAddress); - const manifestAdmin = await manifest.getAdmin(); - - if ((await admin.getAddress()) !== manifestAdmin?.address) { - throw new Error('Proxy admin is not the one registered in the network manifest'); + if (upgradeInterfaceVersion === '5.0.0') { + const adminV5 = await attachProxyAdminV5(adminAddress, wallet); + return (nextImpl, call) => adminV5.upgradeAndCall(proxyAddress, nextImpl, call ?? '0x'); } - + if (upgradeInterfaceVersion !== undefined) { + // Log as debug if the interface version is an unknown string. + // Do not throw an error because this could be caused by a fallback function. + console.debug( + `Unknown UPGRADE_INTERFACE_VERSION ${upgradeInterfaceVersion} for proxy at ${proxyAddress}. Expected 5.0.0`, + ); + } + const adminV4 = await attachProxyAdminV4(adminAddress, wallet); return (nextImpl, call) => - call ? admin.upgradeAndCall(proxyAddress, nextImpl, call) : admin.upgrade(proxyAddress, nextImpl); + call ? adminV4.upgradeAndCall(proxyAddress, nextImpl, call) : adminV4.upgrade(proxyAddress, nextImpl); } } diff --git a/packages/hardhat-zksync-upgradable/src/utils.ts b/packages/hardhat-zksync-upgradable/src/utils.ts index a5d76272b..34553b8c3 100644 --- a/packages/hardhat-zksync-upgradable/src/utils.ts +++ b/packages/hardhat-zksync-upgradable/src/utils.ts @@ -63,7 +63,7 @@ export function isOpenzeppelinContractsVersionValid(): boolean { try { // eslint-disable-next-line import/no-extraneous-dependencies const versionContracts = require('@openzeppelin/contracts/package.json').version; - if (!versionContracts || semver.lt(versionContracts, '4.6.0') || semver.gt(versionContracts, '5.0.0')) { + if (!versionContracts || semver.lt(versionContracts, '5.0.0')) { return false; } return true; diff --git a/packages/hardhat-zksync-upgradable/src/utils/attach-abi.ts b/packages/hardhat-zksync-upgradable/src/utils/attach-abi.ts new file mode 100644 index 000000000..eebcbaaca --- /dev/null +++ b/packages/hardhat-zksync-upgradable/src/utils/attach-abi.ts @@ -0,0 +1,35 @@ +import ITransparentUpgradeableProxyV5 from '@openzeppelin/upgrades-core/artifacts/@openzeppelin/contracts-v5/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json'; +import ITransparentUpgradeableProxyV4 from '@openzeppelin/upgrades-core/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json'; + +import ProxyAdminV5 from '@openzeppelin/upgrades-core/artifacts/@openzeppelin/contracts-v5/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json'; +import ProxyAdminV4 from '@openzeppelin/upgrades-core/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json'; + +import { Contract, ContractFactory, Wallet } from 'zksync-ethers'; + +export async function attachITransparentUpgradeableProxyV5(address: string, wallet?: Wallet): Promise { + const contractFactory = new ContractFactory( + ITransparentUpgradeableProxyV5.abi, + ITransparentUpgradeableProxyV5.bytecode, + wallet, + ); + return contractFactory.attach(address); +} + +export async function attachITransparentUpgradeableProxyV4(address: string, wallet?: Wallet): Promise { + const contractFactory = new ContractFactory( + ITransparentUpgradeableProxyV4.abi, + ITransparentUpgradeableProxyV4.bytecode, + wallet, + ); + return contractFactory.attach(address); +} + +export async function attachProxyAdminV5(address: string, wallet?: Wallet): Promise { + const contractFactory = new ContractFactory(ProxyAdminV5.abi, ProxyAdminV5.bytecode, wallet); + return contractFactory.attach(address); +} + +export async function attachProxyAdminV4(address: string, wallet?: Wallet): Promise { + const contractFactory = new ContractFactory(ProxyAdminV4.abi, ProxyAdminV4.bytecode, wallet); + return contractFactory.attach(address); +} diff --git a/packages/hardhat-zksync-upgradable/src/utils/factories.ts b/packages/hardhat-zksync-upgradable/src/utils/factories.ts new file mode 100644 index 000000000..1856f22aa --- /dev/null +++ b/packages/hardhat-zksync-upgradable/src/utils/factories.ts @@ -0,0 +1,120 @@ +import { ZkSyncArtifact } from '@matterlabs/hardhat-zksync-deploy/src/types'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import path from 'path'; + +import { Contract, ContractFactory, Wallet } from 'zksync-ethers'; +import assert from 'assert'; +import { DeploymentType } from 'zksync-ethers/src/types'; +import { + BEACON_PROXY_JSON, + ERC1967_PROXY_JSON, + PROXY_ADMIN_JSON, + TUP_JSON, + UPGRADABLE_BEACON_JSON, +} from '../constants'; +import { getUpgradableContracts } from '../utils'; + +export async function getProxyArtifact(hre: HardhatRuntimeEnvironment): Promise { + const proxyPath = (await hre.artifacts.getArtifactPaths()).find((x) => + x.includes(path.sep + getUpgradableContracts().ERC1967Proxy + path.sep + ERC1967_PROXY_JSON), + ); + assert(proxyPath, 'Proxy artifact not found'); + return await import(proxyPath); +} + +export async function getProxyFactory( + hre: HardhatRuntimeEnvironment, + wallet: Wallet, + deploymentType?: DeploymentType, +): Promise> { + const proxyContract = await getProxyArtifact(hre); + return new ContractFactory(proxyContract.abi, proxyContract.bytecode, wallet, deploymentType); +} + +export async function getTransparentUpgradeableProxyArtifact(hre: HardhatRuntimeEnvironment): Promise { + const transparentUpgradeableProxyPath = (await hre.artifacts.getArtifactPaths()).find((x) => + x.includes(path.sep + getUpgradableContracts().TransparentUpgradeableProxy + path.sep + TUP_JSON), + ); + assert(transparentUpgradeableProxyPath, 'Transparent upgradeable proxy artifact not found'); + return await import(transparentUpgradeableProxyPath); +} + +export async function getTransparentUpgradeableProxyFactory( + hre: HardhatRuntimeEnvironment, + wallet: Wallet, + deploymentType?: DeploymentType, +): Promise> { + const transparentUpgradeableProxy = await getTransparentUpgradeableProxyArtifact(hre); + return new ContractFactory( + transparentUpgradeableProxy.abi, + transparentUpgradeableProxy.bytecode, + wallet, + deploymentType, + ); +} + +export async function getBeaconProxyArtifact(hre: HardhatRuntimeEnvironment): Promise { + const beaconProxyPath = (await hre.artifacts.getArtifactPaths()).find((x) => + x.includes(path.sep + getUpgradableContracts().BeaconProxy + path.sep + BEACON_PROXY_JSON), + ); + assert(beaconProxyPath, 'Beacon proxy artifact not found'); + return await import(beaconProxyPath); +} + +export async function getBeaconProxyFactory( + hre: HardhatRuntimeEnvironment, + wallet: Wallet, + deploymentType?: DeploymentType, +): Promise> { + const beaconProxyArtifact = await getBeaconProxyArtifact(hre); + return new ContractFactory( + beaconProxyArtifact.abi, + beaconProxyArtifact.bytecode, + wallet, + deploymentType, + ); +} + +export async function getUpgradableBeaconArtifact(hre: HardhatRuntimeEnvironment): Promise { + const upgradeableBeaconPath = (await hre.artifacts.getArtifactPaths()).find((x) => + x.includes(path.sep + getUpgradableContracts().UpgradeableBeacon + path.sep + UPGRADABLE_BEACON_JSON), + ); + assert(upgradeableBeaconPath, 'Upgradeable beacon artifact not found'); + return await import(upgradeableBeaconPath); +} + +export async function getUpgradeableBeaconFactory( + hre: HardhatRuntimeEnvironment, + wallet: Wallet, + deploymentType?: DeploymentType, +): Promise> { + const upgradeableBeaconContract = await getUpgradableBeaconArtifact(hre); + return new ContractFactory( + upgradeableBeaconContract.abi, + upgradeableBeaconContract.bytecode, + wallet, + deploymentType, + ); +} + +export async function getProxyAdminArtifact(hre: HardhatRuntimeEnvironment): Promise { + const proxyAdminPath = (await hre.artifacts.getArtifactPaths()).find((x) => + x.includes(path.sep + getUpgradableContracts().ProxyAdmin + path.sep + PROXY_ADMIN_JSON), + ); + assert(proxyAdminPath, 'Proxy admin artifact not found'); + return await import(proxyAdminPath); +} + +export async function getProxyAdminFactory( + hre: HardhatRuntimeEnvironment, + wallet: Wallet, + deploymentType?: DeploymentType, +): Promise> { + const proxyAdminContract = await getProxyAdminArtifact(hre); + return new ContractFactory( + proxyAdminContract.abi, + proxyAdminContract.bytecode, + wallet, + deploymentType, + ); +} diff --git a/packages/hardhat-zksync-upgradable/src/utils/options.ts b/packages/hardhat-zksync-upgradable/src/utils/options.ts index aa43a8e07..2cfe87ace 100644 --- a/packages/hardhat-zksync-upgradable/src/utils/options.ts +++ b/packages/hardhat-zksync-upgradable/src/utils/options.ts @@ -17,7 +17,12 @@ export type StandaloneOptions; + } & CustomDataOptions & + InitialOwnerType; + +export interface InitialOwnerType { + initialOwner?: string; +} export type CustomDataOptions = TRequiredSeperateForProxy extends true | undefined @@ -61,7 +66,6 @@ interface Initializer { export type DeployBeaconProxyOptions = ProxyKindOption & Initializer & CustomDataOptions; export type DeployBeaconOptions = StandaloneOptions; export type DeployImplementationOptions = StandaloneOptions; -export type DeployProxyAdminOptions = DeployOpts & CustomDataOptions; export type DeployProxyOptions = StandaloneOptions & Initializer; export type UpgradeBeaconOptions = UpgradeOptions; export type UpgradeProxyOptions = UpgradeOptions & { diff --git a/packages/hardhat-zksync-upgradable/src/validations/validate-impl.ts b/packages/hardhat-zksync-upgradable/src/validations/validate-impl.ts index 20502c24d..c56671822 100644 --- a/packages/hardhat-zksync-upgradable/src/validations/validate-impl.ts +++ b/packages/hardhat-zksync-upgradable/src/validations/validate-impl.ts @@ -1,27 +1,35 @@ import { assertNotProxy, + assertStorageUpgradeSafe, assertUpgradeSafe, getImplementationAddress, getImplementationAddressFromBeacon, ValidationOptions, - assertStorageUpgradeSafe, } from '@openzeppelin/upgrades-core'; import { getStorageLayoutForAddress } from '../core/manifest-storage-layout'; import { Manifest } from '../core/manifest'; import { DeployData } from '../proxy-deployment/deploy-impl'; import { processProxyKind } from '../core/proxy-kind'; +/** + * Processes the proxy kind and returns the implementation address if proxyAddress is provided. + */ async function processProxyImpl(deployData: DeployData, proxyAddress: string | undefined, opts: ValidationOptions) { await processProxyKind(deployData.provider, proxyAddress, opts, deployData.validations, deployData.version); let currentImplAddress: string | undefined; if (proxyAddress !== undefined) { + // upgrade scenario currentImplAddress = await getImplementationAddress(deployData.provider, proxyAddress); } return currentImplAddress; } +/** + * Asserts that the address is not a proxy and returns the beacon's implementation address. + */ async function processBeaconImpl(deployData: DeployData, beaconAddress: string) { + // upgrade scenario await assertNotProxy(deployData.provider, beaconAddress); return await getImplementationAddressFromBeacon(deployData.provider, beaconAddress); } @@ -42,6 +50,10 @@ export async function validateImpl( } } +/** + * Processes the proxy kind and validates that the implementation in deployData is upgrade safe + * (compared to the proxy's current implementation if proxyAddress is specified). + */ export async function validateProxyImpl( deployData: DeployData, opts: ValidationOptions, @@ -51,6 +63,10 @@ export async function validateProxyImpl( return validateImpl(deployData, opts, currentImplAddress); } +/** + * Asserts that the address is not a proxy and validates that the implementation in deployData is upgrade safe + * compared to the beacon's current implementation. + */ export async function validateBeaconImpl( deployData: DeployData, opts: ValidationOptions, diff --git a/packages/hardhat-zksync-upgradable/test/fixture-projects/deployment-gas-estimation/contracts/BoxUups.sol b/packages/hardhat-zksync-upgradable/test/fixture-projects/deployment-gas-estimation/contracts/BoxUups.sol index 0b3345dd7..0bd67e5bb 100644 --- a/packages/hardhat-zksync-upgradable/test/fixture-projects/deployment-gas-estimation/contracts/BoxUups.sol +++ b/packages/hardhat-zksync-upgradable/test/fixture-projects/deployment-gas-estimation/contracts/BoxUups.sol @@ -11,7 +11,7 @@ contract BoxUups is Initializable, UUPSUpgradeable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } diff --git a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUups.sol b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUups.sol index 0b3345dd7..0bd67e5bb 100644 --- a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUups.sol +++ b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUups.sol @@ -11,7 +11,7 @@ contract BoxUups is Initializable, UUPSUpgradeable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } diff --git a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsMissingUpgradeTo.sol b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsMissingUpgradeTo.sol index bbd42edf5..0515d10fe 100644 --- a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsMissingUpgradeTo.sol +++ b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsMissingUpgradeTo.sol @@ -11,7 +11,7 @@ contract BoxUupsMissingUpgradeTo is Initializable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); } // Reads the last stored value diff --git a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsPublic.sol b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsPublic.sol index 2acadd47f..a2a716085 100644 --- a/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsPublic.sol +++ b/packages/hardhat-zksync-upgradable/test/fixture-projects/uups-e2e/contracts/BoxUupsPublic.sol @@ -11,7 +11,7 @@ contract BoxUupsPublic is Initializable, UUPSUpgradeable, OwnableUpgradeable { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } diff --git a/packages/hardhat-zksync-upgradable/test/tests.ts b/packages/hardhat-zksync-upgradable/test/tests.ts index 99772df49..af67a9716 100644 --- a/packages/hardhat-zksync-upgradable/test/tests.ts +++ b/packages/hardhat-zksync-upgradable/test/tests.ts @@ -1,16 +1,13 @@ import assert from 'assert'; import { ContractFactory, Provider, Contract } from 'zksync-ethers'; import chalk from 'chalk'; -import fsExtra from 'fs-extra'; -import path from 'path'; import { getAdminAddress } from '@openzeppelin/upgrades-core'; -import { LOCAL_SETUP_ZKSYNC_NETWORK, MANIFEST_DEFAULT_DIR } from '../src/constants'; -import { getAdminFactory } from '../src/proxy-deployment/deploy-proxy-admin'; +import { LOCAL_SETUP_ZKSYNC_NETWORK } from '../src/constants'; import { deploy } from '../src/proxy-deployment/deploy'; -import { getManifestAdmin } from '../src/admin'; import { deployBeacon, deployProxy, upgradeBeacon } from '../src/plugin'; -import { TEST_ADDRESS, authorizationErrors, standaloneValidationErrors, storageLayoutErrors } from './constants'; +import { getProxyAdminFactory } from '../src/utils/factories'; +import { TEST_ADDRESS, standaloneValidationErrors, storageLayoutErrors } from './constants'; import richWallets from './rich-wallets.json'; import { useEnvironment } from './helpers'; @@ -143,7 +140,6 @@ describe('Upgradable plugin tests', function () { await assert.rejects( this.env.zkUpgrades.upgradeProxy(this.zkWallet2, await boxUupsProxy.getAddress(), BoxV2), - (error: any) => error.message.includes(authorizationErrors.CALLER_NOT_OWNER), ); }); @@ -259,31 +255,6 @@ describe('Upgradable plugin tests', function () { const provider = new Provider(LOCAL_SETUP_ZKSYNC_NETWORK); - it('Should return the smart contract admin instance', async function () { - const contractName = 'Box'; - console.info(chalk.yellow(`Deploying ${contractName}...`)); - - const contract = await this.deployer.loadArtifact(contractName); - const deployedContract = await this.env.zkUpgrades.deployProxy(this.deployer.zkWallet, contract, [42], { - initializer: 'store', - }); - await deployedContract.waitForDeployment(); - - const adminInstance = await this.env.zkUpgrades.admin.getInstance(this.deployer.zkWallet); - const adminAddress = await adminInstance.getProxyAdmin(await deployedContract.getAddress()); - - assert(await adminInstance.getAddress(), adminAddress); - }); - - it('Should fail to return the smart contract admin instance', async function () { - // remove the manifest file to separate this test's manifest file from others - await fsExtra.remove(path.join(this.env.config.paths.root, MANIFEST_DEFAULT_DIR)); - - await assert.rejects(this.env.zkUpgrades.admin.getInstance(this.deployer.zkWallet), (error: any) => - error.message.includes(authorizationErrors.NO_PROXY_ADMIN_FOUND), - ); - }); - it('Should change the admin of an upgradable smart contract', async function () { const contractName = 'Box'; console.info(chalk.yellow(`Deploying ${contractName}...`)); @@ -293,8 +264,7 @@ describe('Upgradable plugin tests', function () { initializer: 'initialize', }); - const adminInstance = await this.env.zkUpgrades.admin.getInstance(this.deployer.zkWallet); - await this.env.zkUpgrades.admin.changeProxyAdmin( + await this.env.zkUpgrades.admin.transferProxyAdminOwnership( await deployedContract.getAddress(), richWallets[1].address, this.deployer.zkWallet, @@ -304,7 +274,6 @@ describe('Upgradable plugin tests', function () { await new Promise((resolve) => setTimeout(resolve, 2000)); const updatedAdminInstance = await getAdminAddress(provider, await deployedContract.getAddress()); - assert(updatedAdminInstance !== (await adminInstance.getAddress())); assert(updatedAdminInstance, richWallets[1].address); }); @@ -319,10 +288,10 @@ describe('Upgradable plugin tests', function () { initializer: 'initialize', }); - const adminFactory = await getAdminFactory(this.env, this.zkWallet2); - const newAdminContract = await deploy(adminFactory); + const adminFactory = await getProxyAdminFactory(this.env, this.zkWallet2); + const newAdminContract = await deploy(adminFactory, this.deployer.zkWallet.address); - await this.env.zkUpgrades.admin.changeProxyAdmin( + await this.env.zkUpgrades.admin.transferProxyAdminOwnership( await deployedContract.getAddress(), newAdminContract.address, this.deployer.zkWallet, @@ -337,7 +306,6 @@ describe('Upgradable plugin tests', function () { await deployedContract.getAddress(), contractV2, ), - (error: any) => error.message.includes(authorizationErrors.WRONG_PROXY_ADMIN), ); }); @@ -351,12 +319,11 @@ describe('Upgradable plugin tests', function () { }); await assert.rejects( - this.env.zkUpgrades.admin.changeProxyAdmin( + this.env.zkUpgrades.admin.transferProxyAdminOwnership( await deployedContract.getAddress(), richWallets[1].address, this.zkWallet2, ), - (error: any) => error.message.includes(authorizationErrors.CALLER_NOT_OWNER), ); }); @@ -365,16 +332,17 @@ describe('Upgradable plugin tests', function () { console.info(chalk.yellow(`Deploying ${contractName}...`)); const contract = await this.deployer.loadArtifact(contractName); - await this.env.zkUpgrades.deployProxy(this.deployer.zkWallet, contract, [42], { + const proxy = await this.env.zkUpgrades.deployProxy(this.deployer.zkWallet, contract, [42], { initializer: 'initialize', }); - const admin = await getManifestAdmin(this.env, this.deployer.zkWallet); - - await this.env.zkUpgrades.admin.transferProxyAdminOwnership(TEST_ADDRESS, this.deployer.zkWallet); - const newOwner = await admin.owner(); - - assert(newOwner, TEST_ADDRESS); + await this.env.zkUpgrades.admin.transferProxyAdminOwnership( + await proxy.getAddress(), + TEST_ADDRESS, + this.deployer.zkWallet, + ); + const savedAdmin = await getAdminAddress(provider, await proxy.getAddress()); + assert(savedAdmin, TEST_ADDRESS); }); it('Should fail to change the owner - wrong signer', async function () { @@ -382,23 +350,16 @@ describe('Upgradable plugin tests', function () { console.info(chalk.yellow(`Deploying ${contractName}...`)); const contract = await this.deployer.loadArtifact(contractName); - await this.env.zkUpgrades.deployProxy(this.deployer.zkWallet, contract, [42], { + const proxy = await this.env.zkUpgrades.deployProxy(this.deployer.zkWallet, contract, [42], { initializer: 'initialize', }); await assert.rejects( - this.env.zkUpgrades.admin.transferProxyAdminOwnership(TEST_ADDRESS, this.zkWallet2), - (error: any) => error.message.includes(authorizationErrors.CALLER_NOT_OWNER), - ); - }); - - it('Should fail to change the owner - no admin', async function () { - // remove the manifest file to separate this test's manifest file from others - await fsExtra.remove(path.join(this.env.config.paths.root, MANIFEST_DEFAULT_DIR)); - - await assert.rejects( - this.env.zkUpgrades.admin.transferProxyAdminOwnership(TEST_ADDRESS, this.zkWallet2), - (error: any) => error.message.includes(authorizationErrors.NO_PROXY_ADMIN_FOUND), + this.env.zkUpgrades.admin.transferProxyAdminOwnership( + await proxy.getAddress(), + TEST_ADDRESS, + this.zkWallet2, + ), ); }); }); diff --git a/packages/hardhat-zksync/package.json b/packages/hardhat-zksync/package.json index e96fe6605..067a33398 100644 --- a/packages/hardhat-zksync/package.json +++ b/packages/hardhat-zksync/package.json @@ -40,9 +40,8 @@ "@matterlabs/hardhat-zksync-upgradable": "workspace:^", "@matterlabs/hardhat-zksync-node": "workspace:^", "@matterlabs/hardhat-zksync-ethers": "workspace:^", - "@nomicfoundation/hardhat-ethers": "^3.0.4", "@nomicfoundation/hardhat-verify": "^2.0.0", - "@openzeppelin/upgrades-core": "^1.31.3", + "@openzeppelin/upgrades-core": "^1.37.0", "ethers": "^6.12.2", "zksync-ethers": "^6.11.2", "chai": "^4.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b4267d711..bb0fc58f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,10 +45,10 @@ importers: specifier: ^0.6.1 version: 0.6.1(@openzeppelin/contracts-upgradeable@4.9.6)(@openzeppelin/contracts@4.9.6) '@openzeppelin/contracts': - specifier: ^4.9.2 + specifier: ^4.9.6 version: 4.9.6 '@openzeppelin/contracts-upgradeable': - specifier: ^4.9.2 + specifier: ^4.9.6 version: 4.9.6 chalk: specifier: ^4.1.2 @@ -287,16 +287,16 @@ importers: version: link:../../packages/hardhat-zksync-solc '@matterlabs/zksync-contracts': specifier: ^0.6.1 - version: 0.6.1(@openzeppelin/contracts-upgradeable@4.9.6)(@openzeppelin/contracts@4.9.6) + version: 0.6.1(@openzeppelin/contracts-upgradeable@5.0.2(@openzeppelin/contracts@5.0.2))(@openzeppelin/contracts@5.0.2) '@nomicfoundation/hardhat-chai-matchers': specifier: ^2.0.7 version: 2.0.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.4.1)(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/contracts': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2 '@openzeppelin/contracts-upgradeable': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2(@openzeppelin/contracts@5.0.2) chai: specifier: ^4.3.4 version: 4.4.1 @@ -369,13 +369,13 @@ importers: version: link:../../packages/hardhat-zksync-solc '@matterlabs/zksync-contracts': specifier: ^0.6.1 - version: 0.6.1(@openzeppelin/contracts-upgradeable@4.9.6)(@openzeppelin/contracts@4.9.6) + version: 0.6.1(@openzeppelin/contracts-upgradeable@5.0.2(@openzeppelin/contracts@5.0.2))(@openzeppelin/contracts@5.0.2) '@openzeppelin/contracts': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2 '@openzeppelin/contracts-upgradeable': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2(@openzeppelin/contracts@5.0.2) chalk: specifier: ^4.1.2 version: 4.1.2 @@ -443,9 +443,15 @@ importers: '@matterlabs/hardhat-zksync-verify': specifier: workspace:^ version: link:../../packages/hardhat-zksync-verify + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.6 + version: 3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/contracts-upgradeable': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2(@openzeppelin/contracts@5.0.2) + '@openzeppelin/hardhat-upgrades': + specifier: ^3.2.1 + version: 3.4.0(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.8(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) chalk: specifier: ^4.1.2 version: 4.1.2 @@ -463,8 +469,8 @@ importers: version: 6.11.2(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) devDependencies: '@openzeppelin/contracts': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2 '@types/node': specifier: ^18.11.17 version: 18.19.33 @@ -519,9 +525,12 @@ importers: '@matterlabs/hardhat-zksync-verify': specifier: workspace:^ version: link:../../packages/hardhat-zksync-verify + '@nomicfoundation/hardhat-ethers': + specifier: 3.0.6 + version: 3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/contracts-upgradeable': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2(@openzeppelin/contracts@5.0.2) chalk: specifier: ^4.1.2 version: 4.1.2 @@ -539,8 +548,8 @@ importers: version: 6.11.2(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) devDependencies: '@openzeppelin/contracts': - specifier: ^4.9.2 - version: 4.9.6 + specifier: ^5.0.2 + version: 5.0.2 '@types/node': specifier: ^18.11.17 version: 18.19.33 @@ -848,15 +857,12 @@ importers: '@matterlabs/hardhat-zksync-verify': specifier: workspace:^ version: link:../hardhat-zksync-verify - '@nomicfoundation/hardhat-ethers': - specifier: ^3.0.4 - version: 3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@nomicfoundation/hardhat-verify': specifier: ^2.0.0 version: 2.0.8(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/upgrades-core': - specifier: ^1.31.3 - version: 1.33.1 + specifier: ^1.37.0 + version: 1.38.0 chai: specifier: ^4.3.4 version: 4.4.1 @@ -1322,17 +1328,23 @@ importers: specifier: workspace:^ version: link:../hardhat-zksync-solc '@openzeppelin/contracts-hardhat-zksync-upgradable': - specifier: npm:@openzeppelin/contracts@^4.9.2 - version: '@openzeppelin/contracts@4.9.6' - '@openzeppelin/defender-admin-client': - specifier: ^1.52.0 - version: 1.54.6(bufferutil@4.0.8)(debug@4.3.5)(utf-8-validate@5.0.10) + specifier: npm:@openzeppelin/contracts@^5.0.2 + version: '@openzeppelin/contracts@5.0.2' + '@openzeppelin/defender-sdk-base-client': + specifier: ^1.10.0 + version: 1.14.3 + '@openzeppelin/defender-sdk-deploy-client': + specifier: ^1.10.0 + version: 1.14.3 + '@openzeppelin/defender-sdk-network-client': + specifier: ^1.10.0 + version: 1.14.4(debug@4.3.5) '@openzeppelin/hardhat-upgrades': - specifier: ~2.5.1 - version: 2.5.1(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + specifier: ^3.2.1 + version: 3.4.0(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.8(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/upgrades-core': - specifier: ^1.31.3 - version: 1.33.1 + specifier: ^1.37.0 + version: 1.38.0 chalk: specifier: ^4.1.2 version: 4.1.2 @@ -1833,9 +1845,6 @@ packages: '@ethersproject/base64@5.7.0': resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==, tarball: https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz} - '@ethersproject/basex@5.7.0': - resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==, tarball: https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz} - '@ethersproject/bignumber@5.7.0': resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==, tarball: https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz} @@ -1845,18 +1854,9 @@ packages: '@ethersproject/constants@5.7.0': resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==, tarball: https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz} - '@ethersproject/contracts@5.7.0': - resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==, tarball: https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz} - '@ethersproject/hash@5.7.0': resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==, tarball: https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz} - '@ethersproject/hdnode@5.7.0': - resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==, tarball: https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz} - - '@ethersproject/json-wallets@5.7.0': - resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==, tarball: https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz} - '@ethersproject/keccak256@5.7.0': resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==, tarball: https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz} @@ -1866,48 +1866,24 @@ packages: '@ethersproject/networks@5.7.1': resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==, tarball: https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz} - '@ethersproject/pbkdf2@5.7.0': - resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==, tarball: https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz} - '@ethersproject/properties@5.7.0': resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==, tarball: https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz} - '@ethersproject/providers@5.7.2': - resolution: {integrity: sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==, tarball: https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz} - - '@ethersproject/random@5.7.0': - resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==, tarball: https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz} - '@ethersproject/rlp@5.7.0': resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==, tarball: https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz} - '@ethersproject/sha2@5.7.0': - resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==, tarball: https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz} - '@ethersproject/signing-key@5.7.0': resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==, tarball: https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz} - '@ethersproject/solidity@5.7.0': - resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==, tarball: https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz} - '@ethersproject/strings@5.7.0': resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==, tarball: https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz} '@ethersproject/transactions@5.7.0': resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==, tarball: https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz} - '@ethersproject/units@5.7.0': - resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==, tarball: https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz} - - '@ethersproject/wallet@5.7.0': - resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==, tarball: https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz} - '@ethersproject/web@5.7.1': resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==, tarball: https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz} - '@ethersproject/wordlists@5.7.0': - resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==, tarball: https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz} - '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==, tarball: https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz} engines: {node: '>=14'} @@ -2068,44 +2044,44 @@ packages: peerDependencies: hardhat: ^2.0.4 - '@nomicfoundation/slang-darwin-arm64@0.15.1': - resolution: {integrity: sha512-taPHlCUNNztQZJze9OlZFK9cZH8Ut4Ih4QJQo5CKebXx9vWOUtmSBfKv/M2P8hiV/iL7Q5sPwR7HY9uZYnb49Q==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-darwin-arm64/-/slang-darwin-arm64-0.15.1.tgz} + '@nomicfoundation/slang-darwin-arm64@0.17.0': + resolution: {integrity: sha512-O0q94EUtoWy9A5kOTOa9/khtxXDYnLqmuda9pQELurSiwbQEVCPQL8kb34VbOW+ifdre66JM/05Xw9JWhIZ9sA==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-darwin-arm64/-/slang-darwin-arm64-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-darwin-x64@0.15.1': - resolution: {integrity: sha512-kgZh5KQe/UcbFqn1EpyrvBuT8E6I1kWSgGPtO25t90zAqFv23sMUPdn7wLpMjngkD+quIIgrzQGUtupS5YYEig==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-darwin-x64/-/slang-darwin-x64-0.15.1.tgz} + '@nomicfoundation/slang-darwin-x64@0.17.0': + resolution: {integrity: sha512-IaDbHzvT08sBK2HyGzonWhq1uu8IxdjmTqAWHr25Oh/PYnamdi8u4qchZXXYKz/DHLoYN3vIpBXoqLQIomhD/g==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-darwin-x64/-/slang-darwin-x64-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-linux-arm64-gnu@0.15.1': - resolution: {integrity: sha512-Iw8mepaccKRWllPU9l+hoe88LN9fScC0Px3nFeNQy26qk1ueO0tjovP1dhTvmGwHUxacOYPqhQTUn7Iu0oxNoQ==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-arm64-gnu/-/slang-linux-arm64-gnu-0.15.1.tgz} + '@nomicfoundation/slang-linux-arm64-gnu@0.17.0': + resolution: {integrity: sha512-Lj4anvOsQZxs1SycG8VyT2Rl2oqIhyLSUCgGepTt3CiJ/bM+8r8bLJIgh8vKkki4BWz49YsYIgaJB2IPv8FFTw==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-arm64-gnu/-/slang-linux-arm64-gnu-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-linux-arm64-musl@0.15.1': - resolution: {integrity: sha512-zcesdQZwRgrT7ND+3TZUjRK/uGF20EfhEfCg8ZMhrb4Q7XaK1JvtHazIs03TV8Jcs30TPkEXks8Qi0Zdfy4RuA==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-arm64-musl/-/slang-linux-arm64-musl-0.15.1.tgz} + '@nomicfoundation/slang-linux-arm64-musl@0.17.0': + resolution: {integrity: sha512-/xkTCa9d5SIWUBQE3BmLqDFfJRr4yUBwbl4ynPiGUpRXrD69cs6pWKkwjwz/FdBpXqVo36I+zY95qzoTj/YhOA==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-arm64-musl/-/slang-linux-arm64-musl-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-linux-x64-gnu@0.15.1': - resolution: {integrity: sha512-FSmAnzKm58TFIwx4r/wOZtqfDx0nI6AfvnOh8kLDF5OxpWW3r0q9fq8lyaUReg9C/ZgCZRBn+m5WGrNKCZcvPQ==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-x64-gnu/-/slang-linux-x64-gnu-0.15.1.tgz} + '@nomicfoundation/slang-linux-x64-gnu@0.17.0': + resolution: {integrity: sha512-oe5IO5vntOqYvTd67deCHPIWuSuWm6aYtT2/0Kqz2/VLtGz4ClEulBSRwfnNzBVtw2nksWipE1w8BzhImI7Syg==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-x64-gnu/-/slang-linux-x64-gnu-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-linux-x64-musl@0.15.1': - resolution: {integrity: sha512-hnoA/dgeHQ8aS0SReABYkxf0d/Q6DdaKsaYv6ev21wyQA7TROxT1X3nekECLGu1GYLML8pzvD9vyAMBRKOkkyg==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-x64-musl/-/slang-linux-x64-musl-0.15.1.tgz} + '@nomicfoundation/slang-linux-x64-musl@0.17.0': + resolution: {integrity: sha512-PpYCI5K/kgLAMXaPY0V4VST5gCDprEOh7z/47tbI8kJQumI5odjsj/Cs8MpTo7/uRH6flKYbVNgUzcocWVYrAQ==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-linux-x64-musl/-/slang-linux-x64-musl-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-win32-arm64-msvc@0.15.1': - resolution: {integrity: sha512-2H0chHQ4uTh4l4UxN5fIVHR5mKaL5mfYTID6kxxxv2+KAh68EpYWwxLlkS5So90R2WcuPvFvTVKLm/uRo4h4dg==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-arm64-msvc/-/slang-win32-arm64-msvc-0.15.1.tgz} + '@nomicfoundation/slang-win32-arm64-msvc@0.17.0': + resolution: {integrity: sha512-u/Mkf7OjokdBilP7QOJj6QYJU4/mjkbKnTX21wLyCIzeVWS7yafRPYpBycKIBj2pRRZ6ceAY5EqRpb0aiCq+0Q==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-arm64-msvc/-/slang-win32-arm64-msvc-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-win32-ia32-msvc@0.15.1': - resolution: {integrity: sha512-CVZWBnbpFlVBg/m7bsiw70jY3p9TGH9vxq0vLEEJ56yK+QPosxPrKMcADojtGjIOjWjPSZ+lCoo5ilnW0a249g==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-ia32-msvc/-/slang-win32-ia32-msvc-0.15.1.tgz} + '@nomicfoundation/slang-win32-ia32-msvc@0.17.0': + resolution: {integrity: sha512-XJBVQfNnZQUv0tP2JSJ573S+pmgrLWgqSZOGaMllnB/TL1gRci4Z7dYRJUF2s82GlRJE+FHSI2Ro6JISKmlXCg==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-ia32-msvc/-/slang-win32-ia32-msvc-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang-win32-x64-msvc@0.15.1': - resolution: {integrity: sha512-cyER8M1fdBTzIfihy55d4LGGlN/eQxDqfRUTXgJf1VvNR98tRB0Q3nBfyh5PK2yP98B4lMt3RJYDqTQu+dOVDA==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-x64-msvc/-/slang-win32-x64-msvc-0.15.1.tgz} + '@nomicfoundation/slang-win32-x64-msvc@0.17.0': + resolution: {integrity: sha512-zPGsAeiTfqfPNYHD8BfrahQmYzA78ZraoHKTGraq/1xwJwzBK4bu/NtvVA4pJjBV+B4L6DCxVhSbpn40q26JQA==, tarball: https://registry.npmjs.org/@nomicfoundation/slang-win32-x64-msvc/-/slang-win32-x64-msvc-0.17.0.tgz} engines: {node: '>= 10'} - '@nomicfoundation/slang@0.15.1': - resolution: {integrity: sha512-th7nxRWRXf583uHpWUCd8U7BYxIqJX2f3oZLff/mlPkqIr45pD2hLT/o00eCjrBIR8N7vybUULZg1CeThGNk7g==, tarball: https://registry.npmjs.org/@nomicfoundation/slang/-/slang-0.15.1.tgz} + '@nomicfoundation/slang@0.17.0': + resolution: {integrity: sha512-1GlkGRcGpVnjFw9Z1vvDKOKo2mzparFt7qrl2pDxWp+jrVtlvej98yCMX52pVyrYE7ZeOSZFnx/DtsSgoukStQ==, tarball: https://registry.npmjs.org/@nomicfoundation/slang/-/slang-0.17.0.tgz} engines: {node: '>= 10'} '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1': @@ -2187,41 +2163,46 @@ packages: '@openzeppelin/contracts-upgradeable@4.9.6': resolution: {integrity: sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA==, tarball: https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.6.tgz} + '@openzeppelin/contracts-upgradeable@5.0.2': + resolution: {integrity: sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ==, tarball: https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz} + peerDependencies: + '@openzeppelin/contracts': 5.0.2 + '@openzeppelin/contracts@4.9.6': resolution: {integrity: sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==, tarball: https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz} - '@openzeppelin/defender-admin-client@1.54.6': - resolution: {integrity: sha512-P4lxJDySrekWNuPa7FeyW/UmuxnuIXIAGYr5gZnmnMHRsYNaw+XfgkiCDfoGtjEyJbXYxXttYF6iAZhWQPdf1g==, tarball: https://registry.npmjs.org/@openzeppelin/defender-admin-client/-/defender-admin-client-1.54.6.tgz} - deprecated: This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead. - - '@openzeppelin/defender-base-client@1.54.6': - resolution: {integrity: sha512-PTef+rMxkM5VQ7sLwLKSjp2DBakYQd661ZJiSRywx+q/nIpm3B/HYGcz5wPZCA5O/QcEP6TatXXDoeMwimbcnw==, tarball: https://registry.npmjs.org/@openzeppelin/defender-base-client/-/defender-base-client-1.54.6.tgz} - deprecated: This package has been deprecated and will no longer be maintained, please use @openzeppelin/defender-sdk package instead. + '@openzeppelin/contracts@5.0.2': + resolution: {integrity: sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==, tarball: https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz} '@openzeppelin/defender-sdk-base-client@1.14.3': resolution: {integrity: sha512-4yG9E8N1c/ZP2jNR+Ah19wi7SBKpauAV/VcYcm7rg1dltDbzbH/oZnnXJlymT7IfjTPXkKHW8TPsaqz3EjS7tA==, tarball: https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.3.tgz} + '@openzeppelin/defender-sdk-base-client@1.14.4': + resolution: {integrity: sha512-tOePVQLKpqfGQ1GMzHvSBNd2psPYd86LDNpvdl5gjD0Y2kW/zNh5qBXy29RraGtk/qc8zs9hzS5pAOh0vhGkGQ==, tarball: https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.4.tgz} + '@openzeppelin/defender-sdk-deploy-client@1.14.3': resolution: {integrity: sha512-51WIZJz251lndK7uQU4gBE0gBX+2ZNTgf+hemtJUEPCpHtkooBRFFMID3EPGMKXVqf872pU8K3Huu9PyYQu6bw==, tarball: https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.14.3.tgz} - '@openzeppelin/hardhat-upgrades@2.5.1': - resolution: {integrity: sha512-wRwq9f2PqlfIdNGFApsqRpqptqy98exSFp8SESb6Brgw4L07sExySInNJhscM/tWVSnR1Qnuws9Ck6Fs5zIxvg==, tarball: https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-2.5.1.tgz} + '@openzeppelin/defender-sdk-deploy-client@1.14.4': + resolution: {integrity: sha512-+diSoz1zid37LMsY2RDxI+uAsYx9Eryg8Vz+yfvuyd56fXrzjQEln7BBtYQw+2zp9yvyAByOL5XSQdrQga9OBQ==, tarball: https://registry.npmjs.org/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.14.4.tgz} + + '@openzeppelin/defender-sdk-network-client@1.14.4': + resolution: {integrity: sha512-OS0H5b0vgYacJcwkvUFJUaRuyUaXhIRl916W5xLvGia5H6i/qn3dP8MZ7oLcPwKc8jB+ucRytO4H/AHsea0aVA==, tarball: https://registry.npmjs.org/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.14.4.tgz} + + '@openzeppelin/hardhat-upgrades@3.4.0': + resolution: {integrity: sha512-bfPtUCmRT6kfh/Mz56tAAGS8N22Zr3rdCMG3E3g8CW61QRGsaeFHnZRetBgu1JoKocjCavEtis5/x60m+o5XUQ==, tarball: https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.4.0.tgz} hasBin: true peerDependencies: '@nomicfoundation/hardhat-ethers': ^3.0.0 - '@nomicfoundation/hardhat-verify': ^1.1.0 + '@nomicfoundation/hardhat-verify': ^2.0.0 ethers: ^6.6.0 hardhat: ^2.0.2 peerDependenciesMeta: '@nomicfoundation/hardhat-verify': optional: true - '@openzeppelin/upgrades-core@1.33.1': - resolution: {integrity: sha512-YRxIRhTY1b+j7+NUUu8Uuem5ugxKexEMVd8dBRWNgWeoN1gS1OCrhgUg0ytL+54vzQ+SGWZDfNnzjVuI1Cj1Zw==, tarball: https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.33.1.tgz} - hasBin: true - - '@openzeppelin/upgrades-core@1.35.0': - resolution: {integrity: sha512-XwwhJyPxACQ7rMhKAPCL6rhTXhbeumeQ3opmurEsHg025vHnISHwTPHd5VxzmOwbMBIJ7em1lnRTu+J2/IUWFQ==, tarball: https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.35.0.tgz} + '@openzeppelin/upgrades-core@1.38.0': + resolution: {integrity: sha512-0kbc6Wd6S8/Kmhg7oqRIn+GBpAL+EccYQh+SjgVBEktpkzTDN56KHuuxYHXnpXclWaO6l7u/TRMe6LsHCHqJHw==, tarball: https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.38.0.tgz} hasBin: true '@pkgjs/parseargs@0.11.0': @@ -2558,9 +2539,6 @@ packages: resolution: {integrity: sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==, tarball: https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz} engines: {node: '>=0.3.0'} - aes-js@3.0.0: - resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==, tarball: https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz} - aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==, tarball: https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz} @@ -2715,9 +2693,6 @@ packages: bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==, tarball: https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz} - bech32@1.1.4: - resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==, tarball: https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz} - better-path-resolve@1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==, tarball: https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz} engines: {node: '>=4'} @@ -3374,9 +3349,6 @@ packages: resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==, tarball: https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz} engines: {node: '>=10.0.0'} - ethers@5.7.2: - resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==, tarball: https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz} - ethers@6.12.2: resolution: {integrity: sha512-MNfR2kzZyNF8bRNDSmjM+rT1+yqCgYNqfrXyNnpiNId2MQPiAOOr/7lrgdrdwoBxzKPSnSYZaGb5lcNyvzhuvA==, tarball: https://registry.npmjs.org/ethers/-/ethers-6.12.2.tgz} engines: {node: '>=14.0.0'} @@ -4098,6 +4070,10 @@ packages: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==, tarball: https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz} engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==, tarball: https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz} + engines: {node: '>=16 || 14 >=14.17'} + minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==, tarball: https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz} engines: {node: '>= 6'} @@ -5093,18 +5069,6 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, tarball: https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz} - ws@7.4.6: - resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==, tarball: https://registry.npmjs.org/ws/-/ws-7.4.6.tgz} - engines: {node: '>=8.3.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==, tarball: https://registry.npmjs.org/ws/-/ws-7.5.9.tgz} engines: {node: '>=8.3.0'} @@ -5481,11 +5445,6 @@ snapshots: dependencies: '@ethersproject/bytes': 5.7.0 - '@ethersproject/basex@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/bignumber@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 @@ -5500,19 +5459,6 @@ snapshots: dependencies: '@ethersproject/bignumber': 5.7.0 - '@ethersproject/contracts@5.7.0': - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/hash@5.7.0': dependencies: '@ethersproject/abstract-signer': 5.7.0 @@ -5525,37 +5471,6 @@ snapshots: '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - '@ethersproject/hdnode@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/wordlists': 5.7.0 - - '@ethersproject/json-wallets@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - '@ethersproject/keccak256@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 @@ -5567,57 +5482,15 @@ snapshots: dependencies: '@ethersproject/logger': 5.7.0 - '@ethersproject/pbkdf2@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/properties@5.7.0': dependencies: '@ethersproject/logger': 5.7.0 - '@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/web': 5.7.1 - bech32: 1.1.4 - ws: 7.4.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@ethersproject/random@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/rlp@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 - '@ethersproject/sha2@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - hash.js: 1.1.7 - '@ethersproject/signing-key@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 @@ -5627,15 +5500,6 @@ snapshots: elliptic: 6.5.4 hash.js: 1.1.7 - '@ethersproject/solidity@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/strings@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 @@ -5654,30 +5518,6 @@ snapshots: '@ethersproject/rlp': 5.7.0 '@ethersproject/signing-key': 5.7.0 - '@ethersproject/units@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/wallet@5.7.0': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/json-wallets': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/wordlists': 5.7.0 - '@ethersproject/web@5.7.1': dependencies: '@ethersproject/base64': 5.7.0 @@ -5686,14 +5526,6 @@ snapshots: '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - '@ethersproject/wordlists@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@fastify/busboy@2.1.1': {} '@humanwhocodes/config-array@0.11.14': @@ -5760,6 +5592,11 @@ snapshots: '@openzeppelin/contracts': 4.9.6 '@openzeppelin/contracts-upgradeable': 4.9.6 + '@matterlabs/zksync-contracts@0.6.1(@openzeppelin/contracts-upgradeable@5.0.2(@openzeppelin/contracts@5.0.2))(@openzeppelin/contracts@5.0.2)': + dependencies: + '@openzeppelin/contracts': 5.0.2 + '@openzeppelin/contracts-upgradeable': 5.0.2(@openzeppelin/contracts@5.0.2) + '@metamask/eth-sig-util@4.0.1': dependencies: ethereumjs-abi: 0.6.8 @@ -5869,35 +5706,35 @@ snapshots: transitivePeerDependencies: - supports-color - '@nomicfoundation/slang-darwin-arm64@0.15.1': {} + '@nomicfoundation/slang-darwin-arm64@0.17.0': {} - '@nomicfoundation/slang-darwin-x64@0.15.1': {} + '@nomicfoundation/slang-darwin-x64@0.17.0': {} - '@nomicfoundation/slang-linux-arm64-gnu@0.15.1': {} + '@nomicfoundation/slang-linux-arm64-gnu@0.17.0': {} - '@nomicfoundation/slang-linux-arm64-musl@0.15.1': {} + '@nomicfoundation/slang-linux-arm64-musl@0.17.0': {} - '@nomicfoundation/slang-linux-x64-gnu@0.15.1': {} + '@nomicfoundation/slang-linux-x64-gnu@0.17.0': {} - '@nomicfoundation/slang-linux-x64-musl@0.15.1': {} + '@nomicfoundation/slang-linux-x64-musl@0.17.0': {} - '@nomicfoundation/slang-win32-arm64-msvc@0.15.1': {} + '@nomicfoundation/slang-win32-arm64-msvc@0.17.0': {} - '@nomicfoundation/slang-win32-ia32-msvc@0.15.1': {} + '@nomicfoundation/slang-win32-ia32-msvc@0.17.0': {} - '@nomicfoundation/slang-win32-x64-msvc@0.15.1': {} + '@nomicfoundation/slang-win32-x64-msvc@0.17.0': {} - '@nomicfoundation/slang@0.15.1': + '@nomicfoundation/slang@0.17.0': dependencies: - '@nomicfoundation/slang-darwin-arm64': 0.15.1 - '@nomicfoundation/slang-darwin-x64': 0.15.1 - '@nomicfoundation/slang-linux-arm64-gnu': 0.15.1 - '@nomicfoundation/slang-linux-arm64-musl': 0.15.1 - '@nomicfoundation/slang-linux-x64-gnu': 0.15.1 - '@nomicfoundation/slang-linux-x64-musl': 0.15.1 - '@nomicfoundation/slang-win32-arm64-msvc': 0.15.1 - '@nomicfoundation/slang-win32-ia32-msvc': 0.15.1 - '@nomicfoundation/slang-win32-x64-msvc': 0.15.1 + '@nomicfoundation/slang-darwin-arm64': 0.17.0 + '@nomicfoundation/slang-darwin-x64': 0.17.0 + '@nomicfoundation/slang-linux-arm64-gnu': 0.17.0 + '@nomicfoundation/slang-linux-arm64-musl': 0.17.0 + '@nomicfoundation/slang-linux-x64-gnu': 0.17.0 + '@nomicfoundation/slang-linux-x64-musl': 0.17.0 + '@nomicfoundation/slang-win32-arm64-msvc': 0.17.0 + '@nomicfoundation/slang-win32-ia32-msvc': 0.17.0 + '@nomicfoundation/slang-win32-x64-msvc': 0.17.0 '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1': optional: true @@ -5968,90 +5805,84 @@ snapshots: '@openzeppelin/contracts-upgradeable@4.9.6': {} + '@openzeppelin/contracts-upgradeable@5.0.2(@openzeppelin/contracts@5.0.2)': + dependencies: + '@openzeppelin/contracts': 5.0.2 + '@openzeppelin/contracts@4.9.6': {} - '@openzeppelin/defender-admin-client@1.54.6(bufferutil@4.0.8)(debug@4.3.5)(utf-8-validate@5.0.10)': + '@openzeppelin/contracts@5.0.2': {} + + '@openzeppelin/defender-sdk-base-client@1.14.3': dependencies: - '@openzeppelin/defender-base-client': 1.54.6(debug@4.3.5) - axios: 1.7.2(debug@4.3.5) - ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - lodash: 4.17.21 - node-fetch: 2.7.0 + amazon-cognito-identity-js: 6.3.12 + async-retry: 1.3.3 transitivePeerDependencies: - - bufferutil - - debug - encoding - - utf-8-validate - '@openzeppelin/defender-base-client@1.54.6(debug@4.3.5)': + '@openzeppelin/defender-sdk-base-client@1.14.4': dependencies: amazon-cognito-identity-js: 6.3.12 async-retry: 1.3.3 + transitivePeerDependencies: + - encoding + + '@openzeppelin/defender-sdk-deploy-client@1.14.3': + dependencies: + '@openzeppelin/defender-sdk-base-client': 1.14.3 axios: 1.7.2(debug@4.3.5) lodash: 4.17.21 - node-fetch: 2.7.0 transitivePeerDependencies: - debug - encoding - '@openzeppelin/defender-sdk-base-client@1.14.3': + '@openzeppelin/defender-sdk-deploy-client@1.14.4(debug@4.3.5)': dependencies: - amazon-cognito-identity-js: 6.3.12 - async-retry: 1.3.3 + '@openzeppelin/defender-sdk-base-client': 1.14.4 + axios: 1.7.2(debug@4.3.5) + lodash: 4.17.21 transitivePeerDependencies: + - debug - encoding - '@openzeppelin/defender-sdk-deploy-client@1.14.3(debug@4.3.5)': + '@openzeppelin/defender-sdk-network-client@1.14.4(debug@4.3.5)': dependencies: - '@openzeppelin/defender-sdk-base-client': 1.14.3 + '@openzeppelin/defender-sdk-base-client': 1.14.4 axios: 1.7.2(debug@4.3.5) lodash: 4.17.21 transitivePeerDependencies: - debug - encoding - '@openzeppelin/hardhat-upgrades@2.5.1(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + '@openzeppelin/hardhat-upgrades@3.4.0(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@2.0.8(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: '@nomicfoundation/hardhat-ethers': 3.0.6(ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - '@openzeppelin/defender-admin-client': 1.54.6(bufferutil@4.0.8)(debug@4.3.5)(utf-8-validate@5.0.10) - '@openzeppelin/defender-base-client': 1.54.6(debug@4.3.5) - '@openzeppelin/defender-sdk-base-client': 1.14.3 - '@openzeppelin/defender-sdk-deploy-client': 1.14.3(debug@4.3.5) - '@openzeppelin/upgrades-core': 1.35.0 + '@openzeppelin/defender-sdk-base-client': 1.14.4 + '@openzeppelin/defender-sdk-deploy-client': 1.14.4(debug@4.3.5) + '@openzeppelin/defender-sdk-network-client': 1.14.4(debug@4.3.5) + '@openzeppelin/upgrades-core': 1.38.0 chalk: 4.1.2 debug: 4.3.5 ethereumjs-util: 7.1.5 ethers: 6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) hardhat: 2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) proper-lockfile: 4.1.2 - undici: 5.28.4 + undici: 6.18.2 + optionalDependencies: + '@nomicfoundation/hardhat-verify': 2.0.8(hardhat@2.22.5(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) transitivePeerDependencies: - - bufferutil - encoding - supports-color - - utf-8-validate - '@openzeppelin/upgrades-core@1.33.1': + '@openzeppelin/upgrades-core@1.38.0': dependencies: + '@nomicfoundation/slang': 0.17.0 cbor: 9.0.2 chalk: 4.1.2 compare-versions: 6.1.0 debug: 4.3.5 ethereumjs-util: 7.1.5 - minimist: 1.2.8 - proper-lockfile: 4.1.2 - solidity-ast: 0.4.56 - transitivePeerDependencies: - - supports-color - - '@openzeppelin/upgrades-core@1.35.0': - dependencies: - '@nomicfoundation/slang': 0.15.1 - cbor: 9.0.2 - chalk: 4.1.2 - compare-versions: 6.1.0 - debug: 4.3.5 - ethereumjs-util: 7.1.5 + minimatch: 9.0.5 minimist: 1.2.8 proper-lockfile: 4.1.2 solidity-ast: 0.4.56 @@ -6470,8 +6301,6 @@ snapshots: adm-zip@0.4.16: {} - aes-js@3.0.0: {} - aes-js@4.0.0-beta.5: {} agent-base@6.0.2: @@ -6661,8 +6490,6 @@ snapshots: dependencies: tweetnacl: 0.14.5 - bech32@1.1.4: {} - better-path-resolve@1.0.0: dependencies: is-windows: 1.0.2 @@ -7567,42 +7394,6 @@ snapshots: ethereum-cryptography: 0.1.3 rlp: 2.2.7 - ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/contracts': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/json-wallets': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@ethersproject/random': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/solidity': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/units': 5.7.0 - '@ethersproject/wallet': 5.7.0 - '@ethersproject/web': 5.7.1 - '@ethersproject/wordlists': 5.7.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - ethers@6.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@adraffy/ens-normalize': 1.10.1 @@ -8397,6 +8188,10 @@ snapshots: dependencies: brace-expansion: 2.0.1 + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + minimist-options@4.1.0: dependencies: arrify: 1.0.1 @@ -9455,11 +9250,6 @@ snapshots: wrappy@1.0.2: {} - ws@7.4.6(bufferutil@4.0.8)(utf-8-validate@5.0.10): - optionalDependencies: - bufferutil: 4.0.8 - utf-8-validate: 5.0.10 - ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8