Skip to main content

Deploy your first contract

Use this tutorial to deploy a simple Solidity contract to TeQoin with Hardhat. It is the fastest path from an empty folder to a working onchain contract.

Before you start

You need:
  • Node.js 20 or later
  • A wallet with test ETH
  • Access to the TeQoin RPC endpoint: https://rpc.teqoin.io
  • Chain ID 420377
If you still need funds, use the guidance in /resources/faucet.

Step 1: Create a Hardhat project

Choose a basic JavaScript project when Hardhat prompts you.

Step 2: Add your wallet key

Create a .env file:
Add .env to .gitignore before you continue.

Step 3: Configure the TeQoin network

Update hardhat.config.js:

Step 4: Write a simple contract

Create contracts/Counter.sol:

Step 5: Compile

Hardhat should generate artifacts without errors.

Step 6: Create the deploy script

Create scripts/deploy.js:

Step 7: Deploy to TeQoin

Save the contract address from the terminal output. You will use it in your app and verification workflow.

Step 8: Confirm the deployment

Use cast or a quick script to call the contract:
You should get 0 back from the first read.

Next steps