This project allows users to borrow an access NFT that gives them access to view a book through our site. The contract allows anyone to borrow a book for however long they like (as long as you can pay the fee). Whilst giving authors royalties on their payments. We allow authors to make sure they get paid for each time their book gets read. The NFT also acts as a way for you to know all the previous borrowers of your book. Once you run out of collateral on your borrow, the NFT gets automatically transferred back to the marketplace via a liquidation function anyone can call.
This project uses Unlock for the NFT logic. It simplifies the dev and user exp. Users no longer worry about losing capital from liquidations; instead, the access token is auto-returned. We used NEXT.js and Ethers.js for our front end and scripts. Hardhat for deployment and Solidity for our smart contracts. Etherscan for contract verification and function calls. Unlock made the whole process simpler as we didn't need to write much code for the NFT itself and it was just plug and play type experience.