Assignment #3: Library DApp using Hardhat and ethers deployed to Moonbase
Submitted by: Ciel Recuerdo [101439257] Submitted On: April 22, 2024 10:30
- cd frontend
- npm install
- REACT_APP_CONTRACT_ADDRESS=0xe0003E2e604A1Fce6D2Ebc5933De49419CA6f80F npm run start
http://localhost:3000
Backend Project Setup using the existing deployed contract. You can borrow a book and return the book using the same metamask account used in borrowing book.
- At the root folder: npm install
- Add .env file in the root folder and add the following: MOONBASE_URL, PRIVATE_KEY, REACT_APP_CONTRACT_ADDRESS
To Add Book, compile and deploy a new contract. Otherwise, you will ecnounter a contract error: Contract was not called by the owner.
- At the root folder: npm install
- Add .env file in the root folder and add the following: MOONBASE_URL, PRIVATE_KEY, REACT_APP_CONTRACT_ADDRESS. Removed
0xin hardhat.config.js as it is working without that. - Delete the artifacts folder under frontend/src
- npx hardhat run scripts/deploy.js --network moonbase
- REACT_APP_CONTRACT_ADDRESS= npm run start http://localhost:3000
-
Using the existing deployed contract https://www.loom.com/share/95a709c72ac6430cbccfa32e9dca6dcf
-
Deploying a new contract https://www.loom.com/share/d0dd04806f4a475d986c403628808d7e
- Add Book
- Borrow Book
- Return Book
- Updated the contract Library.sol to fetch all the books including borrowed books
- Form and Contract Validations