|
1 | | -# Deploy smart contracts to Mycelium |
| 1 | +# Deploy smart contract to Mycelium |
2 | 2 |
|
3 | 3 | Before delving into this tutorial, you should have a [basic understanding of IPC](../) and [subnets](../key-concepts/subnets.md). You may want to familiarize yourself with the fundamentals of setting up an IPC subnet, in the [previous quickstart](deploy-a-subnet.md).  |
4 | 4 |
|
5 | 5 | In this tutorial, we will guide you through the simple process of connecting to the Mycelium Calibration testnet and deploying smart contracts on it. We will use the ERC20 contract as an example to illustrate the steps, including: |
6 | 6 |
|
7 | 7 | * Connect to the Mycelium Calibration |
8 | 8 | * Fund your address on the Mycelium Calibration |
9 | | -* Deploy a ERC20 contract on the Mycelium Calibration |
| 9 | +* Deploy an ERC20 contract on the Mycelium Calibration |
10 | 10 |
|
11 | 11 | ## Prerequisites |
12 | 12 |
|
@@ -176,9 +176,11 @@ After acquiring some test tokens in the MetaMask wallet, we can begin working on |
176 | 176 |
|
177 | 177 | ## Deploy ERC20 contract on the Mycelium Calibration  |
178 | 178 |
|
179 | | -As mentioned earlier, IPC subnets are EVM-compatible, allowing us to utilize various tools and frameworks that support Solidity development for building and deploying smart contracts on the IPC subnets. Let's take Remix and hardhat as examples for developing an ERC20 token contract on the IPC Mycelium Calibration. |
| 179 | +As mentioned earlier, IPC subnets are EVM-compatible, allowing us to utilize various tools and frameworks that support Solidity development for building and deploying smart contracts on the IPC subnets. Let's take Remix and hardhat as examples for developing an ERC20 token contract on the Mycelium Calibration. |
180 | 180 |
|
181 | | -### Using Remix & MetaMask |
| 181 | +{% tabs %} |
| 182 | +{% tab title="Remix" %} |
| 183 | +We will use Remix & MetaMask for this step. So ensure your MetaMask connects to the Mycelium Calibration & loaded with some tFIL. |
182 | 184 |
|
183 | 185 | #### **1. Create a new workspace** on Remix |
184 | 186 |
|
@@ -218,9 +220,9 @@ After successfully deploying your contract to the Mycelium Calibration, you will |
218 | 220 | <figure><img src="../.gitbook/assets/invoke (1).png" alt=""><figcaption><p>Invoke smart contract</p></figcaption></figure> |
219 | 221 |
|
220 | 222 | After the transaction is confirmed on the Mycelium Calibration, we will be able to call `balanceOf` to check if the tokens have been successfully minted to our wallet address. |
| 223 | +{% endtab %} |
221 | 224 |
|
222 | | -### Using hardhat |
223 | | - |
| 225 | +{% tab title="HardHat" %} |
224 | 226 | In addition to using the Remix UI, there are more programmable approaches to develop smart contracts using frameworks like [hardhat](https://hardhat.org/) and [foundry](https://github.com/foundry-rs/foundry). Let's take hardhat as an example to develop and deploy a basic ERC20 token on the Mycelium Calibration. |
225 | 227 |
|
226 | 228 | Before moving forward, ensure we have the following dependencies installed on the machine. |
@@ -258,7 +260,7 @@ Considering the security of your project, we will use the `.evn` file to store s |
258 | 260 | PRIVATE_KEY="<your-wallet-private-key>" |
259 | 261 | ``` |
260 | 262 |
|
261 | | -Open `hardhat.config.js` with VsCode, we will add IPC network configuration in this file. Make sure you have installed the `dotenv` package in your project by running `npm install dotenv`. Next, let's retrieve the ChainId and URL for the Mycelium Calibration from the [previous step](deploy-smart-contracts-to-mycelium.md#1.-getting-rpc-url-and-chain-id). We will use them to configure the IPC network. |
| 263 | +Open `hardhat.config.js` with VsCode, we will add IPC network configuration in this file. Make sure you have installed the `dotenv` package in your project by running `npm install dotenv`. Next, let's retrieve the ChainId and URL for the Mycelium Calibration from the [previous step](deploy-smart-contract-to-mycelium.md#1.-getting-rpc-url-and-chain-id). We will use them to configure the IPC network. |
262 | 264 |
|
263 | 265 | In the `hardhat.config.js` file, add the following code. |
264 | 266 |
|
@@ -423,6 +425,8 @@ My balance is 0.0 |
423 | 425 | 0xf41b192bbefa2777a1c0984f4d12a32b3e213f94ba1045309f38dd5fa458b0e3 |
424 | 426 | My new balance is 100.0 |
425 | 427 | ``` |
| 428 | +{% endtab %} |
| 429 | +{% endtabs %} |
426 | 430 |
|
427 | 431 | Congratulations! You have successfully deployed your first ERC20 contract on the Mycelium Calibration and even interacted with it. \ |
428 | 432 | \ |
|
0 commit comments