badge-checkVerify & Publish Contract ( Hardhat )

This guide explains how to verify and publish a deployed contract on SATUCHAIN Testnet Explorer using Hardhat. Explorer API: https://testnet.satuchain.com/apiarrow-up-right


Prerequisites

You need:

  • Contract deployed on SATUCHAIN Testnet

  • Contract address

  • Matching compiler settings (solc version, optimizer, runs, viaIR, evmVersion)

  • Node.js project with Hardhat

SATUCHAIN Testnet:


1) Install Hardhat Verify Plugin

If you use @nomicfoundation/hardhat-toolbox, you already have the verify task. Otherwise install:

npm i -D @nomicfoundation/hardhat-verify dotenv

2) Configure Hardhat Network

In hardhat.config.js:

Create .env:

If SATUCHAIN later requires a real key, replace the placeholder value.


3) Deploy (Example)

Copy the deployed contract address from the output.


4) Verify (No Constructor Args)

Example:


5) Verify (With Constructor Args)

If your contract constructor has parameters:

Example:

If you pass an address:


6) Confirm on Explorer

Open: https://testnet.satuchain.com/address/arrow-up-right<CONTRACT_ADDRESS>

You should see the contract marked as Verified with:

  • Source code

  • ABI

  • Read/Write tabs


Troubleshooting

“Contract source code already verified”

The contract is already verified; nothing else needed.

“Bytecode does not match”

Most common causes:

  • Wrong Solidity version

  • Optimizer settings mismatch (enabled/runs)

  • viaIR mismatch

  • evmVersion mismatch (e.g. paris)

  • You deployed a different build artifact than the one you are verifying

“Missing API Key” / “Invalid API Key”

If SATUCHAIN requires a real key, set SATU_EXPLORER_API_KEY to the correct value. If it does not, keep a placeholder as shown.


Last updated