Skip to content

fluentlabs-xyz/blended-template-foundry-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blended Template

This is a blended Solidity + WASM example project.

Project Structure

  • src/FluentSolRustTypesTest.sol - Main Solidity contract
  • src/rust-types-test/ - Rust WASM module for some simple interoperable call testing
  • test/ - Forge tests
  • script/ - Deployment scripts

Usage

Build

gblend build

Test

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

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.

Interact with Contracts from Client

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.

That's a wrap!

You've deployed and tested a simple blended application onto the Fluent Network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages