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
Go to https://remix.ethereum.org.
Left sidebar → File Explorer (top icon).
Click New File → name it SimpleStorage.sol.
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
Left sidebar → Solidity Compiler (cube icon).
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.
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
Left sidebar → Deploy & Run Transactions (plug + ETH diamond icon).
Environment: choose Remix VM (Prague) (this runs a private blockchain in your browser).
Account: leave the default one (it shows a fake 100 ETH balance).
Value: leave at 0. We’re not sending ether to the contract.
Contract dropdown: select SimpleStorage.
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
In Deployed Contracts, click the ▶ arrow to expand SIMPLESTORAGE.
Click get → the output appears just below the button. First run returns 0.
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.
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.”
Compile first in the Solidity Compiler panel.
Go to Deploy & Run → pick Remix VM (Prague).
Select the contract in the Contract dropdown.
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
Compile turns Solidity into bytecode + ABI (the “menu” of functions).
Deploy sends the code to a blockchain and gives it an address.
set(x) writes state (transaction). get() reads state (free).
Remix VM is a private, in-browser chain for safe practice.