Run SimpleStorage in Remix — No MetaMask

Remix VM (Prague)

This guide shows exactly how to compile, deploy, and use a tiny Solidity contract in Remix with the built-in Remix VM. No wallet, no Ganache, no API keys. Students can copy the code, click through the panels, and call set / get.

🎧 Voice Lecture

Note: This browser doesn't support Speech Synthesis. The text above is still provided as a transcript.

Tip: Paste any lesson script and hit Play. Voices come from the student's OS/browser.

1) The Contract

pragma solidity ^0.8.0;

contract SimpleStorage {
    uint256 storedData; // slot 0

    function set(uint256 x) public {
        storedData = x; // state change → transaction (costs gas on real networks)
    }

    function get() public view returns (uint256) {
        return storedData; // read-only view → free
    }
}
What it is: A single number stored on chain. set(x) writes it. get() reads it. That’s all.

2) Open Remix & Create the File

2
  1. Go to https://remix.ethereum.org.
  2. Left sidebar → File Explorer (top icon).
  3. Click New File → name it SimpleStorage.sol.
  4. Paste the contract code above and press Ctrl/Cmd + S to save.

If you can’t see the sidebar icons, widen your browser window.

3) Compile

3
  1. Left sidebar → Solidity Compiler (cube icon).
  2. Set Compiler to a 0.8.x version (e.g., 0.8.30).
    The line pragma solidity ^0.8.0; means any 0.8 version is okay.
  3. Click Compile SimpleStorage.sol.
    You should see a green check ✅ next to the file name.
Common fix: If the Deploy panel doesn’t list the contract, you probably didn’t compile yet. Compile first.

4) Deploy to Remix VM

4
  1. Left sidebar → Deploy & Run Transactions (plug + ETH diamond icon).
  2. Environment: choose Remix VM (Prague) (this runs a private blockchain in your browser).
  3. Account: leave the default one (it shows a fake 100 ETH balance).
  4. Value: leave at 0. We’re not sending ether to the contract.
  5. Contract dropdown: select SimpleStorage.
  6. Click the big orange Deploy button.
After deploying, look under Deployed Contracts. You’ll see SIMPLESTORAGE at 0x…. That 0x… is the contract address.
Note: Remix VM resets on refresh. If the contract disappears, just deploy again.

5) Interact: get() and set(x)

5
  1. In Deployed Contracts, click the ▶ arrow to expand SIMPLESTORAGE.
  2. Click get → the output appears just below the button. First run returns 0.
  3. Type a number (e.g., 123) in the input next to set, then click set.
    This is a state-changing transaction. In Remix VM it’s instant and free; on real networks it would cost gas.
  4. Click get again → it shows 123.
Where are the logs?

Drag up the bottom terminal bar to see transaction logs. Or open the Transactions recorded accordion in the left panel. get() is a view call, so you won’t see a big green tx receipt—its result appears right under the button.

Troubleshooting (Fast Fixes)

“I can’t find Deploy.”
  1. Compile first in the Solidity Compiler panel.
  2. Go to Deploy & Run → pick Remix VM (Prague).
  3. Select the contract in the Contract dropdown.
  4. Scroll the panel / collapse “Explain contract” / zoom out once (Ctrl -).
“get() doesn’t show a green box.”

get() is view (read-only). Its value appears right below the button. Only set() creates a transaction log.

“Compiler error or wrong version.”

Select a 0.8.x compiler. Your pragma is ^0.8.0, so any 0.8 works.

“My contract vanished.”

Remix VM is ephemeral. Refreshing clears the chain. Just deploy again.

What Students Should Remember