diff --git a/content/contracts/3.x/upgradeable.mdx b/content/contracts/3.x/upgradeable.mdx index 702b6eea..3e8816ba 100644 --- a/content/contracts/3.x/upgradeable.mdx +++ b/content/contracts/3.x/upgradeable.mdx @@ -44,7 +44,7 @@ Use with multiple inheritance requires special attention. See the section below Once this contract is set up and compiled, you can deploy it using the [Upgrades Plugins](/upgrades-plugins). The following snippet shows an example deployment script using Hardhat. ```js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const MyCollectible = await ethers.getContractFactory("MyCollectible"); diff --git a/content/contracts/4.x/upgradeable.mdx b/content/contracts/4.x/upgradeable.mdx index 8bd659e1..b2ef9d69 100644 --- a/content/contracts/4.x/upgradeable.mdx +++ b/content/contracts/4.x/upgradeable.mdx @@ -48,7 +48,7 @@ Use with multiple inheritance requires special attention. See the section below Once this contract is set up and compiled, you can deploy it using the [Upgrades Plugins](/upgrades-plugins). The following snippet shows an example deployment script using Hardhat. ```js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const MyCollectible = await ethers.getContractFactory("MyCollectible"); diff --git a/content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx b/content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx index 2bb655b7..71e82eba 100644 --- a/content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx +++ b/content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx @@ -357,7 +357,7 @@ Validates a new implementation contract without deploying it and without actuall Validate upgrading an existing proxy to a new contract (replace `PROXY_ADDRESS` with the address of your proxy): ```ts -const ethers, upgrades = require('hardhat'); +const { ethers, upgrades } = require('hardhat'); const BoxV2 = await ethers.getContractFactory('BoxV2'); await upgrades.validateUpgrade(PROXY_ADDRESS, BoxV2); @@ -365,7 +365,7 @@ await upgrades.validateUpgrade(PROXY_ADDRESS, BoxV2); Validate upgrading between two contract implementations: ```ts -const ethers, upgrades = require('hardhat'); +const { ethers, upgrades } = require('hardhat'); const Box = await ethers.getContractFactory('Box'); const BoxV2 = await ethers.getContractFactory('BoxV2'); diff --git a/content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx b/content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx index 8c420d05..7a1cbb06 100644 --- a/content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx +++ b/content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx @@ -33,7 +33,7 @@ You can use this plugin in a [Hardhat script](https://hardhat.org/guides/scripts ```js // scripts/create-box.js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const Box = await ethers.getContractFactory("Box"); @@ -51,7 +51,7 @@ Then, in another script, you can use the `upgradeProxy` function to upgrade the ```js // scripts/upgrade-box.js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const BoxV2 = await ethers.getContractFactory("BoxV2"); @@ -72,7 +72,7 @@ You can also use this plugin to deploy an upgradeable beacon for your contract w ```js // scripts/create-box.js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const Box = await ethers.getContractFactory("Box"); @@ -93,7 +93,7 @@ Then, in another script, you can use the `upgradeBeacon` function to upgrade the ```js // scripts/upgrade-box.js -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); async function main() const BoxV2 = await ethers.getContractFactory("BoxV2"); diff --git a/content/upgrades-plugins/migrate-from-cli.mdx b/content/upgrades-plugins/migrate-from-cli.mdx index f7632727..bc1553e2 100644 --- a/content/upgrades-plugins/migrate-from-cli.mdx +++ b/content/upgrades-plugins/migrate-from-cli.mdx @@ -187,7 +187,7 @@ With Hardhat, we would write a script (**you can read more about Hardhat scripts ```jsx -const ethers, upgrades = require("hardhat"); +const { ethers, upgrades } = require("hardhat"); const OZ_SDK_EXPORT = require("../openzeppelin-cli-export.json"); async function main()