Remix IDE Cheatsheet

Interacting with Contracts

Use this Remix IDE reference while you build software engineering projects, review code, or refresh the syntax you reach for most.

The Deployed Contracts Panel

After deploying (or loading via At Address), the contract card sits under Deployed Contracts in the Deploy & Run panel.

  • Expand with the chevron .
  • Each public/external function and public state variable appears as a button or input row.
  • Click the contract address to copy it to clipboard.
  • 🗑 trashcan removes the instance from the panel (does NOT destroy the on-chain contract).

Button Color Reference

ColorFunction typeGas cost
Orangenonpayable — writes stateYes
Redpayable — writes state + accepts ETHYes
Blueview or pure — reads onlyNone (in VM / direct call)
Blue (auto-getter)Public state variable getterNone

Calling a View Function

function balanceOf(address owner) external view returns (uint256) { ... }
  1. Expand the contract card.
  2. Find balanceOf (blue button).
  3. Enter the address in the input field next to the button.
  4. Click balanceOf — result appears inline below the button immediately.

Sending a Transaction (Write)

function transfer(address to, uint256 amount) external returns (bool) { ... }
  1. Expand inputs: to = 0xRecipient..., amount = 1000000000000000000 (1 ETH in wei, or use the value field).
  2. Click the orange transfer button.
  3. Terminal logs the transaction hash, gas used, and return value.

Sending ETH with a Call

function deposit() external payable { ... }
  1. Set Value at the top of the Deploy & Run panel (e.g., 0.5 ether).
  2. Click the red deposit button.
  3. msg.value inside the function = 0.5 ETH in wei.

Tuples and Structs as Input

Remix accepts struct/tuple arguments as a comma-separated list in brackets:

struct Order { address buyer; uint256 amount; bool active; }
function placeOrder(Order calldata o) external { ... }

Input field value: ["0xAb8...", 500, true]

Passing Arrays

function batchMint(address[] calldata recipients, uint256[] calldata amounts) external { ... }

Input: ["0xAb8...", "0xDef..."] and [100, 200] in separate fields.

Reading Events from Terminal

Every state-changing call prints event logs:

logs: [
  {
    "event": "Transfer",
    "args": {
      "from": "0x0000...0000",
      "to": "0xAb8...",
      "value": "1000000000000000000"
    }
  }
]

Click Debug on any transaction row to step through execution.

ABI Encoding / Decoding

The Remix terminal is a JavaScript console with ethers (v6) and web3 available, so you can encode and decode ABI data without leaving the IDE — paste these lines into the terminal or a script:

// ethers v6 ABI coder
const coder = ethers.AbiCoder.defaultAbiCoder();

// Encode constructor / function arguments
coder.encode(["uint256", "address"], [42n, "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"]);

// Decode return data or calldata (minus the 4-byte selector)
coder.decode(["uint256", "address"], "0x000000000000000000000000000000000000000000000000000000000000002a…");

// 4-byte function selector
ethers.id("transfer(address,uint256)").slice(0, 10);   // "0xa9059cbb"

The compiler's Compilation Details panel also lists every function's 4-byte selector under Function Hashes.

Interacting via Script

Remix's script runner bundles ethers v6 — note BrowserProvider and top-level parseEther (the v5 ethers.providers.Web3Provider / ethers.utils.parseEther forms no longer exist):

// scripts/interact.js — run with File Explorer → right-click → Run
const { ethers } = require("ethers");   // bundled ethers v6

(async () => {
  // web3Provider is injected by Remix and targets the active environment
  const provider = new ethers.BrowserProvider(web3Provider);
  const signer   = await provider.getSigner();
  const address  = "0xDeployedAddress...";
  const abi      = [/* paste ABI here */];
  const contract = new ethers.Contract(address, abi, signer);

  const tx = await contract.transfer("0xRecipient...", ethers.parseEther("1"));
  await tx.wait();
  console.log("Transfer complete:", tx.hash);
})();

Right-click the script in the File Explorer → Run to execute against the active environment.

Low-Level Calls

To call a contract you have no source for, write a minimal interface with just the functions you need, compile it, and load the address with At Address:

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

interface IERC20Minimal {
    function totalSupply() external view returns (uint256);
    function balanceOf(address owner) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
}
  1. Compile the interface.
  2. In Deploy & Run, select IERC20Minimal in the Contract dropdown.
  3. Paste the deployed address into At Address — a full contract card appears with buttons for each interface function.

For raw calldata, every deployed contract card has a Low level interactions box at the bottom: paste hex into CALLDATA and click Transact to hit the fallback(), or leave it empty and set Value to test receive().