https://github.com/gadingnst/learn-hh-smartcontract
Learn how to create and deploy Smart Contract
https://github.com/gadingnst/learn-hh-smartcontract
Last synced: 5 months ago
JSON representation
Learn how to create and deploy Smart Contract
- Host: GitHub
- URL: https://github.com/gadingnst/learn-hh-smartcontract
- Owner: gadingnst
- Created: 2023-01-03T12:02:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T11:18:52.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T10:41:09.777Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://hardhat.org/
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample Hardhat Project
## Install depedencies
```npm install```
--------------------------------
## Install from Scratch
### install hardhat
```npm install --save-dev hardhat```
### setup project
```npx hardhat```
--------------------------------
### Setup network and account
Go to `hardhat.config.ts`
Change `ALCHEMY-KEY` and `PRIVATE-KEY` with your own
### Compile
```npx hardhat compile```
### Artifacts
It will produce two folders, `artifacts` and `cache`.
To get ABI and Bytecode, go to `artifacts/contracts/{CONTRACT_NAME}/{CONTRACT_NAME}.json`
### Deploy contracts
To deploy bytecode into blockchain you can run
```npx hardhat run scripts/{YOUR_DEPLOYER_FILE} --network {YOUT_NETWORK_NAME}```
if you want to deploy into testnet or mainnet just configure the network and deploy to network name
--------------------------------
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
Try running some of the following tasks:
```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts
```