Skip to content

Fe

Introduction

Fe is a modern programming language specifically designed for Ethereum smart contracts, supported by the Ethereum Foundation. Fe is written in Rust and aims to provide a safer, more concise smart contract development experience than Solidity. The language name "Fe" is taken from the chemical symbol for iron, symbolizing its robust and reliable characteristics.

Fe began development in 2021 as a spiritual successor to Vyper and a modern alternative to Solidity. Fe draws inspiration from Rust's design philosophy, emphasizing memory safety, type safety, and developer friendliness. Unlike Solidity's complexity and historical baggage, Fe adopts a minimalist design principle, removing unnecessary features and focusing on the core needs of smart contract development.

Fe compiles to EVM bytecode and is fully compatible with the Ethereum Virtual Machine and all Ethereum toolchains. Developers can use Fe to write secure DeFi protocols, NFT contracts, DAO governance systems, and more, while enjoying a modern programming language development experience. As of 2024, Fe has released multiple stable versions, attracting an increasing number of developers who prioritize security and code quality.

Core Features

Memory Safety

Fe borrows Rust's ownership system, catching most memory errors at compile time. The language design eliminates common vulnerabilities such as null pointers, buffer overflows, and use-after-free. Fe's type system forces developers to explicitly handle potential error conditions, avoiding the implicit type conversions and unchecked return values common in Solidity.

Minimalist Syntax

Fe uses clear, concise syntax, removing many of Solidity's complex features and historical legacy issues. The language specification is smaller and the learning curve is gentler. Fe's syntax resembles a combination of Python and Rust, making it easy to read and maintain. For example, Fe uses indentation instead of curly braces to denote code blocks, making code structure clearer.

Strong Type System

Fe has a strict static type system where all variables and function parameters must have explicit type annotations. The type system includes basic types (u8, u16, u32, u64, u128, u256, i8 through i256, bool, address), compound types (struct, enum, array, map), and custom types. The compiler performs strict type checking to prevent security vulnerabilities caused by type confusion.

Explicit Error Handling

Fe requires explicit handling of all possible error conditions through Result and Option types, forcing developers to consider failure paths. This avoids the common Solidity issues of ignoring return values or unchecked call failures. Fe's assert and revert statements have clear semantics without ambiguity.

No Inheritance Design

Fe does not support Solidity-style contract inheritance, instead using composition and a Trait system. This design avoids the complexity and "diamond problem" caused by multiple inheritance, makes code dependencies clearer, and reduces audit difficulty.

Standard Library

Fe provides a carefully designed standard library containing common mathematical operations, hash functions, signature verification, and other utilities. The standard library has been rigorously audited, so developers can use it confidently without reinventing the wheel or relying on unaudited third-party libraries.

Technical Advantages

Security First

Fe's design prioritizes security. Through the ownership system, strong type checking, explicit error handling, and other mechanisms, the possibility of smart contract vulnerabilities is significantly reduced. The language design eliminates the root causes of common vulnerabilities such as reentrancy attacks, integer overflows, and uninitialized variables.

Auditability

Fe's concise syntax and clear semantics make code easier to audit. Without implicit behaviors and magic operations, auditors can quickly understand code logic. Compared to Solidity's complex inheritance chains and modifier systems, Fe contracts have lower audit costs and higher quality.

Development Efficiency

While Fe emphasizes security, it does not sacrifice development efficiency. Modern syntax, friendly compiler error messages, and a comprehensive toolchain make the development experience superior to traditional smart contract languages. Fe compiles quickly, and incremental compilation support makes development of large projects efficient as well.

EVM Compatible

Fe compiles to standard EVM bytecode and can be deployed to the Ethereum mainnet, various Layer 2s, and EVM-compatible chains (such as BSC, Polygon, Avalanche). Fe contracts can seamlessly interact with Solidity contracts, facilitating incremental migration.

Future Extensibility

Fe's modular design leaves room for future expansion. As the Ethereum Virtual Machine evolves (such as EOF, EVM Object Format), Fe can quickly adapt to new features. Fe is also exploring the possibility of compiling to WebAssembly and other virtual machines.

