Documentation menu
Compiler

Playground guide

Check, type, normalise, elaborate, run and compile Omegyu programs in the browser, with the compiler built for WebAssembly.

Find a section6 sections

What runs here

Open the playground to edit, check and run a program. A worker in your browser checks the program. Programs can use the standard library and files in your browser workspace. They cannot read your machine’s files or environment; Import copies only the file you select. URL imports can make network requests.

  • Run executes an IO program. Choose it under Action, then press Run above the source. If the program reads a line, type in Program input and press Enter. Send line with an empty field sends a blank line; End input closes stdin; Stop interrupts the run. Under Settings, choose Prepared text to reproduce an example without typing, or set its arguments. Each argument field passes one string, even if it’s empty or contains spaces. Program output is limited to 200,000 characters.

  • REPL opens an Omegyu prompt separate from the source editor. Enter let n = 7, then n + 1. Use :type to inspect an expression without running it. Enter submits a command; Shift-Enter adds a line. An open bracket asks for another line. When an action asks for Program input, even :reset is data. At the Omegyu command prompt, :reset clears definitions without changing your editor; :help lists commands. Stop interrupts only the current command. REPL history and sandbox files stay in this visit, not in shared links.

  • Build for the EVM compiles a contract. For a package, the sender address and next nonce determine the predicted installation addresses. Building does not send a transaction.

Workspace files

Choose Files to show or hide the explorer. Open a folder with the arrow keys, then press Enter on a file. The tree includes every published example, including imported modules. New and Import accept paths such as demo/lib/Step.omg; folders follow the path. Rename moves the current file to its new path. Update relative imports yourself after moving a file. Delete asks for confirmation.

Edits take effect immediately for relative imports. The browser remembers your drafts, active file and Vim keybindings preference locally. Vim mode starts in normal mode: press i to insert text and Escape to return. Uncheck the option for the default shortcuts. On a phone, opening a file closes the explorer so the editor can use the whole width.

To discard one example’s edits, open it, choose Rewind, and confirm. This restores its published text without changing other drafts or deployed instances. Use Restore published file to bring back a deleted example. Clearing site storage removes local files and preferences. Share includes the workspace path of the file you are sharing. Reloading the link resolves relative imports from that directory using the files in this browser. The link does not include those dependencies: another reader needs their own copies. If a different draft occupies the same path, the playground opens the shared source in a sibling file instead of overwriting the draft.

Deploy on the local chain

Follow Write your first contract for a complete editable example. Use the workspace bar to switch between Editor, VM lab and REPL. In Deploy, Deployment source lists the entire workspace, including helpers and local files. Choosing a file checks and builds that entry with its current imports; it does not switch the editor. A valid entry exports a typed contract. A number, ordinary program, missing import or type error cannot enable Deploy instance. Open Compiler diagnostic for details. After editing a file, use Build selected file (or Build current source if it is open) to check again. The lab accepts direct creation code, not linked packages. You can also switch to the lab after Build for the EVM in the editor. The call log stays below the work area. Supply the constructor inputs and choose Deploy instance. Deployment opens Interact. Click a deployed address, then choose Solidity ABI or Native. The number on each button counts the functions that address exposes on that interface. Switching does not redeploy the contract or change its storage. Each function has its own inputs and button: Read simulates without changing state; Send commits a successful transaction. Both actions open Inspect on the new receipt, even if the call reverted. The functions stay beside the receipt on a larger screen or below it on a phone; your inputs stay in place for the next call. Invalid input shows an error without adding a receipt. The last result links to its receipt beside the function name; the complete sequence stays in the log. The receipt gives gas and changed storage slots. Inspect slot reads the selected instance’s latest storage by decimal or hexadecimal key. Selecting an old receipt shows its recorded changes, not a snapshot of every slot. Editing or failing a build of the editor source removes its deployment form, not the existing instances. Reset chain asks before discarding them. The Call log appends an entry for each execution; select one to reopen its receipt. Expand log fills the VM workspace with the journal; Restore lab brings the controls back. These panes scroll independently of the page. To see calls into an instance, enable Record calls to this instance before calling it, then expand Call trace in the inspector. A revert shows the decoded ABI error when known and lets you inspect the raw bytes.

This chain runs REVM in WebAssembly on the Osaka fork. Direct deployment uses the constructor encoding in the build, independently of your call protocol. Linked package installation and fallback or receive calls are outside these controls. No wallet or RPC is involved. Closing the playground discards the chain; shared links carry source, not deployments.

Reused local build means the compiler checked the selected file and its imports, then recognized the same staged contract and public interfaces. It skipped bytecode generation; it did not skip checking. Generated fresh build means it ran generation. Expand either note for the key and worker’s generation count. The cache keeps at most 16 successful artifacts within an 8 MiB payload budget, separate from your files and the chain. Clearing browser storage, changing compiler builds or changing linking settings can require a fresh build.

Solidity ABI inputs

Use the type printed beside each constructor or function argument:

ABI typeWhat to enter
uintN, intNN is a multiple of 8 from 8 to 256. Enter a decimal integer, or a nonnegative 0x hex integer, within the declared range. For example, uint8 accepts 0 to 255; for int8, use -128 to 127. Solidity’s uint and int mean 256 bits.
boolChoose true or false. Inside JSON use the boolean literals, not 0 or 1.
addressEnter 0x followed by 40 hex digits (20 bytes). Use lowercase or a correctly checksummed mixed-case address; a name is not an address.
bytes, bytes1 … bytes32Enter 0x followed by two hex digits per byte. 0x is empty dynamic bytes; a fixed type must have exactly its declared length.
stringType the text itself, without surrounding quotes. An empty field is an empty string.
T[], T[N], tuplesUse JSON arrays, nested as needed. Fixed arrays require exactly N elements. Tuple elements go in ABI order, not in a JSON object. For (address,bool), enter ["0x0000000000000000000000000000000000000001",true].

Integer fields accept all the digits as text. Inside JSON, quote integers outside the safe range -9007199254740991 through 9007199254740991, and quote hex strings. For example, enter ["9007199254740993","0xff"] for a uint256[]; an unquoted large JSON number can lose precision before the ABI encoder sees it. For a payable call, the separate value field takes an unsigned amount in wei.

Native inputs

For Native, enter lists as JSON arrays, records as named JSON objects and unions as single-key objects such as {"Some":"42"}. Native words and integers accept decimal or hexadecimal; quote large integers inside JSON to preserve every digit.

Editor shortcuts and sharing

Control-Enter or Command-Enter executes the selected action from the editor. On a phone, switch between Source and Answer. On a larger screen, drag the divider or focus it and use the arrow keys to resize the panes. Changing the source or its inputs clears the old answer. Share saves the example or edited source, selected action, prepared input (if selected), arguments and build settings in the address. Opening the link restores the experiment without executing it. Anyone with the link can read those values; leave out secrets. Lines sent to a live program are not included.