Smart Contract Language · v2.0

Write Contracts
Like Plain English

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.

Philosophy

Three Core Principles

Everything in Misoltav flows from three beliefs about what a smart contract language should be.

Readable by Anyone

A non-programmer should understand the intent of a contract at a glance. Code that reads like prose is code that's auditable.

Safe by Default

Overflow protection, reentrancy guards, and access control are keywords — not libraries. Security is the starting point, not an afterthought.

Less Boilerplate

No semicolons. No braces. No type annotations required for basic contracts. Express intent, not syntax ceremony.

Features

What Makes Misoltav Different

Every feature was chosen to remove friction, not add it.

Indentation Blocks

Python-style indentation. No curly braces. Block structure is visual and immediate.

function transfer(to, amount):
require balance[sender] >= amount
balance[sender] -= amount

One-Word Access Control

Replace entire modifier patterns with a single readable keyword at the top of a function.

function mint(user, amount):
only owner
balance[user] += amount

Reentrancy in One Word

No ReentrancyGuard import. No bool variable. Just lock — the compiler handles the rest.

function withdraw(amount):
lock
balance[sender] -= amount
send(sender, amount)

Mapping by Subscript

Declare state mappings in one line using subscript notation — no lengthy mapping() syntax.

balance[address]
allowance[address][address]

Human Context Variables

sender, value, now, self replace cryptic msg.sender, block.timestamp references.

owner = sender
deadline = now + 7 days
send(sender, value)

Pattern Matching

Exhaustive match statements replace chains of if/else over enum values.

match status:
Active:

Paused:

Safe Arithmetic Always

Integer overflow and underflow automatically revert the transaction. No SafeMath import needed.

-- safe by default:
balance[sender] -= amount
-- reverts if underflow

Native Unit Literals

Ether and time units are first-class citizens of the language, no manual conversion.

goal = 10 ether
deadline = now + 30 days
fee = 50 gwei
Language Paradigm

How Misoltav Thinks

Misoltav is designed around four interlocking paradigm pillars that collectively define its character as a language.

01

Imperative & Procedural

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.

step-by-step explicit flow no magic
02

Contract-Oriented

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.

contract as class on-chain objects encapsulation
03

Declarative Safety

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.

guard keywords compiler-enforced intent-first
04

Indentation-Scoped

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.

whitespace-sensitive no braces visual blocks
05

Type-Inferred

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.

type inference static safety no annotations
06

Event-Driven Logging

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.

event declarations auto-indexed audit trail

What Misoltav borrows from other languages

PythonIndentation-based block scoping
RustSafety-first, compiler-enforced constraints
GoMinimal syntax, keyword-driven semantics
SolidityContract model, EVM target, event system
ML / F#Pattern matching with exhaustiveness checks

What Misoltav innovates

onlyOne-word role-based access control guard
lockSingle-keyword reentrancy mutex injection
balance[address]Subscript-syntax mapping declaration
sender / value / nowHuman-readable blockchain context variables
Overflow-safe defaultAll arithmetic is safe — no library needed
Formal Grammar

BNF Grammar

Backus-Naur Form — defines every valid construct in Misoltav. Terminal symbols are in quotes; non-terminals in <angle-brackets>.

program.bnf
contract.bnf
functions.bnf
statements.bnf
expressions.bnf
terminals.bnf
Formal Grammar

EBNF Grammar

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
program.ebnf
contract.ebnf
functions.ebnf
statements.ebnf
expressions.ebnf
Language Reference

Complete Reference

Everything the language provides — keywords, guards, built-ins, operators, units, comments, and the compiler CLI.

Reserved Keywords

These identifiers are reserved by the language and cannot be used as variable or function names.

contract interface struct enum function import from event return if elif else match for in while only lock payable require revert emit send and or not true false self
decl Declaration flow Control flow safe Safety & effects logic Logic val Values

Guard Keywords

Placed at the start of a function body. Enforced by the compiler — no manual implementation needed.

KeywordWhat it doesReverts 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
guards.miso

Context Variables

Always in scope inside any function body. Read-only — cannot be assigned.

VariableTypeValueSolidity equiv.
senderaddressAddress that called this functionmsg.sender
valueuintAmount of ETH sent with this call (wei)msg.value
nowuintCurrent block timestamp (Unix seconds)block.timestamp
blockuintCurrent block numberblock.number
selfaddressThis contract's own addressaddress(this)
chainuintNetwork chain IDblock.chainid
gasuintRemaining gas at time of callgasleft()

Built-in Functions

Available everywhere. No import needed.

FunctionReturnsDescription
send(to, amount)Transfer amount wei to address to. Reverts on failure. Reentrancy-safe when combined with lock.
hash(data)bytes32Compute 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)uintReturn the length of an array or the size of a mapping.

Operator Precedence

Operators listed from highest (evaluated first) to lowest precedence.

