0xn1c0 / conflux-devkit-hhv

Conflux DevKit-based Hardhat-ignition-viem Development Environment for building and deploying smart contracts on the Conflux blockchain.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflux DevKit HardHat Ignition Viem

Description

This project extends Hardhat's viem sample project with Hardhat Ignition for Conflux eSpace and js-conflux-sdk for Conflux Core.

Table of Contents

Installation

To install the package, use npm:

npm install

Usage

Local Chain

First, start the local network with the following command:

npm run chain

This will start the local Conflux node and fund the genesis accounts. The Hardhat config will use the first account (0) as the default deployer. Once the chain is running, you can open another terminal and use the following commands:

genesis_list

This command will list the available genesis addresses.

genesis_espace

This command will transfer 1000 CFX to the eSpace addresses to enable local code deployment. Since the chain saves the blocks, these commands are only needed once until all the funds are spent or the Docker image is rebuilt.

For more details, refer to the Conflux Devkit README.

Once the accounts are funded and the chain is running, you can invoke the deployment examples with the following commands:

Deploy to eSpace

npm run deploy_espace

This will use LockModule.ts with Ignition to deploy the contract on the local eSpace.

Deploy to Core

npm run deploy_core

This will use LockDeploy_Core.ts with js-conflux-sdk to deploy on the local Core.

About

Conflux DevKit-based Hardhat-ignition-viem Development Environment for building and deploying smart contracts on the Conflux blockchain.

License:MIT License


Languages

Language:JavaScript 43.6%Language:TypeScript 35.2%Language:Dockerfile 16.8%Language:Solidity 3.4%Language:Shell 1.0%