Skip to content
Custom compiler for Michelson - Tezos Smart Contracts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Put core into separate file to simplify unit testing Mar 14, 2019
.eslintrc.js Testing file and dir refactor in preparation for unit tests Mar 4, 2019
.gitignore Hide compiled tests Feb 20, 2019 Update Feb 20, 2019
index.js Put core into separate file to simplify unit testing Mar 14, 2019
jest.config.js Testing file and dir refactor in preparation for unit tests Mar 4, 2019
package.json Update packages Mar 14, 2019

fi - Smart Contract language for Tezos

fi (pronounced fee) is a powerful, smart contract language for Tezos that compiles down to valid and verifiable Michelson code. fi is currently in early alpha stages - please use at your own risk, and validate any compiled code.

Check us out online, or read through our Documentation to get started.



You can install the npm plugin:

npm install fi-compiler

You can the include the installed module:

var fi = require("fi-compiler");


You can also build a distributable version to be included on the web:

npm run build

This will generate a file within the dist directory. You can download and use the currently built dist file as well.

<script src="fi-compile.min.js"></script>

This will expose a global function, fi:



You can also install our npm CLI plugin, which allows you to compile fi directly from the command line:

npm i -g fi-cli

You can then compile code directly from your terminal using:

fi compile

This will output two files in the same directory as the target fi file: => The contract ABI => The compuled michelson code


You can use the following exposed functions when using the web or node.js library:


This returns the current version number of the fi-compiler.


fi.compile(code, config)

This takes one input argument, a string containing fi compile. This returns an object with two elements, code and abi.

var ficode = `
storage string name;
entry changeName(string name ){ =;
var compiled = fi.compile(ficode);
console.log(; //Michelson code
console.log(compiled.abi); //ABI JSON string

You can also parse a config object, which is optional. The default settings are:

  • ml_format - defaults to "optimized" for minimal michelson, can set as "readable" for a human readable version, or "array" for a JS array
  • abi_format - defaults to "optimized" for the bare minimum, can be set as "full" for a full ABI copy including an array representation of the fi code
  • macros - WIP


You can manually loan an ABI string, which can be used to build input parameters for contract calls. In future, we aim to add additional support for more helper functions.


fi.abi.entry(entry, input)

This function allows you to convert a JSON input object into packed bytes for calling a contract using a loaded ABI file. This function takes two input arguments, the name of the function you are calling, and the JSON object with the input.

var input = {
  name : "Stephen"
console.log(fbi.abi.entry("changeName", input)); // Returns packed bytes for a contract call
You can’t perform that action at this time.