Huzaifaahmed20 / Web3Distrupt-Workshop

This repo is created for the workshop of Web3Distrupt participants, a basic buy me a coffee smart contract.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blockchain Genesis - Web3Disrupt Workshop

Open in Gitpod Hardhat

Buy Me A Coffee ☕

This project demonstrates a basic smart contract usage. The project is designed to give basic concepts of smart contracts to the participants of Web3Disrupt.

This smart contract consist of following components:

  1. Coffee Smart Contract.
  2. Coffee ERC-20 Token.
  3. Coffee ERC-721 Token.

Functionalities

The smart contract consist of following functions,

  1. Donate tokens worth a coffee to the owner.
  2. Minting an NFT to the donar address.
  3. Set price of the coffee.
  4. Withdraw amount from the smart contract to owner account.

Usage

Setting up

Make sure to install nodejs

# Check node and npm versions
node -v # v16.14
npm -v  # v8.19

# Clone repo
git clone https://github.com/khuzama98/Web3Distrupt-Workshop

# Install development dependencies
npm install

Pre Requisites

Before running any command, you need to create a .env file and set all necessary environment variables. Follow the example in .env.example.

If you don't already have a mnemonic, use this bip39 to generate one.

If you don't already have an infura key, use this infura to generate one.

Commands

Try running some of the following tasks:

# Get help screen
npx hardhat help

# Run to compile contracts
npx hardhat compile

# Run to generate typechain types
npx hardhat typechain

# Run hardhat tests
npx hardhat test

# Run hardhat tests with gas report
GAS_REPORT=true npx hardhat test

# Run a local hardhat network
npx hardhat node

# Run script to deploy contracts locally
npx hardhat run scripts/deploy.ts

# Run script to deploy contracts to a network specified in `hardhat.config.ts`
npx hardhat run scripts/deploy.ts --network goerli

# Run script to verify contract to the network they are deployed to
# - Make sure to update the script with valid addresses and args
# - Make sure to set api keys of explorer in `.env` file, checkout `.env.example` for example
npx hardhat run scripts/verify.ts --network goerli

# Run to clean artifacts, cache etc
npm run clean

Disclaimer

These contracts are NOT production ready and are ONLY for demo and educational purposes.

What next?

Checkout some of these templates to gain advance exposure on how to utilize hardhat at its fullest

Checkout some of these projects and resources

Other solidity development frameworks

About

This repo is created for the workshop of Web3Distrupt participants, a basic buy me a coffee smart contract.


Languages

Language:TypeScript 52.6%Language:Solidity 46.0%Language:Shell 1.4%