Remix IDE Cheatsheet
Environments (VM, Injected, Testnet)
Use this Remix IDE reference while you build software engineering projects, review code for technical interview prep, or polish examples for a software engineer resume.
Environment Overview
The Environment dropdown in Deploy & Run determines where transactions are sent.
| Environment | Network | Wallet needed | Gas cost |
|---|---|---|---|
| Remix VM (Prague) | In-browser EVM, latest hardfork rules — the default | No | Free (fake ETH) |
| Remix VM (Cancun / Shanghai / …) | In-browser EVM under older hardfork rules | No | Free |
| Remix VM — Mainnet fork | In-browser EVM forked from live mainnet state | No | Free (fake ETH) |
| Saved VM states | Reload a VM state you saved earlier (.states/ in the workspace) | No | Free |
| Injected Provider — MetaMask | Whatever network MetaMask is on | MetaMask | Real or testnet ETH |
| WalletConnect | Any WC-compatible wallet | Yes | Real or testnet ETH |
| Hardhat Provider | Local Hardhat node (port 8545) | No | Free (local) |
| Foundry Provider | Local Anvil node (port 8545) | No | Free (local) |
| External HTTP Provider | Custom RPC URL | Depends | Depends |
Remix VM — the default environment
The in-memory EVM runs entirely in the browser. No network calls.
- 15 pre-funded accounts with 100 fake ETH each.
- The dropdown offers one VM per hardfork — the newest supported fork (Prague-era at the time of writing) is the default; older ones (Cancun, Shanghai, London, …) stay available for regression testing.
- Remix VM — Mainnet fork boots the browser VM from live mainnet state, so you can call real deployed contracts with fake ETH; custom forks let you pick an RPC URL and block.
- State resets on page refresh — save the VM state to keep it (next section).
- Best for: rapid iteration, unit-test-style experiments.
Saving & Restoring VM State
Remix does not have an environment literally named "Persistent" — instead you save VM states and reload them:
- In Deploy & Run, use the save VM state control next to the environment selector. The current VM state (deployed contracts, balances, storage) is written as a JSON file under
.states/in the active workspace. - Saved states appear as selectable environments, so a deployment can survive page refreshes and multi-session work.
- Delete the state file (or use the delete control) to reset.
- Separately, the pin icon on a deployed-contract card pins that instance to the workspace so it reappears in Deployed Contracts when you return to the same environment.
Injected Provider (MetaMask)
Connects Remix to MetaMask (or any EIP-1193 injected wallet).
- Install MetaMask.
- Select Injected Provider — MetaMask in the Environment dropdown.
- MetaMask popup asks to connect — approve.
- Remix shows the active account and its real balance.
- Every Deploy or write call triggers a MetaMask confirmation popup.
Switch networks inside MetaMask; Remix follows automatically. The network name is shown next to the Environment label.
Common Testnets via MetaMask
| Testnet | Chain ID | Faucet |
|---|---|---|
| Sepolia | 11155111 | cloud.google.com/application/web3/faucet |
| Hoodi | 560048 | hoodi-faucet.pk910.de |
| Base Sepolia | 84532 | faucet.quicknode.com |
| Arbitrum Sepolia | 421614 | faucet.arbitrum.io |
Add testnets to MetaMask via chainlist.org.
WalletConnect
- Select WalletConnect from the Environment dropdown.
- A QR code appears — scan with any WalletConnect v2-compatible mobile wallet.
- Approve the connection on your phone.
- Transactions require mobile confirmation.
Local Hardhat / Anvil
Run a local node first:
# Hardhat npx hardhat node # RPC at http://127.0.0.1:8545 # Foundry Anvil anvil # RPC at http://127.0.0.1:8545
Then in Remix select Hardhat Provider or Foundry Provider — Remix connects to port 8545 automatically. The pre-funded accounts from the node appear in the Account dropdown.
External HTTP Provider
For any custom RPC (Infura, Alchemy, local devnet, L2):
- Select External HTTP Provider.
- Enter the RPC URL in the dialog (e.g.,
https://mainnet.infura.io/v3/YOUR_KEY). - Remix uses
eth_accountsto list signers. For remote nodes without unlocked accounts, use an injected wallet instead.
https://eth-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY https://polygon-amoy.infura.io/v3/YOUR_KEY
Never send real-mainnet transactions from Remix without reviewing gas and confirming in MetaMask.
Switching Environments Safely
- Switching environment resets the Deployed Contracts panel (instances from old env disappear).
- Reload existing on-chain contracts with At Address + the same ABI after switching.
- Account and gas settings carry over but Value resets to
0.