With Hardhat

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

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.

Create Hardhat Project

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

Connect to Local Network

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

View

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.

Last updated