Fluent Documentation
website·Indexed 33 days ago
https://docs.fluent.xyzDocumentation 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.
What's inside 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.
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(type0x04), 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 thedelegate_addresswithin the EOA's own storage and balance context. The account owner can update or remove this delegation at any time using anotherSetCodeTransaction.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.
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:
- Gateways: Asset-specific entry points.
NativeGatewayhandles ETH, andERC20Gatewayhandles 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). - Bridge Core: Consists of
L1FluentBridgeandL2FluentBridge. This layer handles message encoding, sequential nonces, status tracking, and gas-bounded execution viaExcessivelySafeCall. All message destinations must be on the bridge's gateway whitelist. - Settlement Integration:
L1FluentBridgemanages a FIFO queue of pending L1 → L2 messages and verifies withdrawals against the rollup'sbatchRoot.L2FluentBridgeutilizes anL1BlockOraclefor expiry checks and anL1GasOraclefor outbound fee calculations.
- Gateways: Asset-specific entry points.
Overview of gblend for Fluent Network
gblend is a specialized wrapper for Foundry'sforgedesigned 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.Overview of the Fluentbase Codec system
The Fluentbase codec system manages the serialization and deserialization of smart contract data. It isno_stdcompatible 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.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.Overview of gblend for hybrid Solidity and WASM development
gblendis 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--wasmflag for WASM-specific operations like verification.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.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.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.
Overview of the Fluentbase Router dispatch system
Theroutermacro 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.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.