Start with a real Solidity question.
Open any example to understand the use case, inspect the exact code and expected result, then run it as a new Solidity REPL session.
10 CASES
Math & units
Confirm integer arithmetic, overflow behavior, bit operations, and Solidity units.
Ready to runBasic arithmeticTry division, remainder, and powers with normal Solidity rules.Solidity 0.4.0Solidity 0.4.0 arithmeticRun original 0.4 syntax and keep typed results visible inline.Ready to runEther and gas unitsConvert ether, gwei, and percentage calculations without a wrapper.Ready to runSigned divisionSee how negative integer division and remainders round in Solidity.Expected errorChecked overflowTrigger and inspect Solidity’s built-in overflow protection.Ready to runUnchecked wraparoundCompare unchecked arithmetic when a uint8 passes its maximum.Ready to runBitwise and modular mathExplore shifts, masks, addmod, and mulmod.Ready to runNumeric literal syntaxCompare digit separators, scientific notation, and hexadecimal literals.Ready to runTime unitsTurn minutes, hours, days, and weeks into their integer second values.Ready to runCompound assignmentUpdate one integer with arithmetic and shift assignment operators.
10 CASES
Encoding & crypto
Inspect hashes, ABI bytes, selectors, calldata, and signature recovery.
Ready to runKeccak hashHash text exactly as Solidity does onchain.Ready to runABI encode and decodeEncode mixed values and decode them back into typed variables.Ready to runPacked encodingCompare tightly packed bytes and their hash.Ready to runFunction selectorCalculate the first four bytes used to identify a function call.Ready to runDecode call dataRead the supplied transaction bytes as typed Solidity values.Ready to runRecover a signerTest ecrecover inputs and see the zero address for an invalid signature.Ready to runString, Unicode, and hex literalsBuild UTF-8 strings and raw bytes with Solidity literal syntax.Ready to runType-safe ABI call encodingEncode function calldata with compile-time argument type checking.Ready to runABI signature encodingCompare encodeWithSignature with explicit selector encoding.Ready to runSHA-256 and RIPEMD-160Compare Solidity’s SHA-256 and RIPEMD-160 cryptographic helpers.
09 CASES
Syntax & control flow
Practice branches, loops, named calls, boolean expressions, and tuple assignments.
Ready to runIf and else branchesFollow a value through ordered conditional branches.Ready to runFor, break, and continueFilter loop iterations with continue and stop the loop with break.Ready to runWhile and do-while loopsCompare a precondition loop with a loop that always runs once.Ready to runTernary and boolean logicCombine a conditional expression with AND, OR, and negation.Ready to runNamed function argumentsCall a function with named arguments in a different order.Ready to runTuple destructuringReturn several values and skip an unwanted tuple position.Ready to runNamed return valuesAssign named return variables without writing an explicit return tuple.Ready to runTuple assignment swapSwap two existing variables in one destructuring assignment.Ready to runRecursive internal callCall the current function internally until it reaches a base case.
17 CASES
Types & storage
Work with arrays, structs, enums, mappings, and raw storage effects.
Ready to runDynamic arraysCreate, change, and inspect an in-memory array.Ready to runFixed arraysTry a fixed-size array literal and read its items.Ready to runStruct valuesCreate a struct and inspect each field immediately.Ready to runEnumsMove between a named enum state and its numeric value.Ready to runMapping storageWrite a mapping and inspect the resulting storage change.Ready to runUser-defined value typeWrap and unwrap a custom numeric Solidity type.Ready to runStorage array push and popAppend, update, and remove values from a dynamic storage array.Ready to runMemory reference aliasingSee two memory variables refer to the same array allocation.Ready to runLocal storage referenceModify a state array through a local storage reference.Ready to runDelete and default valuesReset value types to their Solidity defaults with delete.Ready to runInternal function valuesPass a Solidity function as a typed value to another function.Solidity 0.8.18Named nested mappingUse named mapping keys and values in a nested allowance table.Ready to runType informationInspect integer limits, contract bytecode, and an interface identifier.Ready to runBytes storage membersPush, index, and pop individual bytes in dynamic storage.Ready to runCalldata array sliceRemove a four-byte selector and decode the remaining calldata.Ready to runExplicit type conversionsConvert between integer widths, fixed bytes, and payable addresses.Ready to runExternal function membersInspect the address and selector carried by an external function value.
24 CASES
Contracts & calls
Deploy contracts, follow external calls, use imports, and decode events.
Ready to runHelper functionDeclare a function beside loose statements and call it directly.Ready to runDeploy and call a contractCreate a contract in memory and call it in the same REPL session.Ready to runInheritance and overrideCheck virtual functions, super calls, and overrides.Ready to runImport a local libraryLoad a ready-made second file and use its library function.Ready to runUse an imported repository fileImport a library from a repository-shaped path and call it from the REPL.Ready to runInterface callCast a deployed contract to an interface and call it.Ready to runEmit and decode an eventSee indexed and normal event arguments beside their raw topics.Ready to runTry and catch a revertCall a contract that reverts and handle the result without ending the run.Ready to runConstant and immutable stateCompare a compile-time constant with a constructor-assigned immutable.Ready to runFunction modifierRun a function body through a reusable access-control modifier.Ready to runFunction overloadingResolve functions with the same name from their parameter types.Ready to runAbstract contract implementationImplement an abstract virtual function in a concrete contract.Ready to runLibrary using-for directiveAttach a library function to uint256 as a member function.Ready to runReceive and fallback functionsCompare an empty call with unmatched calldata on the same contract.Ready to runSalted contract creationDeploy a contract with CREATE2 syntax and a deterministic salt.Ready to runLow-level static callEncode calldata, use staticcall, and decode the returned bytes.Solidity 0.8.19User-defined operatorAttach the plus operator to a user-defined value type.Solidity 0.8.28Transient storageSet and clear transaction-scoped state with a transient variable.Ready to runSelective import aliasesRename imported symbols and use a file-level constant from another source.Ready to runBase constructor argumentsPass constructor arguments from a derived contract to its base.Ready to runDelegatecall storage contextRun another contract’s code while writing to the caller’s storage.Ready to runExternal call optionsAttach value and gas options to a typed external function call.Ready to runAnonymous eventEmit an anonymous event and inspect its indexed and data fields.Solidity 0.8.29Custom storage layout baseMove a contract’s first storage slot to a chosen base position.
08 CASES
Context & forks
Control transaction and block fields or read a fixed point in live chain state.
Ready to runTransaction and block contextInspect caller, value, call data, block time, number, and chain ID.Ready to runGlobal EVM informationRead block fees, randomness, coinbase, transaction gas price, and gas left.Ready to runMessage function selectorCompare msg.sig inside a call with the function’s selector member.Ready to runSend payable valueFund the active call and forward ether to another contract.Ready to runTimestamp deadlineTest time-based logic with a prefilled block timestamp.Ready to runChain ID conditionTry logic that changes based on the selected chain ID.Ready to runInspect a live addressSelect Fork and run; enter your RPC when prompted to inspect code and balance at a fixed block.Ready to runCall USDC on a forkCall a deployed token at one Ethereum block and inspect its metadata, supply, and pool balance.
10 CASES
Debugging & errors
Reproduce reverts, inspect panic data, and follow calls and EVM instructions.
Expected errorRequire messageTrigger a failed condition and jump back to its source line.Expected errorCustom errorRevert with typed data and inspect the failed run.Expected errorDivision by zeroSee a Solidity panic translated into a readable result.Expected errorAssert panicTrigger the panic reserved for a failed internal invariant.Ready to runYul switchUse inline assembly control flow and return the selected value.Ready to runTyped catch clausesHandle Error(string) and Panic(uint256) from external calls separately.Expected errorArray bounds panicRead beyond a memory array and inspect Solidity panic code 0x32.Ready to runMemory-safe assemblyAnnotate an inline assembly block and perform arithmetic in Yul.Ready to runAssembly memoryRun Yul memory instructions and inspect stack, memory, and opcodes.Ready to runNested call traceCreate an external call and inspect its gas, input, output, and depth.
08 CASES
VM helpers
Set balances, storage, time, block numbers, bytecode, labels, and persistent state.
Ready to runSet an address balanceUse vm.deal to fund any address for a local experiment.Ready to runWrite a storage slotPut a raw 32-byte value into a chosen contract slot.Ready to runRead a storage slotRead the raw value behind a normal Solidity state variable.Ready to runMove block timeChange block.timestamp during the run with vm.warp.Ready to runMove block numberChange block.number during the run with vm.roll.Ready to runInstall bytecodePlace tiny runtime bytecode at an address and call it.Ready to runLabel an addressGive an address a readable label while testing named actors.Persistent stateKeep state between runsRun repeatedly to watch a stored counter continue from its last value.