This is a Dev Project submission for NTU CX4153 Blockchain Technology course
- Chantharojwong Kasidis (U2020731L)
- Chen Yi (U2121925C)
- Kunthamas Donchada (U2123242J)
apps
directoryapps/hardhat
= Hardhat project for developing and deploying smart contractsapps/hardhat/contracts
= Smart contracts written in Solidityapps/hardhat/test
= Tests written with ethers and chai
apps/web
= Next.js frontend for interacting with smart contracts
- visit https://blockdutch.ckasidis.com to view the deployed frontend.
- connect to your wallet with metamask, coinbase wallet, or injected connector.
- switch your network to Sepolia testnet
run the following command in the root of this project:
npm install
run the following command in the root of this project:
npm run compile
- start local hardhat network by running the following command in the root directory of this project:
npm run node
- In a new terminal session, deploy the Auction Factory contract to local hardhat network by running the following command in the root directory of this project:
npm run deploy:local
-
in the
.env
file in the root directory of this project, setNEXT_PUBLIC_AUCTION_FACTORY_ADDRESS
environment variable to the auction factory address printed from the previous step. For example:NEXT_PUBLIC_AUCTION_FACTORY_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
-
start frontend dev server by running the following command in the root directory of this project:
npm run dev
-
visit http://localhost:3000/auctions to view the frontend.
-
connect to your wallet with metamask, coinbase wallet, or injected connector.
-
switch your network to localhost (local hardhat network)
run the following command in the root of this project:
npm install
run the following command in the root of this project:
npm run compile
- in the
.env
file in the root directory of this project, setSEPOLIA_GATEWAY_URL
andSEPOLIA_PRIVATE_KEY
environment variables. For example:SEPOLIA_GATEWAY_URL=<YOUR SEPOLIA GATEWAY URL> SEPOLIA_PRIVATE_KEY=<YOUR SEPOLIA PRIVATE KEY>
- deploy the Auction Factory contract to Sepolia testnet by running the following command in the root directory of this project:
npm run deploy:sepolia
Deploy the frontend Next.js app with NEXT_PUBLIC_AUCTION_FACTORY_ADDRESS
and NEXT_PUBLIC_ALCHEMY_API_KEY
environment variables.
- visit your deployed frontend.
- connect to your wallet with metamask, coinbase wallet, or injected connector.
- switch your network to Sepolia testnet
# Hardhat
# compile smart contracts developed with Hardhat (apps/hardhat/contracts)
npm run compile
# deploy Auction Factory contract to local hardhat network
npm run deploy:local
# deploy Auction Factory contract to Sepolia testnet
npm run deploy:sepolia
# start local hardhat network
npm run node
# test smart contracts
npm run test
# test smart contracts with gas report
npm run test:report-gas
# Frontend
# build frontend
npm run build
# start frontend dev server
npm run dev
# run linter
npm run lint
# run linter fix
npm run lint:fix
# Other commands
# run git commit
npm run commit
# run prettier check
npm run format:check
# run prettier fix
npm run format:fix