docs
  • About RACE™ Chain
  • Using RACE™ Chain
  • How RACE™ Chain Works
    • Fraud Proof
    • Fault Proof Program
      • Prologue
      • Main Content
      • Epilogue
    • Fault Proof VM
  • BUILDING ON RACE™
    • Network Information
    • QuickNode Integration
    • RACE™ Contracts
    • Fees
    • Differences between Ethereum and RACE™
  • GUIDES
    • Deploying a Smart Contract
      • Using Hardhat
      • Using Remix
  • TOOLS
    • Block Explorer
    • Network Faucets
  • Bridge
    • Testnet
  • CLIENTS
    • web3.js
    • ethers.js
  • Tokens
Powered by GitBook
On this page
  • Verifying the Smart Contract​
  • Interacting with the Smart Contract​
  1. GUIDES
  2. Deploying a Smart Contract

Using Hardhat

Deploying a Smart Contract using Hardhat

INFO

If you'd like to deploy to mainnet, you'll modify the command like so:

npx hardhat run scripts/deploy.ts --network race-mainnet

Regardless of the network you're deploying to, if you're deploying a new or modified contract, you'll need to verify it first.


Verifying the Smart Contract​

If you want to interact with your contract on the block explorer, you, or someone, need to verify it first. The above contract has already been verified, so you should be able to view your version on a block explorer already. For the remainder of this guide, we'll walk through how to verify your contract on the RACE™ Goerli testnet.

In hardhat.config.ts, configure RACE™ Goerli as a custom network. Add the following to your HardhatUserConfig:

  • RACEscan

etherscan: {
   apiKey: {
    "race-sepolia": "PLACEHOLDER_STRING"
   },
   customChains: [
     {
       network: "race-sepolia",
       chainId: 8900,
       urls: {
        apiURL: "https://testnet.racescan.io/api",
        browserURL: "
        https://testnet.racescan.io/"
       }
     }
   ]
 },

INFO

When verifying a contract with RACEscan on testnet (Sepolia), an API key is not required. You can leave the value as PLACEHOLDER_STRING.

npx hardhat verify --network race-sepolia <deployed address>

Interacting with the Smart Contract​

If you verified on RACEscan, you can use the Read Contract and Write Contract tabs to interact with the deployed contract. You'll need to connect your wallet first, by clicking the Connect button.

PreviousDeploying a Smart ContractNextUsing Remix

Last updated 1 year ago