Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 

Repository files navigation

About: The Library Management System (LMS) is implemented as a smart contract on the Ethereum blockchain using Solidity. It enables a librarian (admin) to manage books β€” adding, updating, and removing them β€” while users (readers) can borrow and return books securely.

Each transaction (like borrowing or returning a book) is permanently recorded on the blockchain, ensuring transparency and accountability.

🧠 Features

πŸ‘‘ Owner-controlled: Only the contract owner can add new books.

πŸ“– Book tracking: Each book has a title, author, and number of available copies.

πŸ™‹ Borrow & return system: Users can borrow available books and return them later.

πŸ”” Events: Emits events when books are added, borrowed, or returned for easy on-chain tracking.

🧩 Smart Contract Overview Function Description Access addBook(string title, string author, uint256 copies) Add a new book to the library Owner only borrowBook(uint256 bookId) Borrow a book if available Any user returnBook(uint256 bookId) Return a borrowed book Any user getBook(uint256 bookId) Get details of a specific book Public view

πŸ§‘β€πŸ’» Roles: 1)Librarian (Admin):

Adds or removes books. Monitors borrowing records. 2)User (Member): Can view all available books. Can borrow and return books.

βš™οΈ How to Run

  1. Open in Remix

Go to Remix IDE .

Create a new file named LibraryManagement.sol.

Paste the smart contract code inside it.

  1. Compile

Select Solidity Compiler on the left panel.

Set the compiler version to 0.8.0 or higher.

Click Compile LibraryManagement.sol.

  1. Deploy

Go to the Deploy & Run Transactions tab.

Select the LibraryManagement contract.

Click Deploy.

  1. Interact

Once deployed, you can:

Call addBook("1984", "George Orwell", 3) β€” adds a new book (only the contract owner can do this).

Call borrowBook(1) β€” borrows the book with ID 1.

Call returnBook(1) β€” returns that book.

Call getBook(1) β€” views book details. Screenshot (145)

Contract address: 0x4255eb59fc63bbe3f0b6cc395bf1ba83dd745210

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages