← Back to Projects WORKSHOP - 15 MINUTES

Your First Smart Contract

Deploy to a Real Blockchain Today

Goal: Deploy your first smart contract to Sepolia testnet in 15 minutes. No prior experience required!
Jupyter Notebook Slide Deck

Prerequisites

Step-by-Step Guide

1Install MetaMask

  1. Go to metamask.io
  2. Click Download and add to browser
  3. Create new wallet
  4. SAVE YOUR SEED PHRASE!
Never share your seed phrase with anyone. Write it down on paper.

2Get Test ETH

  1. Open MetaMask, switch to Sepolia test network
  2. Copy your wallet address
  3. Go to sepoliafaucet.com
  4. Paste address and request ETH
  5. Wait 1-2 minutes

3Open Remix IDE

  1. Go to remix.ethereum.org
  2. In file explorer, click contracts folder
  3. Create new file: HelloWorld.sol

4Write Your Contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract HelloWorld {
    string public greeting;

    event GreetingChanged(string oldGreeting, string newGreeting);

    constructor(string memory _greeting) {
        greeting = _greeting;
    }

    function getGreeting() public view returns (string memory) {
        return greeting;
    }

    function setGreeting(string memory _newGreeting) public {
        string memory old = greeting;
        greeting = _newGreeting;
        emit GreetingChanged(old, _newGreeting);
    }
}

5Compile

  1. Click Solidity Compiler icon (left sidebar)
  2. Select compiler: 0.8.20
  3. Click Compile HelloWorld.sol
  4. Green checkmark = success!

6Deploy

  1. Click Deploy & Run icon
  2. Environment: Injected Provider - MetaMask
  3. Connect MetaMask when prompted
  4. Enter greeting: "Hello, Blockchain!"
  5. Click Deploy
  6. Confirm in MetaMask
  7. Save your contract address!

7Interact

8View on Etherscan

  1. Go to sepolia.etherscan.io
  2. Paste your contract address
  3. See your contract and transactions!

Troubleshooting

ProblemSolution
"Insufficient funds"Get more test ETH from faucet
"Transaction failed"Check gas limit, retry
MetaMask not connectingRefresh page, unlock MetaMask
Wrong networkSwitch to Sepolia in MetaMask

What You Learned

Next Steps

Ready for more? Try the Create Cryptocurrency workshop to build your own ERC-20 token!