A decentralized house renting platform developed as final project for Alchemy University Ethereum Bootcamp.
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.
- 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.
- OwnershipFacet: Implementor of the ERC173 standard for contract ownership.
- ReputationFacet: Contract that exposes functions to read users and properties scores.
- PropertyFacet: Contract in charge of handling properties that are available for rental.
- ListingFacet: A contract that aggregates the properties' data and exposes it in a single place.
- ERC1155TokenReceiverFacet: Implementor of the ERC1155TokenReceiver interface.
- ERC1155Facet: A readonly implementation of the ERC1155 standard.
- CoreFacet: Contract that handles the rental logic.
The project has been deployed on the optimism-goerli
testnet.
Contract | Address |
---|---|
CoreFacet | |
ERC1155Facet | |
ERC1155TokenReceiverFacet | |
ListingFacet | |
PropertyFacet | |
ReputationFacet | |
DiamondCutFacet | |
DiamondLoupeFacet | |
OwnershipFacet | |
DiamondInit | |
Diamond |
The only set of resources you'll ever need to undestand EIP2535