A decentralized platform enabling tenants to pay rent in ETH (pegged to USD) using Chainlink Price Feeds. Landlords can securely withdraw rent after the rental period ends.
- Tenants create rental agreements by paying ETH equivalent to a specified USD amount.
- Real-time ETH/USD conversion via Chainlink Price Feeds.
- Landlords withdraw rent after the rental duration.
- Escrow-like mechanism: funds are locked until rental completion.
| Layer | Tech |
|---|---|
| Frontend | React.js, Wagmi, Viem (ethers optional) |
| Backend | Optional: Express.js |
| Smart Contracts | Solidity, Foundry or Hardhat |
| Oracles | Chainlink ETH/USD Price Feed |
| Network | Sepolia Testnet |
realestate-rental/
├── contracts/
│ └── RealEstateRental.sol # Main smart contract
├── frontend/
│ └── src/
│ ├── App.jsx # React UI
│ ├── components/ # Rental form, history, etc.
│ └── contracts/ # ABI & deployed addresses
├── scripts/ # Deployment scripts (Foundry/Hardhat)
├── foundry.toml / hardhat.config.js
└── README.md
struct Rental {
address tenant;
address payable landlord;
uint256 rentUSD;
uint256 rentETH;
uint256 startTime;
uint256 duration;
bool isActive;
bool isWithdrawn;
}function createRental(address landlord, uint256 rentUSD, uint256 duration) external payable;
function withdrawRent(uint256 rentalId) external;
function getLatestPrice() public view returns (int);
function getAllRentals() public view returns (Rental[] memory);- Wallet connect (MetaMask)
- Create Rental Form (inputs: landlord, USD rent, duration)
- Rental History (tenant/landlord info, createdAt date, status)
- Withdraw button for landlords (enabled after duration)
Using Foundry:
forge create --rpc-url <SEPOLIA_RPC> --private-key <PRIVATE_KEY> src/RealEstateRental.sol:RealEstateRentalOr using Hardhat:
npx hardhat run scripts/deploy.js --network sepoliacd frontend
npm install
npm run devWith Foundry:
forge testOr with Hardhat:
npx hardhat testTenant: 0x82Ff...
Landlord: 0x1234...
Rent: 50 USD
Duration: 604800 seconds (1 week)
Created: 2025-06-19 10:24 AM
- Saikrishna A.
- GitHub
- ✉️ saikrishnaask191@gmail..com
MIT License – feel free to use and build upon this project.