Solidity REPL
Math & units

Ether and gas units

Convert ether, gwei, and percentage calculations without a wrapper.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern to confirm Solidity arithmetic and unit behavior before putting the same expression into a contract. The entry isolates ether and gas units so its input, result, and state changes stay easy to compare.

Solidity to run

uint256 amount = 1 ether

amount
amount / 1 gwei
amount * 5 / 100

What to expect

The run exposes 1 ether in wei, its value in gwei, and the integer result of calculating five percent.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about writing Solidity Prototype Solidity behavior