You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop/smart-contracts/dev-environments/hardhat.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Before getting started, ensure you have:
51
51
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:
@@ -66,11 +66,9 @@ Before getting started, ensure you have:
66
66
- **`test`** - contains your test files that validate contract functionality
67
67
- **`ignition`** - deployment modules for safely deploying your contracts to various networks
68
68
69
-
5. Add the following folders to the `.gitignore` file ifthey are not already there:
69
+
5. Add the following folder to the `.gitignore` file ifit is not already there:
70
70
71
71
```bash
72
-
echo'/artifacts-pvm'>> .gitignore
73
-
echo'/cache-pvm'>> .gitignore
74
72
echo'/ignition/deployments/'>> .gitignore
75
73
```
76
74
@@ -163,6 +161,9 @@ Configure a local node setup by adding the node binary path along with the ETH-R
163
161
164
162
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.
165
163
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
+
166
167
Once configured, start your chosen testing environment with:
Copy file name to clipboardExpand all lines: llms.txt
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7956,7 +7956,7 @@ Before getting started, ensure you have:
7956
7956
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:
@@ -7971,11 +7971,9 @@ Before getting started, ensure you have:
7971
7971
- **`test`** - contains your test files that validate contract functionality
7972
7972
- **`ignition`** - deployment modules for safely deploying your contracts to various networks
7973
7973
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:
7975
7975
7976
7976
```bash
7977
-
echo '/artifacts-pvm' >> .gitignore
7978
-
echo '/cache-pvm' >> .gitignore
7979
7977
echo '/ignition/deployments/' >> .gitignore
7980
7978
```
7981
7979
@@ -8110,6 +8108,9 @@ module.exports = {
8110
8108
8111
8109
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.
8112
8110
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
+
8113
8114
Once configured, start your chosen testing environment with:
8114
8115
8115
8116
```bash
@@ -40141,7 +40142,7 @@ Let's start by setting up Hardhat for your Storage contract project:
40141
40142
3. Install `hardhat-polkadot` and all required plugins:
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
125
125
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
0 commit comments