Autheo Chain is EVM-compatible — Mainnet chain ID 2127, Testnet chain ID 785 — which means any Hardhat, Foundry, or ethers.js project can target it with minimal configuration. This page shows the minimum setup for each major toolchain.
Hardhat
Create a new project
mkdir my-autheo-project && cd my-autheo-project
npm init -y
npm install --save-dev hardhat
npx hardhat init
Select Create a JavaScript project (or TypeScript).Install dependencies
npm install --save-dev @nomicfoundation/hardhat-toolbox dotenv
Configure hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
module.exports = {
solidity: {
version: "0.8.20",
settings: { evmVersion: "paris" }
},
networks: {
autheoMainnet: {
url: "https://rpc1.autheo.com",
chainId: 2127,
accounts: [process.env.PRIVATE_KEY]
},
autheoTestnet: {
url: "https://testnet-rpc1.autheo.com",
chainId: 785,
accounts: [process.env.PRIVATE_KEY]
}
}
};
Create a .env file
echo "PRIVATE_KEY=0x<your-private-key>" > .env
Never commit your .env file to version control. Add it to .gitignore.
Deploy
# Deploy to mainnet
npx hardhat run scripts/deploy.js --network autheoMainnet
# Deploy to testnet
npx hardhat run scripts/deploy.js --network autheoTestnet
Foundry
Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
Create a new project
forge init my-autheo-project && cd my-autheo-project
Configure foundry.toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
evm_version = "paris"
[rpc_endpoints]
autheo_mainnet = "https://rpc1.autheo.com"
autheo_testnet = "https://testnet-rpc1.autheo.com"
Deploy
# Deploy to mainnet
forge create src/MyContract.sol:MyContract \
--rpc-url autheo_mainnet \
--private-key $PRIVATE_KEY \
--broadcast
# Deploy to testnet
forge create src/MyContract.sol:MyContract \
--rpc-url autheo_testnet \
--private-key $PRIVATE_KEY \
--broadcast
Bare ethers.js
For scripts or backend services that don’t need a full framework:
import { ethers } from "ethers";
import * as dotenv from "dotenv";
dotenv.config();
const provider = new ethers.JsonRpcProvider("https://rpc1.autheo.com");
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
// Deploy a contract
const factory = new ethers.ContractFactory(abi, bytecode, wallet);
const contract = await factory.deploy();
await contract.waitForDeployment();
console.log("Deployed at:", await contract.getAddress());
EVM version note
Always set the EVM version to paris (or earlier) when compiling contracts for Autheo Chain. Using shanghai or later may produce opcodes not yet supported by the chain’s EVM configuration.
Next steps