LevelOperatorsAssociativityExample
6 Unary-Right-amount
5 Multiplicative*  /  %Lefta * b / c
4 Additive+  -Lefta + b - c
3 Comparison==  !=  <  >  <=  >=Lefta >= b
2 Logical NOTnotRightnot active
1 Logical ANDandLefta and b
0 Logical ORorLefta or b
⚠️ All arithmetic is overflow-safe by default. Integer overflow or underflow reverts the transaction automatically — no library needed.

Unit Literals

ETH denominations and time durations are first-class syntax. The compiler converts them to their base unit values at compile time.

ETH Denominations

LiteralValue in wei
1 wei1
1 gwei1 000 000 000
1 ether1 000 000 000 000 000 000

Time Durations

LiteralValue in seconds
1 seconds1
1 minutes60
1 hours3 600
1 days86 400
units.miso

Comment Syntax

Misoltav uses -- instead of //, keeping comments visually distinct.

SyntaxTypeNotes
-- textSingle-lineEverything from -- to end of line is ignored
--[ ... ]--Multi-lineSpans multiple lines; can be nested
--- textDoc commentTriple-dash; included in auto-generated HTML docs by misolc docs
comments.miso

Built-in Safety Mechanisms

Misoltav makes security the default — not an opt-in library.

Overflow / Underflow Protection

All arithmetic is automatically checked. Any integer overflow or underflow reverts the transaction. No SafeMath or unchecked needed.

only Access Guard

Declare who can call a function in one word. Works with any address variable — owner, admin, self, or a custom role.

lock Reentrancy Guard

One 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 Guard

Functions without payable automatically reject any call that sends ETH. This prevents accidental ETH locking.

Mapping Defaults

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.

Readable Error Messages

Compiler errors include line/column pointers, the offending code, and a specific help hint — not just a cryptic code.

Compiler CLI — misolc

All tooling in one binary. Compile, check, format, test, and generate docs.

CommandWhat 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
terminal
Syntax

Misoltav vs Solidity

The same logic — far fewer words. Click any tab to see the comparison.

Solidity
Misoltav
Examples

Real Contracts, Real Simple

Three contract patterns written in Misoltav.

Token.miso

ERC-20 Style Token

A fully functional fungible token with mint, burn, transfer, and approval — in fewer than 40 lines with no imports.

    Architecture

    How the Compiler Works

    Eight clean stages from source to EVM bytecode.

    1
    Lexer
    Tokenises source into a stream including special INDENT/DEDENT tokens for blocks
    2
    Parser
    Recursive-descent pass produces a typed Abstract Syntax Tree
    3
    Name Resolver
    Resolves symbols and builds a complete scope/symbol table
    4
    Type Inferrer
    Infers types for all nodes — no annotation needed from the developer
    5
    Safety Passes
    Checks only/lock/payable guards, overflow paths, and reentrancy graphs
    6
    IR Lowering
    Converts typed AST into Misoltav Intermediate Representation (MIR)
    7
    Optimiser
    Constant folding, dead-code elimination, and gas-usage reduction
    8
    EVM Codegen
    Emits EVM bytecode and auto-generates a complete ABI JSON file

    Guard Keywords

    only ownerReverts if sender ≠ owner
    lockReentrancy mutex
    payableAccepts ETH; rejects without it

    Context Variables

    sendermsg.sender
    valuemsg.value — ETH sent
    nowblock.timestamp
    blockblock.number
    selfaddress(this)
    gasgasleft()

    Built-in Functions

    send(to, amount)Transfer ETH
    hash(data)keccak256
    require(cond)Revert on failure
    revert(msg)Revert with message
    emit Event(…)Emit a log event
    Use Cases

    What You Can Build

    From simple tokens to complex DeFi protocols — Misoltav grows with you.

    Fungible Token
    balance[address] · only · events
    NFT Collection
    ownerOf[address] · struct · events
    DAO Voting
    struct · hasVoted[address] · only
    Crowdfunding
    payable · enum · lock · time units
    Escrow
    lock · enum state machine · only
    Multi-sig Wallet
    approved[address][address] · threshold
    Staking Pool
    time arithmetic · send · lock
    Supply Chain
    enum stages · only · event audit
    Land Registry
    struct · ownerOf · access control
    Lottery
    payable · send · array of players
    Roadmap

    The Journey Ahead

    Ten phases from specification to a full browser-based playground.

    Phase 1Language SpecificationComplete
    Phase 2Lexer + ParserComplete
    Phase 3Type Inference EngineComplete
    Phase 4Safety Pass (only / lock / payable)Complete
    Phase 5EVM Bytecode BackendComplete
    Phase 6Standard Library (std.tokens · std.access)Complete
    Phase 7Test Framework (misolc test)Complete
    Phase 8LSP Server — IDE AutocompleteComplete
    Phase 9WASM Backend (non-EVM chains)Complete
    Phase 10Browser Playground IDEComplete
    Team

    Who Developed This

    Misoltav language specification and website by the following developers.

    Khant Wai Yan Aung6703712
    Kaung San Thu6703124
    Aung Myo Min6704508
    Eaint Cherry Kyaw6703488
    Nang May Phoo Thaw6704622
    Kaung Khant Phyo6703473