> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autheo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project scaffolding

> Set up a new smart contract or dApp project for Autheo Chain using Hardhat, Foundry, or a bare ethers.js setup.

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

<Steps>
  <Step title="Create a new project">
    ```bash theme={null}
    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).
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    npm install --save-dev @nomicfoundation/hardhat-toolbox dotenv
    ```
  </Step>

  <Step title="Configure hardhat.config.js">
    ```javascript theme={null}
    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]
        }
      }
    };
    ```
  </Step>

  <Step title="Create a .env file">
    ```bash theme={null}
    echo "PRIVATE_KEY=0x<your-private-key>" > .env
    ```

    <Warning>Never commit your `.env` file to version control. Add it to `.gitignore`.</Warning>
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    # Deploy to mainnet
    npx hardhat run scripts/deploy.js --network autheoMainnet

    # Deploy to testnet
    npx hardhat run scripts/deploy.js --network autheoTestnet
    ```
  </Step>
</Steps>

## Foundry

<Steps>
  <Step title="Install Foundry">
    ```bash theme={null}
    curl -L https://foundry.paradigm.xyz | bash
    foundryup
    ```
  </Step>

  <Step title="Create a new project">
    ```bash theme={null}
    forge init my-autheo-project && cd my-autheo-project
    ```
  </Step>

  <Step title="Configure foundry.toml">
    ```toml theme={null}
    [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"
    ```
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    # 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
    ```
  </Step>
</Steps>

## Bare ethers.js

For scripts or backend services that don't need a full framework:

```javascript theme={null}
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

<Warning>
  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.
</Warning>

## Next steps

* [Deploy a smart contract](/developers/tutorials/deploy-smart-contract) — step-by-step Remix tutorial
* [Gas fees and transaction lifecycle](/developers/guides/gas-fees-and-tx-lifecycle) — understand fee estimation
* [Deployment checklist](/developers/guides/deployment-checklist) — pre-mainnet verification