Syntax Examples

Basic Contract Structure

contract SimpleToken:
    balances: Map<address, u256>
    total_supply: u256

    pub fn __init__(initial_supply: u256):
        self.total_supply = initial_supply
        self.balances[msg.sender] = initial_supply

    pub fn transfer(to: address, amount: u256) -> bool:
        assert self.balances[msg.sender] >= amount, "Insufficient balance"

        self.balances[msg.sender] -= amount
        self.balances[to] += amount

        return true

    pub fn balance_of(account: address) -> u256:
        return self.balances[account]

Structs and Enums

struct User:
    name: String<100>
    age: u8
    active: bool

enum Status:
    Pending
    Active
    Expired

contract UserRegistry:
    users: Map<address, User>
    status: Map<address, Status>

    pub fn register(name: String<100>, age: u8):
        self.users[msg.sender] = User(
            name: name,
            age: age,
            active: true
        )
        self.status[msg.sender] = Status.Active

Error Handling

contract SafeVault:
    balances: Map<address, u256>

    pub fn withdraw(amount: u256):
        let balance: u256 = self.balances[msg.sender]
        assert balance >= amount, "Insufficient funds"

        self.balances[msg.sender] = balance - amount

        // Explicitly handle external call failure
        let success: bool = msg.sender.send(value: amount)
        assert success, "Transfer failed"

Use Cases

DeFi Protocols

Fe's security makes it very suitable for building DeFi applications. Decentralized exchanges, lending protocols, stablecoin systems, and other high-value applications can use Fe to reduce smart contract vulnerability risks. Fe's auditability also makes it easier for DeFi projects to pass security audits.

NFT and Gaming

NFT minting, trading, royalty management, and other contracts can be implemented with Fe. Core logic for on-chain games (such as item systems, battle calculations, economic models) written in Fe can ensure fairness and security.

DAO Governance

DAO governance contracts, voting systems, and treasury management can be implemented with Fe. Fe's clear semantics make governance rules easy to understand and verify, reducing the risk of community disputes and governance attacks.

Enterprise Applications

When enterprises use blockchain for supply chain management, asset tokenization, or credential verification, they can use Fe to write critical smart contracts. Fe's security and auditability meet enterprise requirements for compliance and risk control.

Education and Research

Fe's concise syntax and secure design make it an ideal language for smart contract education. Students can more quickly grasp core concepts without being distracted by complex language features. Academia is also exploring formal verification methods based on Fe.

Development History

2021: Project Launch

The Ethereum Foundation launched the Fe language project with the goal of creating a secure, modern smart contract language. The project learned from Vyper's experience while introducing Rust's design philosophy.

Late 2021: Alpha Version

Fe released its first Alpha version with basic syntax and compiler. Early adopters began writing simple contracts in Fe, providing feedback to drive language evolution.

2022: Language Maturation

Through multiple iterations, Fe's syntax and features gradually stabilized. The compiler implemented complete type checking, error handling, optimization, and other features. The standard library was continuously improved with more utilities.

2023: Ecosystem Building

Fe's toolchain matured, including IDE plugins, debuggers, testing frameworks, documentation generators, and more. The community began building DeFi protocols and NFT projects based on Fe. Fe contracts saw practical use on testnets and some sidechains.

2024: Mainnet Applications

An increasing number of projects deployed Fe contracts on the Ethereum mainnet. Fe's security track record and audit friendliness attracted security-focused development teams. The community continued contributing improvements, and Fe gradually became an important alternative to Solidity.

Comparison with Solidity

Feature Fe Solidity
Memory Safety Compile-time guarantee Runtime checks
Type System Strict static types Static types but allows implicit conversions
Inheritance Not supported, uses composition Supports multiple inheritance
Error Handling Explicit Result/Option Implicit, easy to ignore return values
Syntax Complexity Minimalist More complex
Learning Curve Gentle Steep
Ecosystem Maturity Emerging Mature
Tool Support Growing Rich
Security High (guaranteed by design) Depends on developer experience
Audit Cost Low High