Deployment
Step 1: Install Hardhat.
npm install -g hardhatStep 2: Create Example smart contract project.
mkdir example-project
cd example-project
npx hardhat initStep 3: Make .env and input your private key.
PRIVATE_KEY=<your_private_key>Step 4: Install dotenv module.
npm install dotenvStep 5: Import environmental variables to hardhat.config.js.
require('dotenv').config()
const private_key = process.env.PRIVATE_KEYStep 6: Establish endpoint settings.
By default, the script will be using your local host "127.0.0.1" - If you are not running a localhost, you may leverage the public endpoint https://testnet.cascadia.foundation/ by making changes to networks in hardhat-config.js, for example:
The total result code in hardhat.config.js is the following:
Step 7: Deploy Contract.
Step 8: Obtain contract address from console.
Step 9: Confirm successful deployment on Cascadia's block explorer.
Type your deployed contract address into the block explorer search bar or https://explorer.cascadia.foundation/address/<your_contract_deployed_address> to confirm successful deployment.
Last updated