Solidity Developer Guide

Prerequisites

Before getting started, make sure to install the following:


Install Fluent Scaffold CLI Tool

To install the Fluent scaffold CLI tool, run the following command in your terminal:

cargo install gblend

To create a project, run the following in your terminal:

gblend init

This will prompt you to choose from the available setup options. You can opt for either Hardhat, JavaScript or TypeScript; in this guide, we'll proceed with JavaScript.

Project Structure

.
├── contracts
│   ├── hello.sol (our solidity hello world smart contract)
│   └── hello-v.vy 
├── hardhat.config.js (contains Fluent devnet config and plugins)
├── package.json
└── scripts
    ├── deploy-solidity.js (deployment script for solidity smart contract)
    └── deploy-vyper.js

Getting Started

Before we interact with our helloworld smart contract, run the below command to install all dependencies in the package.json file.

Hardhat Configs

To first get a quick sense of Fluent's network parameters, head over to the hardhat.config.js file in the root directory.

You will find the configuration for connecting to the Fluent Devnet.

Within the networks object, you can see the fluent_devnet1 configuration. This specifies the URL to connect to the Fluent Devnet, along with the chain ID and the accounts available for transactions.

Use Fluent Faucetarrow-up-right to request test tokens.

Next, let's explore how you can compile and deploy your first smart contract to the Fluent Devnet.

Compiling the Smart Contract

If you take a look in the contracts/ folder, you'll see hello.sol file:

To compile it, simply run:

Deploying the Solidity contract

In the scripts folder is the deployment script deploy-solidity.js:

To deploy the compiled solidity smart contract, run:

To view your deployed contract on Fluent, navigate to the Fluent Devnet Explorerarrow-up-right. From there, you can input your token address to explore your deployed contract.

Last updated