Introduction

fi is a statically typed high-level programming language designed to be similar, syntactically, to ECMAScript/Javascript and Solidity. fi compiles directly to valid and well-typed Michelson code, the native smart contract language for the Tezos block chain.

fi allows developers to work in a more familiar coding environment, providing a close experience to object-oriented programming. Here's a really short demonstration of the potential of developing smart contracts with fi:

# King of Tez Contract

# Define a constant for ONEWEEK in seconds
const int ONEWEEK 604800;

# Define an object King
struct King(
    timestamp end, 
    mutez bounty, 
    address owner); 

# Declare a storage variable king of type King (the object we created)
storage King king; 

# Entry point for this script
entry contend(){
    assert(storage.king.end < NOW || AMOUNT > storage.king.bounty);
    let address oldKing = storage.king.owner;
    storage.king = new King(add(NOW, ONEWEEK), AMOUNT, SENDER);
    transfer(oldKing, AMOUNT);
}

This smart contract reads extremely easy within fi, but accomplishes an extremely advanced set of functions.

Compiling to Michelson

You can install our compiler by following instructions from our Github repo - this will allow you to install and use our compiler. You can also use our online compiler tool as well.

The web-based browser/editor will compile your fi to Michelson and typecheck the compiled source code. Furthermore, you can run tests against your Smart Contract to simulate live operations and calls.

Last updated