Skip to content

zS1L3NT/lotterex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lotterex

License Languages Top Language Commit Activity Last commit

Lotterex is a simple smart contract that allows anyone to deploy a Lottery smart contract, and allow others to join the lottery. Once there are at least 3 people in the Lottery, the deployer of the smart contract can randomly pick the winner and send them the prize.

Motivation

I needed to submit a project strictly following the requirements for my BADV (Introduction to Blockchain Application Development) submission.

Subrepositories

The Truffle project which contains the smart contract and tests

The NextJS project containing the UI to interact with the smart contract

Features

  • Create Lottery
    • Lottery Name
    • Lottery Price
  • Enter Lottery
  • Leave Lottery
  • Lottery Manager Controls
    • Pick random winner for Lottery
    • Close Lottery
  • Developer page to call smart contract functions directly

Usage

In the Truffle project, setup the truffle-config.js file, then build it with the command

$ pnpm build

Make sure the folder contracts is generated in web-next-lotterex/src

Then you can run the following command in the NextJS project

$ pnpm dev

Credits

This example project using React from Truffle helped me out the most.

Tests

The Lotterex smart contract is tested with Truffle Suite. To run the tests, run the following command in the Truffle project

$ pnpm test

Built with

  • Web3
    • Truffle Suite
    • Ganache Network
  • NodeJS
    • TypeScript
      • @types/bn.js
      • @types/mocha
      • @types/node
      • @types/react
      • @types/react-dom
      • @typescript-eslint/eslint-plugin
      • @typescript-eslint/parser
      • typescript
      • ts-node
    • ESLint
      • eslint
      • eslint-config-next
      • eslint-config-prettier
      • eslint-plugin-react
    • Next
      • next
      • react
      • react-dom
    • Mantine
      • @mantine/core
      • @mantine/hooks
      • @mantine/notifications
      • @tabler/icons-react
    • Truffle
      • @typechain/truffle-v5
      • truffle
      • typechain
    • Web3
      • @metamask/providers
      • web3
      • web3-core
      • web3-eth-contract
      • web3-utils

About

Lotterex is a simple Lottery smart contract with a web ui to interact use it

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors