🗻 Table of Contents
This is my first project to try to combine blockchain and front-end technology, this project try to resolve simple fundraising loophole problem
This project start from Solidity, Next.js and React, and has some base lint rule (eslint and commitlint), so the development may need to pay attention to
Solidity document (the project use 0.8.9) https://docs.soliditylang.org/en/v0.8.9/
Rinkeby Scan https://rinkeby.etherscan.io/
Remix Online Editor https://remix.ethereum.org
Next.js Config Setting Docs https://nextjs.org/docs/api-reference/next.config.js/introduction
Cypress Test Command Docs https://docs.cypress.io/api/commands/and#Chai
After you have cloned, there are a few things you must do
-
Make Sure your browser has a wallet extension such as MetaMask
-
Install the dependencies
yarn
- Create the
.env
file and add some content to it
MNEMONIC="YOUR_WALLET_PNEUMONIC"
RINKEBY_ADDRESS="YOUR_RINKEBY_ADDRESS"
RINKEBY_ADDRESS
you can go to infura to create one ( Press the Create key in the upper right corner )MNEMONIC
is your account mnemonic phrase ( A long list of English words )
- then compile and deploy the contract
yarn run deploy
- You will see some little monkey in console
- Start this project
yarn run dev
My folder structure is separated by feature, as the project is still small, so I want to avoid over-design.
Project
├─ .asset # docs asset
├─ .husky # husky config folder (lint check before commit)
├─ .vscode # vscode config folder (extension convenience)
├─ ethereum
│ ├─ build # contract compile result
│ ├─ contracts # contract folder
│ ├─ ADDRESS.json # contract deploy result
│ ├─ compile.js # compile file
│ ├─ deploy.js # deploy file
│ ├─ factory.js # instance file for front-end to use
│ ├─ fundraising.js # instance file for front-end to use
│ └─ web3.ts # instance file for front-end to use
├─ src
│ ├─ feature # core Logic Components
│ ├─ hook # share Logic for Components
│ ├─ layout # UI that is not part of the main program
│ ├─ lib # node.js code part
│ ├─ pages # simplest logic and component arrangement
│ ├─ style # global css
│ └─ type
└─ ...