Berghain Entry: A Dapp that simulates the entrance to the popular Berlin club Berghain.
The Dapp allows poeple to enter the club or denies entry based on LUCK, totally random, pretty much as it happens at the real Berghain club.
Structually, Berghain Entry consists of a contract Entrance
that inherits from the Chainlink VRFBase interface to generate a random number that represents whether the person is allowed to enter the club or not.
Entrance
contract can:
- let randomly a person in
- generate a random number using oracles
- return the total number of people in the club
- blacklist the entrance of a person
The live webpage can be accessed here: https://biancabuzea200.github.io/blockchain-developer-bootcamp-final-project/
My public Ethereum account to receive my certification as an NFT: 0x95E17Ee1fF7AD3d66b260a21b335eA6CF2ce38af
https://www.loom.com/share/555efd60fa8e4628a3d2f30261cded35
│ .env
│ .env.example
│ .gitignore
│ avoiding_common_attacks.md
│ deployed_address.txt
│ design_pattern_decisions.md
│ hardhat.config.js
│ LICENSE
│ package-lock.json
│ package.json
│ README.md
│
├───artifacts
│
├───contracts
│ Entrance.sol
│
├───my-app
│ │ .gitignore
│ │ package-lock.json
│ │ package.json
│ │ README.md
│ │
│ ├───public
│ │ ber2.jpg
│ │ favicon.ico
│ │ index.html
│ │ logo192.png
│ │ logo512.png
│ │ manifest.json
│ │ robots.txt
│ │
│ └───src
│ │ App.css
│ │ App.js
│ │ App.test.js
│ │ index.css
│ │ index.js
│ │ logo.svg
│ │ reportWebVitals.js
│ │ setupTests.js
│ │
│ └───utils
│ EntrancePortal.json
│
├───scripts
│ deploy.js
│ run.js
│ sample-script.js
│
└───test
sample-test.js
- Node.js v16.13.0
- npm 6.13.7
- Hardhat
- React
- @appliedblockchain/chainlink-plugins-fund-link: 0.0.3
- @chainlink/contracts: ^0.3.1
- @nomiclabs/hardhat-ethers: ^2.0.4
- @nomiclabs/hardhat-waffle: ^2.0.1
- @openzeppelin/contracts: ^4.4.2
- @testing-library/jest-dom: ^5.16.1
- @testing-library/react: ^12.1.2
- @testing-library/user-event: ^13.5.0
- chai: ^4.3.4
- dotenv: ^12.0.3
- ethereum-waffle: ^3.4.0
- ethers: ^5.5.3
- gh-pages: ^3.2.3
- hardhat: ^2.8.2
- react: ^17.0.2
- react-dom: ^17.0.2
- react-scripts: 5.0.0
- web-vitals: ^2.1.3
- Clone from
https://github.com/biancabuzea200/blockchain-developer-bootcamp-final-project
npm install
to install dependencies for smart contractcp .env.example .env
to create your own.env
file; set theRINKEKY_RPC_URL
(from alchemy) andPRIVATE_KEY
in therenpx hardhat test
to perform unit testsnpx hardhat run scripts/deploy.js --network rinkeby
to deploy the contract to the Rinkeby test network NOTE: because the contact uses Chainlink oracle to get a random number, the contract cannot be deployed on your localhostnpx hardhat fund-link --contract insert-contract-address-here --network rinkeby
to fund the deployed contract with LINKcd my-app
to navigate to the frontend foldernpm install
to install dependencies for frontendnpm start
to start React server populated at http://localhost:3000/
Test command: npx hardhat test
Entrance
√ Should return the initial number of people in as 0 (888ms)
√ Cannot check status if has not requested access (123ms)
√ Cannot blacklist an address if not the owner (117ms)
√ Can blacklist an address if the caller is the owner (122ms)
√ Does not permit to request entrance for a blacklisted address (104ms)