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: docs/tutorials/marketpulse/deploy.md
+64-20Lines changed: 64 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
---
2
2
title: Deploy the contract
3
3
dependencies:
4
-
viem: 0
4
+
dependencies:
5
+
viem: 2.41.2
6
+
hardhat: 3.0.17
5
7
---
6
8
7
9
Deploy the contract locally is fine for doing simple tests, but we recommend to target the Etherlink Testnet to run complete scenarios as you may depend on other services like block explorers, oracles, etc.
@@ -11,7 +13,7 @@ Deploy the contract locally is fine for doing simple tests, but we recommend to
11
13
1. Prepare a module for the ignition plugin of Hardhat. The module is used as the default script for deployment. Rename the default file first:
1. Replace the contents of the file with this code:
@@ -49,28 +51,75 @@ Deploy the contract locally is fine for doing simple tests, but we recommend to
49
51
50
52
You can deploy the contract to any local Ethereum node but Etherlink is a good choice because it is persistent and free and most tools and indexers are already deployed on it.
1. Check that your deployment logs do not contain any error and stop the Hardhat node.
53
75
54
76
1. Deploy the contract on Etherlink Shadownet Testnet:
55
77
56
-
1. In the Hardhat configuration file `hardhat.config.ts`, add Etherlink Mainnet and Shadownet Testnet as custom networks:
78
+
1. In the Hardhat configuration file `hardhat.config.ts`, add Etherlink Mainnet and Shadownet Testnet as custom networks by replacing the default file with this code:
57
79
58
80
```TypeScript
59
-
import "@nomicfoundation/hardhat-toolbox-viem";
60
-
import "@nomicfoundation/hardhat-verify";
61
-
import type { HardhatUserConfig } from "hardhat/config";
62
-
import { vars } from "hardhat/config";
81
+
import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem";
82
+
import { configVariable, defineConfig } from "hardhat/config";
63
83
64
-
if (!vars.has("DEPLOYER_PRIVATE_KEY")) {
84
+
if (!configVariable("DEPLOYER_PRIVATE_KEY")) {
65
85
console.error("Missing env var DEPLOYER_PRIVATE_KEY");
@@ -104,23 +153,19 @@ Deploy the contract locally is fine for doing simple tests, but we recommend to
104
153
},
105
154
],
106
155
}
107
-
};
108
-
109
-
export default config;
156
+
});
110
157
```
111
158
112
159
1. Set up an Etherlink Shadownet Testnet account with some native tokens to deploy the contract. See [Using your wallet](/get-started/using-your-wallet) connect your wallet to Etherlink. Then use the faucet to get XTZ tokens on Etherlink Shadownet Testnet, as described in [Getting testnet tokens](/get-started/getting-testnet-tokens).
113
160
114
161
1. Export your account private key from your wallet application.
115
162
116
-
1. Set the private key as the value of the `DEPLOYER_PRIVATE_KEY` environment variable by running this command:
163
+
1. Set the private key (represented in this example as `<YOUR_ETHERLINK_KEY>`) as the value of the `DEPLOYER_PRIVATE_KEY` environment variable by running this command:
117
164
118
165
```bash
119
-
npx hardhat vars setDEPLOYER_PRIVATE_KEY
166
+
exportDEPLOYER_PRIVATE_KEY=<YOUR_ETHERLINK_KEY>
120
167
```
121
168
122
-
On the prompt, enter or paste the value of your exported private key. Hardhat use its custom env var system for storing keys, we will see later how to override this on a CICD pipeline
123
-
124
169
1. Deploy the contract to Etherlink Shadownet Testnet network specifying the `--network` option:
125
170
126
171
```bash
@@ -130,7 +175,6 @@ Deploy the contract locally is fine for doing simple tests, but we recommend to
0 commit comments