Skip to content

Commit 4f9b0a5

Browse files
committed
fix: hardhat version
1 parent 2f31c4c commit 4f9b0a5

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

develop/smart-contracts/dev-environments/hardhat.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Before getting started, ensure you have:
5151
3. To interact with Polkadot, Hardhat requires the following plugin to compile contracts to PolkaVM bytecode and to spawn a local node compatible with PolkaVM:
5252

5353
```bash
54-
npm install --save-dev @parity/[email protected].8
54+
npm install --save-dev @parity/[email protected].9
5555
```
5656

5757
4. Create a Hardhat project:
@@ -66,11 +66,9 @@ Before getting started, ensure you have:
6666
- **`test`** - contains your test files that validate contract functionality
6767
- **`ignition`** - deployment modules for safely deploying your contracts to various networks
6868

69-
5. Add the following folders to the `.gitignore` file if they are not already there:
69+
5. Add the following folder to the `.gitignore` file if it is not already there:
7070

7171
```bash
72-
echo '/artifacts-pvm' >> .gitignore
73-
echo '/cache-pvm' >> .gitignore
7472
echo '/ignition/deployments/' >> .gitignore
7573
```
7674

@@ -163,6 +161,9 @@ Configure a local node setup by adding the node binary path along with the ETH-R
163161
164162
Replace `INSERT_PATH_TO_SUBSTRATE_NODE` and `INSERT_PATH_TO_ETH_RPC_ADAPTER` with the actual paths to your compiled binaries. The `dev: true` flag configures both the node and adapter for development mode. To obtain these binaries, check the [Installation](/develop/smart-contracts/local-development-node#install-the-substrate-node-and-eth-rpc-adapter){target=\_blank} section on the Local Development Node page.
165163
164+
!!! warning
165+
If you're using the default `hardhat.config.js` created by the `hardhat-polkadot` plugin, it includes a `forking` section pointing to the Polkadot Hub TestNet. When you run `npx hardhat node`, Hardhat will start a fork of that network. To use your local node instead, comment out the `forking` section; otherwise, `npx hardhat node` will continue to use the forked network even if a local node is defined in the configuration.
166+
166167
Once configured, start your chosen testing environment with:
167168

168169
```bash

llms.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7956,7 +7956,7 @@ Before getting started, ensure you have:
79567956
3. To interact with Polkadot, Hardhat requires the following plugin to compile contracts to PolkaVM bytecode and to spawn a local node compatible with PolkaVM:
79577957

79587958
```bash
7959-
npm install --save-dev @parity/[email protected].8
7959+
npm install --save-dev @parity/[email protected].9
79607960
```
79617961

79627962
4. Create a Hardhat project:
@@ -7971,11 +7971,9 @@ Before getting started, ensure you have:
79717971
- **`test`** - contains your test files that validate contract functionality
79727972
- **`ignition`** - deployment modules for safely deploying your contracts to various networks
79737973

7974-
5. Add the following folders to the `.gitignore` file if they are not already there:
7974+
5. Add the following folder to the `.gitignore` file if it is not already there:
79757975

79767976
```bash
7977-
echo '/artifacts-pvm' >> .gitignore
7978-
echo '/cache-pvm' >> .gitignore
79797977
echo '/ignition/deployments/' >> .gitignore
79807978
```
79817979

@@ -8110,6 +8108,9 @@ module.exports = {
81108108

81118109
Replace `INSERT_PATH_TO_SUBSTRATE_NODE` and `INSERT_PATH_TO_ETH_RPC_ADAPTER` with the actual paths to your compiled binaries. The `dev: true` flag configures both the node and adapter for development mode. To obtain these binaries, check the [Installation](/develop/smart-contracts/local-development-node#install-the-substrate-node-and-eth-rpc-adapter){target=\_blank} section on the Local Development Node page.
81128110

8111+
!!! warning
8112+
If you're using the default `hardhat.config.js` created by the `hardhat-polkadot` plugin, it includes a `forking` section pointing to the Polkadot Hub TestNet. When you run `npx hardhat node`, Hardhat will start a fork of that network. To use your local node instead, comment out the `forking` section; otherwise, `npx hardhat node` will continue to use the forked network even if a local node is defined in the configuration.
8113+
81138114
Once configured, start your chosen testing environment with:
81148115

81158116
```bash
@@ -40141,7 +40142,7 @@ Let's start by setting up Hardhat for your Storage contract project:
4014140142
3. Install `hardhat-polkadot` and all required plugins:
4014240143

4014340144
```bash
40144-
npm install --save-dev @parity/hardhat-polkadot [email protected]
40145+
npm install --save-dev @parity/hardhat-polkadot@0.1.9 [email protected]
4014540146
```
4014640147

4014740148
For dependencies compatibility, ensure to install the `@nomicfoundation/hardhat-toolbox` dependency with the `--force` flag:
@@ -40171,7 +40172,6 @@ const { vars } = require("hardhat/config");
4017140172
module.exports = {
4017240173
solidity: "0.8.28",
4017340174
resolc: {
40174-
version: "1.5.2",
4017540175
compilerSource: "npm",
4017640176
},
4017740177
networks: {
@@ -40590,7 +40590,7 @@ Congratulations! You've successfully set up a Hardhat development environment, w
4059040590
To get started with a working example right away, you can clone the repository and navigate to the project directory:
4059140591

4059240592
```bash
40593-
git clone https://github.com/polkadot-developers/polkavm-hardhat-examples.git -b v0.0.7
40593+
git clone https://github.com/polkadot-developers/polkavm-hardhat-examples.git -b v0.0.8
4059440594
cd polkavm-hardhat-examples/storage-hardhat
4059540595
```
4059640596
--- END CONTENT ---

tutorials/smart-contracts/launch-your-first-project/test-and-deploy-with-hardhat.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Let's start by setting up Hardhat for your Storage contract project:
4141
3. Install `hardhat-polkadot` and all required plugins:
4242

4343
```bash
44-
npm install --save-dev @parity/hardhat-polkadot [email protected]
44+
npm install --save-dev @parity/hardhat-polkadot@0.1.9 [email protected]
4545
```
4646

4747
For dependencies compatibility, ensure to install the `@nomicfoundation/hardhat-toolbox` dependency with the `--force` flag:
@@ -61,7 +61,7 @@ Let's start by setting up Hardhat for your Storage contract project:
6161
6. Configure Hardhat by updating the `hardhat.config.js` file:
6262

6363
```javascript title="hardhat.config.js"
64-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/hardhat.config.js'
64+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/hardhat.config.js'
6565
```
6666

6767
Ensure that `INSERT_PATH_TO_SUBSTRATE_NODE` and `INSERT_PATH_TO_ETH_RPC_ADAPTER` are replaced with the proper paths to the compiled binaries.
@@ -91,7 +91,7 @@ Let's start by setting up Hardhat for your Storage contract project:
9191
1. Create a new folder called `contracts` and create a `Storage.sol` file. Add the contract code from the previous tutorial:
9292
9393
```solidity title="Storage.sol"
94-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/contracts/Storage.sol'
94+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/contracts/Storage.sol'
9595
```
9696
9797
2. Compile the contract:
@@ -113,9 +113,9 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
113113
1. Create a folder for testing called `test`. Inside that directory, create a file named `Storage.js` and add the following code:
114114
115115
```javascript title="Storage.js"
116-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:0:19'
116+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:0:19'
117117
// Add your logic here
118-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:48:49'
118+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:48:49'
119119
```
120120
121121
The `beforeEach` hook ensures stateless contract execution by redeploying a fresh instance of the Storage contract before each test case. This approach guarantees that each test starts with a clean and independent contract state by using `ethers.getSigners()` to obtain test accounts and `ethers.getContractFactory('Storage').deploy()` to create a new contract instance.
@@ -125,7 +125,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
125125
a. **Initial state verification** - ensures that the contract starts with a default value of zero, which is a fundamental expectation for the `Storage.sol` contract
126126
127127
```javascript title="Storage.js"
128-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:20:22'
128+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:20:22'
129129
```
130130
131131
Explanation:
@@ -137,7 +137,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
137137
b. **Value storage test** - validate the core functionality of storing and retrieving a value in the contract
138138
139139
```javascript title="Storage.js"
140-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:24:30'
140+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:24:30'
141141
```
142142
143143
Explanation:
@@ -149,7 +149,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
149149
c. **Event emission verification** - confirm that the contract emits the correct event when storing a value, which is crucial for off-chain tracking
150150
151151
```javascript title="Storage.js"
152-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:32:38'
152+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:32:38'
153153
```
154154
155155
Explanation:
@@ -161,7 +161,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
161161
d. **Sequential value storage test** - check the contract's ability to store multiple values sequentially and maintain the most recent value
162162
163163
```javascript title="Storage.js"
164-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js:40:47'
164+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js:40:47'
165165
```
166166
167167
Explanation:
@@ -174,7 +174,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
174174
175175
???--- code "View complete script"
176176
```javascript title="Storage.js"
177-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/test/Storage.js'
177+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/test/Storage.js'
178178
```
179179
180180
2. Run the tests:
@@ -194,7 +194,7 @@ Testing is a critical part of smart contract development. Hardhat makes it easy
194194
1. Create a new folder called`ignition/modules`. Add a new file named `StorageModule.js` with the following logic:
195195
196196
```javascript title="StorageModule.js"
197-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/ignition/modules/StorageModule.js'
197+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/ignition/modules/StorageModule.js'
198198
```
199199
200200
2. Deploy to the local network:
@@ -234,7 +234,7 @@ To interact with your deployed contract:
234234
1. Create a new folder named `scripts` and add the `interact.js` with the following content:
235235

236236
```javascript title="interact.js"
237-
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.7/storage-hardhat/scripts/interact.js'
237+
--8<-- 'https://raw.githubusercontent.com/polkadot-developers/polkavm-hardhat-examples/refs/tags/v0.0.8/storage-hardhat/scripts/interact.js'
238238
```
239239

240240
Ensure that `INSERT_DEPLOYED_CONTRACT_ADDRESS` is replaced with the value obtained in the previous step.
@@ -256,6 +256,6 @@ Congratulations! You've successfully set up a Hardhat development environment, w
256256
To get started with a working example right away, you can clone the repository and navigate to the project directory:
257257
258258
```bash
259-
git clone https://github.com/polkadot-developers/polkavm-hardhat-examples.git -b v0.0.7
259+
git clone https://github.com/polkadot-developers/polkavm-hardhat-examples.git -b v0.0.8
260260
cd polkavm-hardhat-examples/storage-hardhat
261261
```

0 commit comments

Comments
 (0)