This is a blended Solidity + WASM example project.
src/FluentSolRustTypesTest.sol
- Main Solidity contractsrc/rust-types-test/
- Rust WASM module for some simple interoperable call testingtest/
- Forge testsscript/
- Deployment scripts
gblend build
gblend test
Note that you'll need to add your private key as environment variable:
cp .example.env .env
# Edit .env and replace "YourPrivate Key Here" with your actual private key
source .env
Deploy the Rust contract:
gblend create RustEvmTypes.wasm \
--rpc-url https://rpc.testnet.fluent.xyz \
--private-key $PRIVATE_KEY \
--broadcast \
--verify \
--wasm \
--verifier blockscout \
--verifier-url https://testnet.fluentscan.xyz/api/
Grab the deployment address from the terminal and save it for next steps...
and the Solidity contract:
gblend create src/FluentEvmRustTypes.sol:FluentEvmRustTypes \
--constructor-args-path src/solidityConstructor/FluentEvmRustTypes.txt \
--rpc-url https://rpc.testnet.fluent.xyz \
--private-key $PRIVATE_KEY \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url https://testnet.fluentscan.xyz/api/
Verification should have happened as well as part of the command.
Add the contract addresses for the deployed Solidity and Rust contracts, to respectively the js-client/solidity.js
and js-client/rust.js
scripts.
Then run:
# From project root:
node js-client/solidity.js
to test the values calling from the Solidity contract, and run:
# From project root:
node js-client/rust.js
to call them directly from the Rust contract.
You've deployed and tested a simple blended application onto the Fluent Network.