Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/contracts/3.x/upgradeable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion content/contracts/4.x/upgradeable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ 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);
```

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');
Expand Down
8 changes: 4 additions & 4 deletions content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion content/upgrades-plugins/migrate-from-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading