Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Latest commit

ย 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SC4053 - Blockchain Technology Project โ€” _๐Ÿƒ BONK

๐Ÿƒ BONK is short for Bid On Non-fungible Kavel (Kavel is Dutch for "lot")

  • Bid On: Participate in an auction to place bids.
  • Non-fungible: Referring to unique, indivisible items that are verified on the blockchain (like NFTs).
  • Kavel: A Dutch word meaning "lot" or "parcel," representing each unique auction item.

Together, BONK is your gateway to secure, transparent and fair decentralized dutch auctions. This dApp (decentralised application) empowers users to participate in secure, trust-less biddingโ€”where every bid counts and decentralisation is at the core.

Dutch auctions decentralised to bid smart and own fast.


Project Cover


Getting Started

Pre-requisites

Running in a Container

  • Docker
  • Dev Container extension (VSCode)

Running Locally

๐Ÿ› ๏ธ Installation and Set Up

  1. Clone repository
    git clone git@github.com:crystalcheong/bonk.git
    cd bonk
  2. Duplicate .env.example to create .env file
    cp -n packages/service/.env.example packages/service/.env
    cp -n apps/web/.env.example apps/web/.env
  3. Install dependencies
    pnpm i
  4. Start the application
    pnpm run dev

Tip

Copy the Hardhat generated network accounts, for testing in localhost

  1. In a new terminal tab, deploy smart contracts
    cd ./packages/service
    pnpm run deploy:local
    Once deployed, update apps/web/.env,
    VITE_BONK_AUCTION_INITIATOR_ADDRESS=<auction-initiator-address>
  2. Regenerate ABI
    cd ../../apps/web
    pnpm run generate

Deployment

1. Deploy to Sepolia testnet on Alchemy

  1. Set the following variables in packages/service/.env:
SEPOLIA_GATEWAY_URL=https://eth-sepolia.g.alchemy.com/v2/<alchemy-api-key>
SEPOLIA_PRIVATE_KEY=<metamask-private-key>
  1. Open a new terminal tab in the serivce packge
cd packages/service
  1. Compile and test the smart contracts
pnpm run build
pnpm run test
  1. Deploy to Sepolia testnet
pnpm run deploy:sepolia

2. Host web application on Vercel

  1. Set the following variables in apps/web/.env:
VITE_ALCHEMY_API_KEY=<alchemy-api-key>
VITE_BONK_AUCTION_INITIATOR_ADDRESS=<deployed-auction-initiator-address>
  1. Open a new terminal tab in the web packge
cd apps/web
  1. Build the project and generate the ABI Hooks
pnpm run build
pnpm run generate
  1. Deploy to Vercel

Project Structure

Frontend (apps/web)
Built on TypeScript with React and Vite bundling. Wagmi dependency to manage wallet connections, fully type-safe interactions with the RPC, and to generate ABI directly from the deployed contract address.

Smart Contracts (packages/service)
containing our Solidity smart contracts, test scripts and typings generated with Typechain that the frontend references directly

Untitled-2024-11-06-0946 (1)

How the Contracts Work

Untitled-2024-11-06-0946

AuctionInitiator
This contract allows anyone to create a new auction. It tracks all auctions created by different users, acting as the starting point for every new auction process.

AuctionMarket
This contract handles the auction mechanics. It manages the bidding process, tracks token commitments, calculates clearing prices, and distributes tokens at the end of the auction. Essentially, itโ€™s the heart of the auction operation.

AuctionToken
This is where the custom ERC-20 token for the auction is defined. It manages token transfers, tracks balances, mints new tokens, and burns unsold tokens to maintain supply integrity.


Team Members

  • Crystal Cheong Yu Qing (U2121134A)
  • Seah Kai Heng (U2021104L)
  • Nguyen Ngoc Minh Nghia (U2120213H)

This repository is submitted as a project work for Nanyang Technological University's SC4053 - Blockchain Technology course.

About

๐Ÿƒ Dutch auctions decentralised to bid smart and own fast

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages