A Foundry forge wrapper optimized for Fluent Network and WASM smart contract development.
- Install
gblendup
:
curl -sSL https://raw.githubusercontent.com/fluentlabs-xyz/gblend/refs/tags/latest/gblendup/install | bash
-
Start a new terminal session or update source file
-
Install
gblend
usinggblendup
gblendup
This will automatically download precompiled binaries for your platform or build from source if needed.
After installation, verify gblend is working:
gblend --version
To update gblend to the latest version, simply run the installer again:
curl -sSL https://raw.githubusercontent.com/fluentlabs-xyz/gblend/refs/tags/latest/gblendup/install | bash
gblend is a wrapper around Foundry's forge that uses Fluent's version of REVM and is designed to work with Wasm smart contracts. It enables you to:
- Compile Rust smart contracts for WASM execution
- Deploy contracts to Fluent Network
- Verify WASM contracts on-chain
- Create new projects using templates from fluentlabs-xyz/examples
The usage is very similar to regular Foundry forge with some additional features. For example, when verifying WASM
contracts, you need to pass the --wasm
argument. Otherwise, it works almost identically to forge.
# Create a new project using Fluent examples
gblend init my-project
# Create project with specific template
gblend init my-project --template <template-name>
# Build your contracts
# For reproducibility, builds are run inside a Docker container.
# The first build may take longer as the container image needs to be downloaded.
gblend build
# Clean build artifacts
gblend clean
# Run tests
gblend test
# Run specific test
gblend test --match-test testMyFunction
# Run tests with gas reporting
gblend test --gas-report
# Deploy a contract
# Deploy a WASM contract with verification
# contract name - rust package name in pascal case with .wasm suffix
gblend create PowerCalculator.wasm \
--rpc-url <rpc-url> \
--private-key <key> \
--broadcast \
--verify \
--wasm \
--verifier blockscout \
--verifier-url <verifier-url>
# Deploy a Solidity contract
# NOTE: constructor args should be the last argument if used
gblend create src/BlendedCounter.sol:BlendedCounter \
--rpc-url <rpc-url> \
--private-key <key> \
--broadcast \
--constructor-args <args>
# Deploy using a script
gblend script script/BlendedCounter.s.sol:Deploy \
--rpc-url <rpc-url> \
--private-key <key> \
--broadcast
# Verify a regular Solidity contract
gblend verify-contract <address> BlendedCounter \
--verifier blockscout \
--verifier-url <verifier-url>
gblend verify-contract <address> PowerCalculator.wasm \
--wasm \
--verifier blockscout \
--verifier-url <verifier-url> \
--constructor-args <args>
gblend uses the same configuration system as Foundry forge. Create a foundry.toml
file in your project root:
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
optimizer = true
optimizer_runs = 200
[rpc_endpoints]
fluent = <rpc-url>
- WASM Support: Native support for WASM contract compilation and deployment
- Enhanced Verification:
--wasm
flag for verifying WASM contracts - Custom REVM: Support for the fluentbase REVM implementation.
For complete documentation on forge commands, see the Foundry Book.
For Fluent-specific development guides, visit Fluent Documentation.
Contributions are welcome! Please see our contributing guidelines.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Note: gblend is built on top of Foundry forge and maintains full compatibility with existing forge projects while adding Fluent Network and WASM-specific enhancements.