Skip to content

Latest commit

 

History

History
125 lines (70 loc) · 5.4 KB

README.md

File metadata and controls

125 lines (70 loc) · 5.4 KB

DeRent

A decentralized house renting platform developed as final project for Alchemy University Ethereum Bootcamp.

Overview

The project is built using the EIP2535 Diamond Proxy standard, for contract upgradability and Foundry, and the ERC1155 Multi Token standard to manage user houses as NFTs and their balances. As its focus is on implementing the Diamond Proxy standard, the number of features is limited:

  • Mint a house NFT for rental: A user can mint a property as an NFT and make it available for rental.
  • On-chain credit score: Users have an on-chain credit score that is directly updated based on their payment performance. Owners can use this score to determine the acceptability of a rental request.
  • Rental collateral: On rental request, the user must deposit an equivalent of 2 times the rent price. This deposit will serve as collateral if the tenant fails to pay on time, allowing the owner to claim it as payment.
  • Post-rental voting and property rating: At the end of the rental period, both parties can vote on each other, and the tenant can also assign a score to the property.
  • Deposit withdrawal: Once the rental agreement is complete, the tenant can withdraw the initial deposit if it is still available.

A posible future improvement would be to allow users to set their rental terms. For example, a user with a payment score below 4 would have his request immeadiately rejected by the protocol if the owner decided so.

Architecture

Contracts Required by EIP2535

  • DiamondCutFacet: Contract in charge of handling the update logic of the diamond.
  • DiamondLoupeFacet: Contract in charge of introspection. Allows to se the facet addresses and their functions.
  • Diamond: The proxy contract that handles the routing logic to send user requests to the correct facet if one is available.

Other Contracts

Diagram

Project Diagram

Contract Deployments

The project has been deployed on the optimism-goerli testnet.

Contract Address
CoreFacet

0x739051ebe51FC306B30577D75CF2979dd17a8a22

ERC1155Facet

0x72C264Cb4bE59C72641aae82357284F8c8c456f4

ERC1155TokenReceiverFacet

0x88B3bd902010Eb224b6f0564DC5DC365515D294a

ListingFacet

0xce9180134cba34F1aDAf302F3d7aBb05fa060cA3

PropertyFacet

0x99E1cEB467e3cB7D74b4B243Cf9D84191f0A521C

ReputationFacet

0xcc25046E00a6a9046346BD5a99474baaB7516423

DiamondCutFacet

0x0074E4b52Fe9695b97689C20Ad42421ee8F18adD

DiamondLoupeFacet

0x288791D8ef2e1CBbD700aa82395923D7Dabde4F8

OwnershipFacet

0xEC22680e8A978AA3DC99d36a9eAAb6eff148b5cb

DiamondInit

0x982DEF9dC7dB61d9C0D0C6b32E84E0811EC950Ea

Diamond

0x0141b696Ba60A391Dbf35BF04E93aFCc27FA24d4

Resources

The only set of resources you'll ever need to undestand EIP2535