Misoltav is an indentation-first, type-optional smart contract language.
No braces. No boilerplate. Built-in safety. If you can read it, you can write it.
Everything in Misoltav flows from three beliefs about what a smart contract language should be.
A non-programmer should understand the intent of a contract at a glance. Code that reads like prose is code that's auditable.
Overflow protection, reentrancy guards, and access control are keywords — not libraries. Security is the starting point, not an afterthought.
No semicolons. No braces. No type annotations required for basic contracts. Express intent, not syntax ceremony.
Every feature was chosen to remove friction, not add it.
Python-style indentation. No curly braces. Block structure is visual and immediate.
function transfer(to, amount):
require balance[sender] >= amount
balance[sender] -= amountReplace entire modifier patterns with a single readable keyword at the top of a function.
function mint(user, amount):
only owner
balance[user] += amountNo ReentrancyGuard import. No bool variable. Just lock — the compiler handles the rest.
function withdraw(amount):
lock
balance[sender] -= amount
send(sender, amount)Declare state mappings in one line using subscript notation — no lengthy mapping() syntax.
balance[address]
allowance[address][address]sender, value, now, self replace cryptic msg.sender, block.timestamp references.
owner = sender
deadline = now + 7 days
send(sender, value)Exhaustive match statements replace chains of if/else over enum values.
match status:
Active:
…
Paused:
…Integer overflow and underflow automatically revert the transaction. No SafeMath import needed.
-- safe by default:
balance[sender] -= amount
-- reverts if underflowEther and time units are first-class citizens of the language, no manual conversion.
goal = 10 ether
deadline = now + 30 days
fee = 50 gweiMisoltav is designed around four interlocking paradigm pillars that collectively define its character as a language.
Contracts are written as sequential instructions. Functions describe what to do, step by step — read a balance, check a condition, update state, emit an event. There are no hidden side-effects outside of what is written.
The contract is the top-level unit of organization — equivalent to a class in OOP languages but living permanently on-chain. State belongs to a contract; functions are the only interface to that state.
Safety constraints are declared as keywords at the top of a function body — only, lock, payable — rather than implemented by hand. The compiler enforces them. You state intent; the compiler does the work.
Like Python, block structure is communicated visually through indentation — not with braces. An indent after a colon opens a block; returning to the previous indent level closes it. Consistent indentation is enforced by the compiler.
Misoltav infers types from context. You never write uint256 or address when declaring simple variables. The compiler figures out the type based on assignment — but still catches type mismatches at compile time.
State changes are made observable through first-class event declarations and emit statements. Events are the contract's audit trail — and are automatically indexed for efficient off-chain querying.
Backus-Naur Form — defines every valid construct in Misoltav. Terminal symbols are in quotes; non-terminals in <angle-brackets>.
Extended Backus-Naur Form — adds repetition { }, optional [ ], grouping ( ), and alternation | for a more concise specification.
{ x } zero or more
[ x ] optional
( x ) grouping
x | y alternation
x , y sequence
; rule end
Everything the language provides — keywords, guards, built-ins, operators, units, comments, and the compiler CLI.
These identifiers are reserved by the language and cannot be used as variable or function names.
Placed at the start of a function body. Enforced by the compiler — no manual implementation needed.
| Keyword | What it does | Reverts when |
|---|---|---|
only <expr> |
Access control guard. Restricts the caller to a specific address. | sender != expr |
lock |
Reentrancy mutex. Prevents reentrant calls by setting and clearing a boolean flag around the function body. | If the function is called while already executing |
payable |
Marks the function as ETH-accepting. Without this, any call that sends ETH is auto-rejected. | Not present when ETH is sent to a non-payable call |
Always in scope inside any function body. Read-only — cannot be assigned.
| Variable | Type | Value | Solidity equiv. |
|---|---|---|---|
sender | address | Address that called this function | msg.sender |
value | uint | Amount of ETH sent with this call (wei) | msg.value |
now | uint | Current block timestamp (Unix seconds) | block.timestamp |
block | uint | Current block number | block.number |
self | address | This contract's own address | address(this) |
chain | uint | Network chain ID | block.chainid |
gas | uint | Remaining gas at time of call | gasleft() |
Available everywhere. No import needed.
| Function | Returns | Description |
|---|---|---|
send(to, amount) | — | Transfer amount wei to address to. Reverts on failure. Reentrancy-safe when combined with lock. |
hash(data) | bytes32 | Compute the keccak256 hash of data. |
assert(cond) | — | Assert an invariant. Panics (consumes all gas) on failure. Use for internal logic errors. |
require(cond) | — | Require a condition. Reverts cleanly with an optional message if false. |
require(cond, msg) | — | Same as above but includes a human-readable revert message string. |
revert(msg) | — | Unconditionally revert with a message string. |
emit Event(...) | — | Emit a declared event with named arguments. |
len(arr) | uint | Return the length of an array or the size of a mapping. |
Operators listed from highest (evaluated first) to lowest precedence.
| Level | Operators | Associativity | Example |
|---|---|---|---|
| 6 Unary | - | Right | -amount |
| 5 Multiplicative | * / % | Left | a * b / c |
| 4 Additive | + - | Left | a + b - c |
| 3 Comparison | == != < > <= >= | Left | a >= b |
| 2 Logical NOT | not | Right | not active |
| 1 Logical AND | and | Left | a and b |
| 0 Logical OR | or | Left | a or b |
ETH denominations and time durations are first-class syntax. The compiler converts them to their base unit values at compile time.
| Literal | Value in wei |
|---|---|
1 wei | 1 |
1 gwei | 1 000 000 000 |
1 ether | 1 000 000 000 000 000 000 |
| Literal | Value in seconds |
|---|---|
1 seconds | 1 |
1 minutes | 60 |
1 hours | 3 600 |
1 days | 86 400 |
Misoltav uses -- instead of //, keeping comments visually distinct.
| Syntax | Type | Notes |
|---|---|---|
-- text | Single-line | Everything from -- to end of line is ignored |
--[ ... ]-- | Multi-line | Spans multiple lines; can be nested |
--- text | Doc comment | Triple-dash; included in auto-generated HTML docs by misolc docs |
Misoltav makes security the default — not an opt-in library.
All arithmetic is automatically checked. Any integer overflow or underflow reverts the transaction. No SafeMath or unchecked needed.
only Access GuardDeclare who can call a function in one word. Works with any address variable — owner, admin, self, or a custom role.
lock Reentrancy GuardOne keyword injects a complete mutex that prevents any reentrant call to the function. The compiler inserts set/clear logic around the entire function body.
payable GuardFunctions without payable automatically reject any call that sends ETH. This prevents accidental ETH locking.
Accessing an unset mapping key never throws. It returns the zero value for the type — 0 for numbers, the zero address for addresses, false for booleans.
Compiler errors include line/column pointers, the offending code, and a specific help hint — not just a cryptic code.
misolcAll tooling in one binary. Compile, check, format, test, and generate docs.
| Command | What it does |
|---|---|
misolc compile <file> | Compile to EVM bytecode and output ABI JSON |
misolc check <file> | Type-check and safety-check only — no bytecode output |
misolc abi <file> | Output the ABI JSON for the contract |
misolc test <dir> | Run all .miso test files in a directory |
misolc fmt <file> | Auto-format the source file (opinionated, like gofmt) |
misolc docs <file> | Generate HTML documentation from --- doc comments |
The same logic — far fewer words. Click any tab to see the comparison.
Three contract patterns written in Misoltav.
A fully functional fungible token with mint, burn, transfer, and approval — in fewer than 40 lines with no imports.
Eight clean stages from source to EVM bytecode.
From simple tokens to complex DeFi protocols — Misoltav grows with you.
Ten phases from specification to a full browser-based playground.
Misoltav language specification and website by the following developers.