Calix Chain

Deploy Contract

Guide to deploying Solidity contracts to Calix Chain using Hardhat and Foundry.

Hardhat

1
Install
npm init -y && npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npx hardhat init  # select "Create a JavaScript project"
2
Configure hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

module.exports = {
  solidity: "0.8.24",
  networks: {
    calix: {
      url: "https://calixchain.io/rpc",
      chainId: 999,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};
3
Write deploy script scripts/deploy.js
const { ethers } = require("hardhat");

async function main() {
  const [deployer] = await ethers.getSigners();
  console.log("Deploying from:", deployer.address);

  const Token = await ethers.getContractFactory("MyToken");
  const token = await Token.deploy(ethers.parseUnits("1000000", 18));
  await token.waitForDeployment();

  console.log("Token deployed to:", await token.getAddress());
}

main().catch(console.error);
4
Deploy
PRIVATE_KEY=0x... npx hardhat run scripts/deploy.js --network calix

Foundry

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash && foundryup

# Create project
forge init my-project && cd my-project

# Deploy
forge create src/MyToken.sol:MyToken \
  --rpc-url https://calixchain.io/rpc \
  --private-key $PRIVATE_KEY \
  --constructor-args 1000000000000000000000000

# Verify (if verifier is available)
forge verify-contract <ADDRESS> src/MyToken.sol:MyToken \
  --rpc-url https://calixchain.io/rpc

Gas and transaction fees

Transaction typeEstimated gas
CLX transfer21,000
CLX20 transfer~50,000
CLX20 approve~45,000
Simple ERC-20 deploy~700,000
DEX swap~150,000