Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fuseio/fuse-docs/llms.txt

Use this file to discover all available pages before exploring further.

Fuse is fully EVM-compatible, which means any Solidity contract that runs on Ethereum compiles and deploys on Fuse without modification. You can use the same tools, the same ABIs, and the same patterns you already know. The only changes are the RPC endpoint and chain ID in your deployment config.

Development tools

Remix

Browser-based IDE for writing, compiling, and deploying contracts without any local setup.

Hardhat

Full-featured local development environment with Ignition deployments, testing, and a plugin ecosystem.

Thirdweb

CLI and dashboard-based deployment that requires no RPC configuration or private key exposure.

Core network contracts

The following contracts govern consensus, rewards, and on-chain governance on Fuse Mainnet.

Supra Oracle contracts

Supra provides on-chain price feeds on Fuse. The following contracts are deployed on Fuse Mainnet.

Deploy with Hardhat

Hardhat is the recommended tool for teams who want a full local development workflow with testing, compilation, and scripted deployments. The steps below deploy an ERC-20 token contract to Fuse.

1. Scaffold the project

mkdir hardhat-fuse-guide && cd hardhat-fuse-guide
npm init -y
npx hardhat init
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox

2. Write the contract

Create contracts/Token.sol:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts@4.0.0/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.0.0/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts@4.0.0/access/Ownable.sol";

contract MyToken is ERC20, ERC20Burnable, Ownable {
    constructor(address initialOwner)
        ERC20("MyToken", "MTK")
        Ownable()
    {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}

3. Create the Ignition deployment module

Create ignition/modules/deploy.js:
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");

const Token = buildModule("Token", (m) => {
  const contract = m.contract("Token");
  return { contract };
});

module.exports = Token;

4. Configure Fuse networks

Add the Fuse network details to hardhat.config.js:
module.exports = {
  // ...
  networks: {
    fuse: {
      url: "https://rpc.fuse.io/",
      accounts: [`0xPRIVATE_KEY`], // deployer private key
    },
    spark: {
      url: "https://rpc.fusespark.io/",
      accounts: [`0xPRIVATE_KEY`], // deployer private key
    },
  },
  // ...
};
Never commit private keys to version control. Use environment variables or a .env file excluded from git. The deployer account must hold FUSE tokens to pay the deployment gas fee.

5. Compile and deploy

Compile the contract:
npx hardhat compile
Deploy to Fuse Mainnet:
npx hardhat ignition deploy ./ignition/modules/deploy.js --network fuse
Or to Sparknet testnet:
npx hardhat ignition deploy ./ignition/modules/deploy.js --network spark

Deploy with Remix

Remix requires no local setup. Navigate to remix-project.org, create a Token.sol file, paste your contract code, and compile it using compiler version 0.8.0. To deploy to Fuse:
  1. Go to the Deploy tab in Remix.
  2. In the Environment dropdown, select Injected Provider.
  3. Connect MetaMask and ensure it is set to the Fuse Mainnet (Chain ID 122) or Sparknet (Chain ID 123).
  4. Click Deploy and approve the MetaMask transaction.
After deployment, copy the transaction hash and look it up on the Fuse Explorer to confirm the contract address.

Deploy with Thirdweb

Thirdweb lets you deploy contracts without configuring RPC endpoints or exposing private keys. Run the following in your project directory:
npx thirdweb deploy
Thirdweb compiles all contracts in the current directory, prompts you to select which to deploy, uploads the ABI to IPFS, and opens a browser dashboard. In the dashboard, select Fuse as the target network and fill in the constructor parameters. For pre-built contracts (ERC-20, ERC-721, marketplace), browse the Thirdweb Explore page and deploy directly from there.

Verify a contract on the Fuse Explorer

Contract verification makes your source code publicly readable on the explorer and enables interactions directly from the browser. Add the following etherscan block to hardhat.config.js:
etherscan: {
  apiKey: {
    fuse: "YOUR_KEY_IF_YOU_HAVE_ONE",
    spark: "YOUR_KEY_IF_YOU_HAVE_ONE"
  },
  customChains: [
    {
      network: "fuse",
      chainId: 122,
      urls: {
        apiURL: "https://explorer.fuse.io/api",
        browserURL: "https://explorer.fuse.io"
      }
    },
    {
      network: "spark",
      chainId: 123,
      urls: {
        apiURL: "https://explorer.fusespark.io/api",
        browserURL: "https://explorer.fusespark.io"
      }
    }
  ]
}
Then run:
npx hardhat verify --network fuse DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"
The Fuse Explorer is powered by Blockscout. The hardhat-etherscan plugin is compatible with Blockscout, which is why the plugin name references etherscan despite verifying on a different explorer.

Interact with deployed contracts using FuseBox

Once deployed, the recommended way to connect your contract to a frontend or backend is through the FuseBox SDK. FuseBox wraps contract interactions in ERC-4337 UserOperations, handles gas sponsorship via Paymaster, and removes the need to manage ABIs directly for common operations like token transfers. See the FuseBox SDK overview for the full API reference.

Build docs developers (and LLMs) love