Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick Start

Get started with Ursus in 10 minutes. Write, compile, and deploy your first smart contract.

Prerequisites

Make sure you have Ursus installed.

What You'll Learn

  1. Write a Simple Contract - Create your first Ursus contract
  2. Compile from Solidity - Convert Solidity to Ursus
  3. Compile Ursus - Extract executable code
  4. Deploy - Deploy to blockchain (coming soon)

Your First Contract

Here's a minimal Ursus contract:

Require Import UrsusEnvironment.

Contract Counter ;
Sends To ;
Types ;
Constants ;

Record Contract := {
    count: uint256
}.

Ursus Definition increment: UExpression PhantomType false.
{
    ::// count := count + {1} |.
}
return.
Defined.

That's it! You have a working smart contract.

Next Steps

Choose your path:

Path 1: Learn by Example

Write a Simple Contract - Step-by-step tutorial

Path 2: Convert Existing Code

Compile from Solidity - Translate Solidity contracts

Path 3: Deep Dive

Ursus Language - Complete language reference

Quick Reference

Contract structure:

Contract Name ;          (* Contract declaration *)
Sends To ;              (* Message types *)
Types ;                 (* Custom types *)
Constants ;             (* Constants *)
Record Contract := {    (* State fields *)
    field: type
}.

Function definition:

Ursus Definition functionName (param: type): UExpression returnType false.
{
    ::// (* function body *) |.
}
return.
Defined.

Common operations:

::// field := value |.              (* Assignment *)
::// _result := expression |.       (* Return value *)
::// if (condition) then { ... } |. (* Conditional *)

Getting Help

  • Examples: Check ursus-patterns repository for comprehensive examples
  • Language Reference: Ursus Language
  • Standard Library: Functions

Ready? → Write Your First Contract