Using Remix to Deploy Smart Contracts
This tutorial will guide you through deploying a smart contract on Status Network testnet using the Remix IDE. Remix is a browser-based IDE that's perfect for quick development and testing.
Prerequisites
Before you begin, ensure you have:
- Web Browser: A modern web browser like Chrome or Firefox
- MetaMask: Install the MetaMask browser extension
- Testnet ETH: You'll need Status Network testnet ETH
- Get Status Network testnet ETH from our Faucet
- Network Configuration: Add Status Network testnet to MetaMask following our Add Network guide
Steps
1. Open Remix IDE
Visit remix.ethereum.org in your browser.
2. Create a New File
- Click the "File Explorer" icon (first icon on the left sidebar)
- Click the "+" button to create a new file
- Name it
HelloWorld.sol
3. Write the Smart Contract
Copy and paste the following code into HelloWorld.sol
:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract HelloWorld {
string public greet = "Hello, Status Network!";
function setGreet(string memory _greet) public {
greet = _greet;
}
function getGreet() public view returns (string memory) {
return greet;
}
}
4. Compile the Contract
- Click the "Solidity Compiler" icon (second icon on the left sidebar)
- Select compiler version "0.8.24"
- Click "Compile HelloWorld.sol"
- Ensure compilation succeeds (you'll see a green checkmark)
5. Deploy the Contract
- Click the "Deploy & Run Transactions" icon (fourth icon on the left sidebar)
- In the "Environment" dropdown, select "Injected Provider - MetaMask"
- MetaMask will prompt you to connect - ensure Status Network testnet is selected
- Click "Deploy"
- Confirm the transaction in MetaMask
- Wait for the transaction to be confirmed
6. Interact with Your Contract
Once deployed, you'll see your contract under "Deployed Contracts":
- Expand the contract interface
- You can:
- Click "greet" to read the current greeting
- Enter a new greeting in the "setGreet" field and click the button to update it
- Click "getGreet" to read the greeting again
Troubleshooting
Common Issues
-
Transaction Failed
- Check that you're connected to Status Network testnet
-
Contract Not Found
- Wait a few minutes for the explorer to index your contract
- Double-check the contract address
-
Compilation Errors
- Verify the compiler version matches the pragma statement
- Check for any syntax errors highlighted in Remix
Support
If you encounter any issues:
- Join our Telegram Community
- View our Network Details