KYOTO DEVELOPER DOCUMENTATION
  • πŸ—οΈBuild on KYOTO
    • KYOTO Testnet Token
    • Network Details
    • Developer Tools
    • Metamask Wallet
    • Build
      • With Hardhat
      • With Truffle
      • With Remix
      • With thirdweb
    • Transactions
    • Connecting and interacting via Ethers.js
    • How to verify a smart contract?
    • Smart Contract Best Practices
    • KYOTO for Ethereum Developers
Powered by GitBook
On this page
  • Introduction
  • Create Hardhat Project​
  • Deploy
  • View ​
  1. Build on KYOTO
  2. Build

With Hardhat

How to deploy a smart contract to the KYOTO network using Hardhat.

PreviousBuildNextWith Truffle

Last updated 1 year ago

Introduction

Hardhat is a comprehensive Ethereum software development environment that comprises various components for editing, compiling, debugging, and deploying smart contracts and decentralized applications (dApps). Together, these components form a complete development environment for Ethereum and Kyoto projects.

The central component of Hardhat is the Hardhat Runner. As the primary interface for interacting with Hardhat, it serves as a versatile and customizable task runner. With the Hardhat Runner, you can efficiently handle tasks such as compiling contracts, running tests, deploying contracts to networks, and much more. It offers flexibility and extensibility, allowing you to adapt and extend its functionality based on your specific project requirements.

Using Ganache CLI creates test accounts at the localhost on port 7545. The private network setup connects to your localhost on this port and gives you access to your accounts on ganache-cli.

    localhost: {
      url: "http://127.0.0.1:7545"
    },

Connect to Testnet

   kyototestnet: {
     url: "https://*rpc address to be added*/",
      accounts: [privateKey1, privateKey2, ...]
     },
     chainId: 1998
   }

Connect to Mainnet

   kyotoprotocol: {
     url: "https://*rpc address to be added*/",
      accounts: [privateKey1, privateKey2, ...]
     },
     chainId: 1999
   }

Deploy

Run the following command from your root project directory to deploy to KYOTO testnet.

npx hardhat run scripts/sample-script.js --network name

...or run this command to deploy to Kyoto mainnet.

npx hardhat run scripts/sample-script.js --network name

Copy the contract address from the terminal and access the block explorer (link TBA) to locate your deployed contract. Use the network dropdown menu near the search bar to switch between networks and locate your contract.

Create Hardhat Project

To deploy on KYOTO, follow the to build and deploy your smart contract.

Connect to Local Network

View

πŸ—οΈ
​
installation instructions and quickstart
​
​