Skip to content

Satyadeepsb/hardhat-events-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat-Events-Logs

This project demonstrates how to work with events in hardhat. In the deploy_and_store script, you'll see the output of the events.

Requirements

  • nodejs
    • You can test it's installed by running node --version
  • yarn
    • You can test it's installed by running yarn --version
  • git
    • You can test it's installed by running git --version

Installation

Clone this repo & install dependencies

git clone https://github.com/PatrickAlphaC/hardhat-events-logs
cd hardhat-events-logs
yarn

Quickstart

Run:

npx hardhat run scripts/deploy_and_store.js

This will print out the events from our smart contracts.

Testnet (Goerli) Deployment

To deploy to a testnet, you'll need.

  1. A Blockchain wallet
  2. Testnet Goerli ETH in your Blockchain Wallet.
  3. An alchemy RPC URL
  4. An Etherscan API Key

Then, create a .env file and add the following lines:

ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
GOERLI_RPC_URL=https://eth-ropsten.alchemyapi.io/v2/<YOUR ALCHEMY KEY>
PRIVATE_KEY=YOUR_BLOCKCHAIN_WALLET_PRIVATE_KEY

DO NOT PUSH YOUR PRIVATE_KEY TO GITHUB. Please test and develop with a private key that doesn't have any real money in it.

Follow the basics tutorial to learn how to get everything setup.

Then, run:

hh run scripts/deploy_and_store.js --network kovan

Testing

npx hardhat test

Etherscan verification

Once you've deployed your code, to verify it run:

npx hardhat verify --network kovan DEPLOYED_CONTRACT_ADDRESS 

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published