Fluent Documentation

website·Indexed 33 days ago

https://docs.fluent.xyz

Documentation for Fluent, an Ethereum-aligned L2 that runs EVM, Wasm, and SVM contracts on a single shared state machine. Includes guides for building smart contracts in Rust and Solidity, using the Fluentbase SDK, and deploying blended contracts with gblend. Covers the Fluent VM (rWasm), system architecture, and precompiles for EVM and WASM runtimes.

Tokens
35.5K
Snippets
116
Records
236
Agent score
65%

What's inside Fluent

  1. Overview of smart contract development on Fluent

    Fluent supports smart contract development in two primary languages: Rust and Solidity. Rust contracts are developed using the Fluentbase SDK and compile down to WebAssembly (WASM). Developers can choose the language that best fits their project requirements.
  2. Overview of EIP-7702 Smart Account Delegation

    EIP-7702 allows a standard Externally Owned Account (EOA) to behave as a programmable smart wallet without changing its address or moving funds. This is achieved via a SetCodeTransaction (type 0x04), which writes a delegation indicator (0xef0100 || delegate_address) into the account's code slot. Once delegated, any call to the EOA executes the code at the delegate_address within the EOA's own storage and balance context. The account owner can update or remove this delegation at any time using another SetCodeTransaction.

    Key benefits include:

    • Atomic call batching: Perform multiple actions (e.g., approve, swap, stake) in one transaction.
    • Gas sponsorship: Relayers can pay transaction fees; the delegate code verifies the user's intent.
    • On-chain policy logic: Implement spending caps, time locks, or alternative authentication (e.g., WebAuthn) via the delegate contract.
  3. Overview of the Fluent Bridge Layered Model

    The Fluent bridge is a two-way interface between Ethereum (L1) and Fluent (L2) consisting of three symmetrical layers deployed on both chains:

    1. Gateways: Asset-specific entry points. NativeGateway handles ETH, and ERC20Gateway handles ERC-20 tokens. They manage token locking/minting, validate that inbound messages originate from the paired gateway on the opposite chain, and consult safety registries (Blacklist, FastWithdrawalList).
    2. Bridge Core: Consists of L1FluentBridge and L2FluentBridge. This layer handles message encoding, sequential nonces, status tracking, and gas-bounded execution via ExcessivelySafeCall. All message destinations must be on the bridge's gateway whitelist.
    3. Settlement Integration:
      • L1FluentBridge manages a FIFO queue of pending L1 → L2 messages and verifies withdrawals against the rollup's batchRoot.
      • L2FluentBridge utilizes an L1BlockOracle for expiry checks and an L1GasOracle for outbound fee calculations.
  4. Overview of gblend for Fluent Network

    gblend is a specialized wrapper for Foundry's forge designed for hybrid Solidity and WebAssembly (WASM) smart contract development on the Fluent Network. It allows developers to integrate Rust-based WASM contracts into traditional Solidity workflows while maintaining compatibility with existing Foundry projects. Key capabilities include Rust-to-WASM compilation, Docker-based reproducible builds, and on-chain verification for both Solidity and WASM contracts.
  5. Overview of the Fluentbase Codec system

    The Fluentbase codec system manages the serialization and deserialization of smart contract data. It is no_std compatible and supports primitives, collections (Vec, HashMap), tuples, and nested structs. It allows for partial decoding to access specific parts of a serialized stream without decoding the entire payload.
  6. Overview of Fluent Blended Execution Network

    Fluent is a blended execution network that enables smart contracts written in EVM, WASM, and SVM (coming soon) to interact natively as if they were written in the same language. This architecture removes the need for bridges and complex state synchronization, allowing for true cross-VM composability (e.g., a Rust contract calling a Solidity contract directly). Fluent operates as an Ethereum L2, providing the same security guarantees and wallet support as Ethereum while supporting multiple VMs.
  7. Overview of gblend for hybrid Solidity and WASM development

    gblend is a specialized Foundry forge wrapper designed for hybrid Solidity and WebAssembly (WASM) smart contract development on the Fluent Network. It integrates Rust-based WASM contracts with traditional Solidity workflows and uses a custom REVM implementation for the fluentbase. The CLI usage is nearly identical to standard Forge, but requires the --wasm flag for WASM-specific operations like verification.
  8. Overview of Fluent's Hybrid Optimistic-ZK Settlement

    Fluent is an Ethereum-aligned L2 rollup that uses a hybrid security model combining optimistic throughput with cryptographic adjudication. Unlike pure optimistic rollups (which rely on dispute windows) or pure validity rollups (which require ZK proofs for every transition), Fluent uses TEE-based preconfirmations for rapid execution attestations and resolves challenges using SP1-backed ZK proofs. Settlement is execution-agnostic, meaning it verifies rollup commitments over block headers and batch Merkle roots rather than VM-specific execution traces, allowing it to support blended execution (EVM, Wasm, and SVM) without changing the settlement logic.
  9. Overview of Solidity development on Fluent Network

    Fluent is an EVM-compatible L2, allowing developers to deploy standard Solidity applications. While Fluent supports 'blended execution' (integrating Rust contracts via Fluentbase), standard Solidity migration and deployment are fully supported using familiar EVM tools like Foundry.
  10. Overview of Fluent Execution Layer Components

    Fluent uses a modular execution architecture where REVM acts as the coordinator for various runtimes. The core components include:

    • REVM integration layer: Handles frame setup, maintains the journal of tentative state changes, and manages the host side of syscalls.
    • Runtime executor: Executes rWasm modules in either Contract mode (isolated user contracts) or System mode (protocol-owned runtimes).
    • Interruptible EVM runtime: A delegated runtime that executes EVM bytecode within Fluent, running under rWasm.
    • SDK and runtime-context layer: Provides contract-facing APIs and handles structured envelopes for system runtimes to report side effects.
    • Shared types and constants: Defines the protocol-level contract (syscall indexes, address maps, gas/fuel constants) between the runtime and the host.
  11. Overview of the Fluentbase Router dispatch system

    The router macro provides a method dispatch system for Fluentbase smart contracts. It automatically transforms function calls containing Solidity-compatible selectors into Rust function calls by performing the following steps: reading the first 4 bytes of input as a selector, matching it against available methods, decoding parameters, executing the method, and encoding the return value. This enables interoperability between Rust contracts and EVM-compatible environments.
  12. Integrate Solidity compatible storage with other FluentBase SDK features

    The storage system is designed to work with other SDK components: use the Router System to access storage within routed methods, the Event System to trigger events upon storage state changes, and the Client System to enable cross-contract storage reads.