|
1 | | -# Quick Start |
| 1 | +# Quick Start |
| 2 | + |
| 3 | +In this section, we'll get you deploying a sample contract on **Status Network Testnet** in less than 10 minutes. |
| 4 | + |
| 5 | +Let’s see how to deploy a smart contract on Status Network using the Remix IDE for simplicity. |
| 6 | + |
| 7 | +## Get Everything Ready |
| 8 | + |
| 9 | +Before getting started: |
| 10 | + |
| 11 | +- **Add Status Network Testnet to MetaMask**: |
| 12 | + |
| 13 | + Follow the [Status Network documentation](/general-info/add-status-network) for step-by-step instructions on how to add the Status Network testnet to MetaMask. You'll need the network's RPC URL, Chain ID, and other details. |
| 14 | + |
| 15 | +- **Obtain Testnet Tokens**: |
| 16 | + |
| 17 | + This guide assumes you have obtained testnet ETH on the Status Network. You can use the [Status Network Testnet Faucet](#) to request test tokens. |
| 18 | + |
| 19 | +We are ready to get started! |
| 20 | + |
| 21 | +## Remix & Sample Code |
| 22 | + |
| 23 | +**Remix** is a no-setup tool for developing smart contracts. It’s easy to get started, allowing a simple deployment process, debugging, interacting with smart contracts, and more. It’s a great tool to test quick changes and interact with deployed smart contracts. |
| 24 | + |
| 25 | +For the sake of this tutorial, we will be deploying the `SimpleStorage.sol` smart contract that comes as an example in Remix, but you can use any of your code. |
| 26 | + |
| 27 | +Here's the sample code: |
| 28 | + |
| 29 | +```solidity |
| 30 | +// SPDX-License-Identifier: MIT |
| 31 | +
|
| 32 | +pragma solidity ^0.8.24; |
| 33 | +
|
| 34 | +contract SimpleStorage { |
| 35 | +
|
| 36 | + uint256 number; |
| 37 | + |
| 38 | + function store(uint256 num) public { |
| 39 | + number = num; |
| 40 | + } |
| 41 | +
|
| 42 | + function retrieve() public view returns (uint256) { |
| 43 | + return number; |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +> **Note:** This contract lets you store a number and then read what that number is. |
| 49 | +
|
| 50 | +## Steps to Deploy |
| 51 | + |
| 52 | +1. **Copy the Sample Code**: |
| 53 | + |
| 54 | + - Copy the sample code and paste it into a new file named `SimpleStorage.sol` in Remix. |
| 55 | + |
| 56 | +2. **Compile the Smart Contract**: |
| 57 | + |
| 58 | + - Go to the **Solidity Compiler** tab (on the left sidebar). |
| 59 | + - Ensure the compiler version matches the pragma statement in your contract (`0.8.24`). |
| 60 | + - Click **"Compile SimpleStorage.sol"**. |
| 61 | + - You can enable **"Auto compile"** for automatic compilation whenever you change the contract code. |
| 62 | + |
| 63 | +3. **Deploy the Smart Contract**: |
| 64 | + |
| 65 | + - Switch to the **Deploy & Run Transactions** tab. |
| 66 | + - In the **"Environment"** dropdown menu, select **"Injected Provider - MetaMask"**. This connects Remix to your MetaMask wallet. |
| 67 | + - MetaMask may prompt you to connect to Remix. Confirm the connection. |
| 68 | + - Ensure that **Status Network Testnet** is selected in MetaMask. |
| 69 | + - Under **"Contract"**, make sure `SimpleStorage` is selected. |
| 70 | + - Click **"Deploy"**. |
| 71 | + - MetaMask will pop up, asking you to confirm the transaction. |
| 72 | + - Review the transaction details and click **"Confirm"**. |
| 73 | + - Wait for the transaction to be mined. You can track the status in Remix or MetaMask. |
| 74 | + |
| 75 | +**CONGRATULATIONS!** You just deployed your first smart contract on Status Network. |
| 76 | + |
| 77 | +## Interact with Your Deployed Smart Contract |
| 78 | + |
| 79 | +1. **Access Deployed Contract**: |
| 80 | + |
| 81 | + - In Remix, under the **"Deployed Contracts"** section, you'll see your deployed `SimpleStorage` contract. |
| 82 | + |
| 83 | +2. **Store a Number**: |
| 84 | + |
| 85 | + - Expand the deployed contract to view its functions. |
| 86 | + - In the **"store"** function input field, enter a number (e.g., `42`). |
| 87 | + - Click **"transact"**. |
| 88 | + - MetaMask will prompt you to confirm the transaction. Click **"Confirm"**. |
| 89 | + - Wait for the transaction to be confirmed. |
| 90 | + |
| 91 | +3. **Retrieve the Number**: |
| 92 | + |
| 93 | + - Click on the **"retrieve"** function. |
| 94 | + - The stored number will display below the button. |
| 95 | + |
| 96 | +## Next Steps |
| 97 | + |
| 98 | +- **Get Support**: |
| 99 | + |
| 100 | + - If you encounter any issues or have questions, join the community channels for assistance. |
| 101 | + |
| 102 | +## Summary |
| 103 | + |
| 104 | +You've successfully: |
| 105 | + |
| 106 | +- Set up your environment to interact with Status Network Testnet. |
| 107 | +- Deployed a smart contract using Remix IDE and MetaMask. |
| 108 | +- Interacted with your deployed contract by storing and retrieving a number. |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +If you want to dive deeper, consider exploring more complex smart contracts. Checkout more tutorials [here](/tutorials/ethers-tutorial). |
| 113 | + |
| 114 | +**Happy Coding!** |
0 commit comments