Crate fe[][src]

Fe is an emerging smart contract language for the Ethereum blockchain.

Build Status Coverage

Overview

Fe is a statically typed language for the Ethereum Virtual Machine (EVM). It is inspired by Python and Rust and is easy to learn – even for developers who are new to the Ethereum ecosystem.

Features & Goals

Additional information about design goals and background can be found in the official announcement.

Language Specification

We aim to provide a full language specification that should eventually be used to formally verify the correctness of the compiler. A work in progress draft of the specification can be found here.

Progress

Fe development is still in its early stages. We have a basic Roadmap for 2021 that we want to follow. We generally try to drive the development by working through real world use cases. Our next goal is to provide a working Uniswap implementation in Fe which will help us to advance and form the language.

Fe had its first alpha release January 2021 and is now following a monthly release cycle.

Getting started

To compile Fe code:

  1. Run fe path/to/fe_source.fe
  2. Fe creates a directory output in the current working directory that contains the compiled binary and abi.

Run fe --help to explore further options.

Examples

The following is a simple contract implemented in Fe.

type BookMsg = bytes[100]

contract GuestBook:
    pub guest_book: Map<address, BookMsg>

    event Signed:
        book_msg: BookMsg

    pub def sign(book_msg: BookMsg):
        self.guest_book[msg.sender] = book_msg

        emit Signed(book_msg=book_msg)

    pub def get_msg(addr: address) -> BookMsg:
        return self.guest_book[addr].to_mem()

A lot more working examples can be found in our test fixtures directory.

The most advanced example that we can provide at this point is a fully working ERC20 implementation.

Community

Modules

_utils

Enums

CompilationTarget

Constants

DEFAULT_OUTPUT_DIR_NAME
VERSION

Functions

ioerr_to_string
main
verify_nonexistent_or_empty
write_compiled_module
write_output