HemProp is a decentralized application (dApp) built on the Ethereum blockchain that facilitates the buying, selling, and reviewing of real estate properties. This smart contract, written in Solidity, powers the core functionality of the HemProp platform.
- Create and manage property listings
- Buy and sell properties using cryptocurrency
- Leave and manage reviews for properties
- ERC721 compliant (Non-Fungible Tokens for properties)
- Owner controls and service fee implementation
The HemProp contract inherits from OpenZeppelin's ERC721, Ownable, and ReentrancyGuard contracts, providing standard NFT functionality, ownership controls, and protection against reentrancy attacks.
PropertyStruct: Represents a real estate propertyReviewStruct: Represents a review for a propertySaleStruct: Represents a property sale transaction
createProperty: List a new property for saleupdateProperty: Modify an existing property listingdeleteProperty: Remove a property listingbuyProperty: Purchase a listed propertycreateReview: Leave a review for a propertyupdateReview: Modify an existing reviewdeleteReview: Remove a review
getProperty: Retrieve details of a specific propertygetAllProperties: Get a list of all available propertiesgetMyProperty: Get a list of properties owned by the caller
To interact with the HemProp contract, you'll need:
- An Ethereum wallet (e.g., MetaMask)
- Some ETH for gas fees and property purchases
- A connection to an Ethereum network (mainnet or testnet)
This project uses Solidity version >=0.8.0 <0.9.0. To set up the development environment:
- Install Hardhat
- Clone this repository
- Install dependencies:
npm install - Compile the contract:
truffle compileornpx hardhat compile - Deploy to a local blockchain or testnet
The contract includes several security measures:
- ReentrancyGuard for
buyPropertyfunction - Access control checks for property and review management
- Input validation for all user-provided data
Contributions are welcome! Please feel free to submit a Pull Request.
This smart contract is provided as-is. Users should conduct their own research and security audits before using it in a production environment.