A comprehensive solution for creating, managing, and interacting with smart contracts for real estate portfolios. This agent helps users register properties on the blockchain as NFTs, track value changes, manage rental status, and transfer ownership.
The project is organized into two main parts:
-
Smart Contract (Backend)
- Solidity contract for property management
- Hardhat environment for development, testing, and deployment
- Scripts for deploying and interacting with the contract
-
Web Application (Frontend)
- React-based interface for interacting with the smart contract
- Web3 integration for wallet connection
- UI for property registration, viewing, and management
- Property Registration: Register properties with detailed information
- Property Valuation: Track purchase price and current valuation
- Rental Management: Mark properties as rented and track rental income
- Ownership Transfer: Transfer property ownership via NFT standards
- Portfolio View: See all properties in a portfolio
The RealEstatePortfolio
contract is built on the ERC721 NFT standard with the following features:
- Extends OpenZeppelin's ERC721URIStorage for metadata management
- Properties represented as unique tokens with comprehensive metadata
- Role-based access control for property management
- Events for tracking property registration, updates, sales, and rental changes
- React-based application with NextUI components
- Ethers.js for blockchain interaction
- Web3Modal for wallet connection
- Responsive design for mobile and desktop use
- Node.js (v14 or higher)
- npm or yarn
- MetaMask or another Ethereum wallet
- Clone the repository
git clone <repository-url>
cd real-estate-portfolio-agent
- Install dependencies
# Install root dependencies
npm install
# Install frontend dependencies
cd frontend
npm install
- Configure environment variables
cp .env.example .env
# Edit .env with your values
- Compile and deploy the smart contract (local)
npx hardhat compile
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
- Start the frontend
cd frontend
npm start
- Deploy to Sepolia testnet
npx hardhat run scripts/deploy.js --network sepolia
- Build frontend for production
cd frontend
npm run build
- Connect Wallet: Connect your MetaMask or other Ethereum wallet
- Connect to Contract: Enter the deployed contract address
- Register Property: Fill in property details and register it on the blockchain
- View Property: View property details by entering the token ID
- Manage Property: Update values, set rental status, or transfer ownership
The main functions available in the smart contract:
registerProperty
: Register a new property as an NFTupdateProperty
: Update property informationsetRentalStatus
: Set rental status and incomegetPropertyDetails
: Get detailed property informationtransferFrom
: Transfer property ownership (standard NFT transfer)
Run the test suite to verify contract functionality:
npx hardhat test
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for secure smart contract libraries
- NextUI for React components
- Hardhat for the Ethereum development environment