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
@@ -41,31 +42,14 @@ Start by cloning the Uniswap V2 project:
41
42
npm install
42
43
```
43
44
44
-
3. Update the `hardhat.config.js` file so the paths for the Substrate node and the ETH-RPC adapter match with the paths on your machine:
45
-
46
-
```js title="hardhat.config.js"
47
-
hardhat: {
48
-
polkavm: true,
49
-
nodeConfig: {
50
-
nodeBinaryPath: '../bin/substrate-node',
51
-
rpcPort: 8000,
52
-
dev: true,
53
-
},
54
-
adapterConfig: {
55
-
adapterBinaryPath: '../bin/eth-rpc',
56
-
dev: true,
57
-
},
58
-
},
59
-
```
60
-
61
-
4. Create a `.env` file in your project root to store your private keys (you can use as an example the `env.example` file):
45
+
3. Create a `.env` file in your project root to store your private keys (you can use as an example the `env.example` file):
62
46
63
47
```text title=".env"
64
48
LOCAL_PRIV_KEY="INSERT_LOCAL_PRIVATE_KEY"
65
49
AH_PRIV_KEY="INSERT_AH_PRIVATE_KEY"
66
50
```
67
51
68
-
Ensure to replace `"INSERT_LOCAL_PRIVATE_KEY"` with a private key available in the local environment (you can get them from this [file](https://github.com/paritytech/hardhat-polkadot/blob/main/packages/hardhat-polkadot-node/src/constants.ts#L22){target=\_blank}). And `"INSERT_AH_PRIVATE_KEY"` with the account's private key you want to use to deploy the contracts. You can get this by exporting the private key from your wallet (e.g., MetaMask).
52
+
Ensure to replace `"INSERT_LOCAL_PRIVATE_KEY"` with a private key available in the local environment (you can get them from this [file](https://github.com/paritytech/hardhat-polkadot/blob/main/packages/hardhat-polkadot-node/src/constants.ts#L21){target=\_blank}). And `"INSERT_AH_PRIVATE_KEY"` with the account's private key you want to use to deploy the contracts. You can get this by exporting the private key from your wallet (e.g., MetaMask).
69
53
70
54
!!!warning
71
55
Keep your private key safe, and never share it with anyone. If it is compromised, your funds can be stolen.
@@ -80,7 +64,7 @@ If the compilation is successful, you should see the following output:
After running the above command, you should see the compiled contracts in the `artifacts-pvm` directory. This directory contains the ABI and bytecode of your contracts.
67
+
After running the above command, you should see the compiled contracts in the `artifacts` directory. This directory contains the ABI and bytecode of your contracts.
84
68
85
69
## Understanding Uniswap V2 Architecture
86
70
@@ -138,13 +122,7 @@ You can run the provided test suite to ensure the contracts are working as expec
138
122
139
123
To test it locally, you can run the following commands:
140
124
141
-
1. Spawn a local node for testing:
142
-
143
-
```bash
144
-
npx hardhat node
145
-
```
146
-
147
-
This command will spawn a local Substrate node along with the ETH-RPC adapter. The node will be available at `ws://127.0.0.1:8000` and the ETH-RPC adapter at `http://localhost:8545`.
125
+
1. Run the local `revive-dev-node`, for this, you can check the [Local Development Node](/smart-contracts/dev-environments/local-dev-node/){target=\_blank} guide.
148
126
149
127
2. In a new terminal, run the tests:
150
128
@@ -169,10 +147,10 @@ npx hardhat run scripts/deploy.js --network localNode
169
147
This command deploys the contracts to your local blockchain for development and testing. If you want to deploy to Polkadot Hub, you can use the following command:
170
148
171
149
```bash
172
-
npx hardhat run scripts/deploy.js --network passetHub
150
+
npx hardhat run scripts/deploy.js --network polkadotHubTestNet
173
151
```
174
152
175
-
The command above deploys to the actual Polkadot TestNet. It requires PAStest tokens, persists on the network, and operates under real network conditions.
153
+
The command above deploys to the actual Polkadot Hub TestNet. It requires test tokens, persists on the network, and operates under real network conditions.
176
154
177
155
The deployment script will output the addresses of the deployed contracts. Save these addresses, as you will need them to interact with the contracts. For example, the output should look like this:
0 commit comments