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
gblendusinggblendup
gblendup
This will automatically download precompiled binaries for your platform or build from source if needed.
After installation, verify gblend is working:
gblend --versionTo 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 | bashgblend 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:
You can find additional setup and configurations guides in the Foundry Docs and in the config crate:
Profiles and Namespaces
[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:
--wasmflag 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.
Having trouble? See if the answer to your question can be found in the Foundry Docs.
If the answer is not there:
- Join the [support Telegram][tg-support-url] to get help, or
- Open an issue with the bug
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
- Foundry is a clean-room rewrite of the testing framework DappTools. None of this would have been possible without the DappHub team's work over the years.
- Matthias Seitz: Created ethers-solc (now foundry-compilers) which is the backbone of our compilation pipeline, as well as countless contributions to ethers, in particular the
abigenmacros. - Rohit Narurkar: Created the Rust Solidity version manager svm-rs which we use to auto-detect and manage multiple Solidity versions.
- Brock Elmore: For extending the VM's cheatcodes and implementing structured call tracing, a critical feature for debugging smart contract calls.
- Thank you to Depot for sponsoring us with their fast GitHub runners and sccache, which we use in CI to reduce build and test times significantly.
- All the other contributors to the ethers-rs, alloy & foundry repositories and chatrooms.
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.