Saltar al contenido principal

Developer Quickstart

With Conflux eSpace, your favorite tools for building and testing smart contracts just work.

Since eSpace is EVM-Compatible, you’ll just need to point your favorite builder tools at a Conflux eSpace RPC Provider.

If you are not familiar with Ethereum development, you can start by learning the basics and understanding its stack through Ethereum's official documentation

Acquiring CFX

eSpace also uses CFX as its native currency, which will be needed to pay transaction fees for deploying and interacting with the network.

To start building on eSpace, we suggest you begin with using eSpace testnet. You'll first need to acquire some testnet CFX through faucet.

Once you're ready to deploy on eSpace's mainnet, if you only have Core CFX, you can bridge over CFX from Core Space using our space bridge.

Network Configuration

eSpace Mainnet

Use the table below to configure your Ethereum tools to the eSpace mainnet.

Network NameConflux eSpace
Chain ID1030
Currency SymbolCFX
Block Explorer URL

eSpace Testnet

Use the table below to configure your Ethereum tools to the eSpace Testnet.

Network NameConflux eSpace Testnet
Chain ID71
Currency SymbolCFX
Block Explorer URL

Configure your tooling

For setting up tooling to verify a smart contract deployment, see Verifying Smart Contracts.


Modify your Hardhat config file hardhat.config.ts to point at the eSpace Testnet public RPC.


const config: HardhatUserConfig = {
networks: {
eSpaceTestnet: {
url: "" || "",
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],


A complete workflow for using Hardhat deploy contract is shown here


To deploy using the eSpace Testnet Public RPC, run:

forge create ... --rpc-url= --legacy

A complete workflow for using foundry deploy contract is shown here

Remix Web IDE

After compiling your contracts, the easiest way to deploy using Remix is by setting up Metamask, then selecting the Conflux eSpace Testnet network.

Now, in the “Deploy and Run Transactions” tab, use the “Environment” drop-down and select “Injected Provider - MetaMask.”

Connect your wallet and select the Conflux eSpace Testnet. Your account should be selected automatically in Remix, and you can click “Deploy.” A complete workflow for Remix usage is shown here


It is recommended to create virtual environments before using to avoid dependency conflicts, for example, by using venv or conda. is one of the most widely used Python interfaces for interacting with the Ethereum blockchain and ecosystem. It can be installed using the command:

pip install web3 # or pip3 install web3 can also be used to interact with Conflux eSpace. The example code below shows how to connect to the Conflux eSpace testnet endpoint and check the connection:

>>> from web3 import Web3
>>> w3 = Web3(Web3.HTTPProvider(""))
>>> w3.is_connected()
True # should return True

It should be noted that the latest version of populates maxFeePerGas and maxPriorityFeePerGas for transactions by default, while Conflux eSpace only supports the legacy transaction type prior to EIP-1559. Therefore, developers need to specify the gas_price field in transactions or use the gas price API.

from web3 import Web3
from web3.middleware.signing import construct_sign_and_send_raw_middleware
from web3.gas_strategies.rpc import rpc_gas_price_strategy

w3 = Web3(Web3.HTTPProvider(""))
assert w3.is_connected()
acct = w3.eth.account.from_key("xxxxxx") # your secret key

w3.eth.default_account = acct.address

# Set gas price strategy

w3.eth.send_transaction({"from": acct.address, "value": 0, "to": acct.address})


Brownie is a Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine. To add the Conflux eSpace networks to Brownie, run the following command:

brownie networks add "Conflux eSpace" conflux-espace-main name=Mainnet host= explorer= chainid=1030
brownie networks add "Conflux eSpace" conflux-espace-test name=Testnet host= explorer= chainid=71

To deploy on eSpace, specify the Conflux network by using the --network option.

brownie run scripts/ --network conflux-espace-test

The scripts/ is the Brownie script you want to run on Conflux eSpace. In our Brownie tutorial, we show the complete workflow of how to configure a template Brownie project and how to run Brownie scripts on Conflux eSpace.


Setting up a eSpace Testnet provider in an ethers script:

import { ethers } from "ethers"

const provider = new ethers.providers.JsonRpcProvider("")


Scaffold Conflux is an adaptation of Scaffold-ETH-2.

  • We have adjusted the template to allow you to deploy the contract on Conflux eSpace.
  • Conflux Scaffold offers users the ability to quickly leverage front-end react components that are commonly used to build web3 apps. These include pre-fabricated wallets with the ability to connect to Conflux eSpace, Conflux eSpace testnet, hardhat, etc. It also includes other components to display balance, and recieve address/value inputs.
  • Hooks are available on Scaffold Conflux to interact with the smart contracts built on hardhat. This simplifies the process of reading contracts, writing contracts, and subscribe to events emitted by the smart contract.
  • You can visit our tutorial for more in-depth discussion how to set-up Scaffold Conflux and use some of the hooks/components.

To deploy to Conflux eSpace using Scaffold-eth-2 (hardhat), specify the Conflux eSpace network when deploying.

yarn deploy --network confluxESpace

The deployer of the contract and thereby the owner of the contract can be changed by re-labelling the ./packages/hardhat/.env.example to ./packages/hardhat/.env and putting your private key in DEPLOYER_PRIVATE_KEY=. However, the default uses a default "public" private key for hardhat testing purposes.

Configure the Frontend Wallet

To configure your frontend, you will need to change the default wallet connection to Conflux eSpace. Currently it is set up to connect to hardhat which allows you to use default burner wallets. Changing the below allows the wallet to switch to Conflux eSpace.

To add the network, modify packages/nextjs/scaffold.config.ts

Change from

const scaffoldConfig = {
targetNetworks: [chains.hardhat],


const scaffoldConfig = {
targetNetworks: [chains.confluxESpace],

Deploy onto Vercel

Preview the app. You should be able to connect to Conflux eSpace through your wallet.

nvm use 18
yarn start

Once you are ready to deploy your app, simply run the following command.

yarn vercel