Conflux Network Documentation
website·Indexed 30 days ago
https://conflux-documentation-phi.vercel.app/Documentation for Conflux, a scalable blockchain platform designed for high throughput and security. Includes guides on running a node, smart contract development, gas optimization, and security auditing. Features detailed technical references for eSpace, including JSON-RPC endpoints (such as eth_getBalance and eth_getBlockByNumber), WalletConnect integration with Next.js, and tutorials for upgradable contracts using Foundry and Hardhat.
What's inside Conflux
- Conflux is a public blockchain designed for high performance, security, and decentralization. It utilizes a unique consensus mechanism and an innovative dual-space design to support scalable applications such as decentralized finance (DeFi) and gaming.
Overview of Aave v3 Key Features
Aave v3 is a decentralized non-custodial liquidity protocol with several key enhancements over previous versions:
- Portal: Uses LayerZero to enable seamless asset transfers between different Aave v3 markets across networks, allowing users to bridge liquidity while maintaining borrowing positions.
- Efficiency Mode (eMode): Increases capital efficiency (up to 97% LTV) for correlated assets by creating specialized lending markets (e.g., stablecoins or ETH/stETH).
- Risk Management: Includes Isolation Mode to limit risk for new assets, Supply/Borrow Caps for protocol-wide asset limits, Siloed Borrowing, and specialized Risk Admin roles for faster parameter updates.
- Gas Optimization: Reduces gas costs by up to 25% compared to v2, specifically optimized for L2 networks and sidechains.
Overview of Fluent Wallet for Conflux Network
Fluent is a specialized web3 wallet for the Conflux Network that allows users to manage CFX and ERC-20 tokens and interact with dApps. It provides native support for both the Conflux Core and eSpace environments.Overview of Conflux Core Space Sponsorship Mechanism
The sponsorship mechanism allows smart contracts to have their transaction fees (gas and storage collateral) paid by a sponsor (e.g., a Dapp operator) instead of the end-user. This enables accounts with zero balance to interact with sponsored contracts.
Key constraints:
- Only smart contracts can be sponsored; regular account-to-account CFX transfers cannot be sponsored.
- Gas and storage collateral can be sponsored by different entities.
- Sponsorship benefits are restricted to addresses on a whitelist unless the zero address is whitelisted.
Overview of Graph Node components and dependencies
Graph Node is the reference implementation for indexing Subgraphs on The Graph Network. It indexes data from blockchain clients and makes it available via a GraphQL API. It relies on three primary external components:
- PostgreSQL Database: The primary store for subgraph data, subgraph metadata, and network data (e.g., block cache and eth_call cache).
- Network Clients: An EVM-compatible JSON-RPC API. Standard subgraphs require a full node; however, subgraphs using
eth_callsrequire an archive node supporting EIP-1898, and those usingcallHandlersorblockHandlerswith acallfilter requiretrace_filtersupport. - IPFS Nodes: Used during subgraph deployment to fetch manifests and linked files. Network indexers can use the hosted node at
https://ipfs.network.thegraph.com.
Overview of Solidity for Smart Contract Development
Solidity is a statically typed, high-level programming language used to implement smart contracts on blockchain platforms such as the Conflux Network and Ethereum. Its syntax is similar to JavaScript and it supports inheritance, libraries, and complex user-defined types.
Key concepts include:
- Smart Contracts: Collections of code and data residing at a specific blockchain address that define rules and execute functions automatically.
- Variables and Types: Supports basic types (integers, booleans, strings) and complex types (arrays, structs).
- Functions and Modifiers: Functions are the executable units; modifiers are used to alter function behavior, typically for access control.
- Inheritance and Libraries: Contracts can inherit properties from others, and libraries provide reusable, independently deployable code.
- Gas: The fee required for executing operations on the blockchain; code optimization is necessary to minimize these costs.
- Deployment: Once tested, contracts are deployed to the blockchain where they can be called by users or interact with other contracts.
Overview of Web3 Paywall on Conflux eSpace
Web3 Paywall is a set of smart contracts on Conflux eSpace that allows consumers to purchase development resources using cryptocurrency.Overview of Conflux Network Spaces (Core Space vs eSpace)
Conflux provides two primary environments for developers: Core Space and eSpace. Both support JSON-RPC connectivity via public network endpoints and have dedicated SDKs and toolchains for building web3 applications. Key setup steps for both include wallet installation and utilizing testnet faucets.Overview of Oracles in Conflux
Oracles serve as a critical bridge that allows smart contracts on the blockchain to access and utilize data from off-chain sources.Overview of use-wallet library
use-wallet is a lightweight front-end wallet hooks library designed for decentralized application (DApp) development. It encapsulates wallet injection in the window provider, offering a simpler alternative to comprehensive libraries like js-conflux-sdk or web3.js for basic wallet interactions.
Key features include:
- Broad Support: Compatible with React and Vue3 frameworks; supports Conflux and Ethereum chains; supports Portal, Fluent, MetaMask, MetaX, and Coinbase wallets.
- Performance: Provides fine-grained hooks to prevent unnecessary duplicate renders.
- Lightweight: Small footprint (3.7kb gzip, 20kb including decimal.js).
Overview of Conflux Network Core Concepts
The Conflux Network utilizes a dual-space ecosystem (Spaces) to integrate Conflux-format and Ethereum-format transactions. It employs a hybrid PoW-PoS consensus mechanism, utilizing the TreeGraph blockchain structure and the GHAST algorithm for its Proof of Work component. The network's economic model is centered around the native token, CFX.Overview of Conflux eSpace EVM Compatibility
Conflux eSpace is a fully EVM-compatible space (chain) of Conflux that operates independently from the Conflux Core space. It is designed to provide significantly lower gas fees and higher transactions per second (TPS) than Ethereum. Because of its EVM compatibility, Ethereum dApps can be deployed to eSpace without modification. It supports all standard Ethereum development tools, SDKs, wallets, and services, including:
- Development Tools: Remix, Hardhat, Foundry
- SDKs: ethers.js, viem, web3.py
- Wallets: MetaMask, Taho
- Services: TheGraph