This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "RentContract.sol": { | |
| "__sources__": { | |
| "RentContract.sol": { | |
| "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.20;\r\n\r\ncontract RentContract {\r\n address public tenant; \r\n address public landlord; \r\n uint256 public rentAmount; \r\n uint256 public period; \r\n uint256 public nextPayment; \r\n uint256 public balance; \r\n\r\n constructor(\r\n address _landlord,\r\n uint256 _rentAmount,\r\n uint256 _period\r\n ) {\r\n tenant = msg.sender;\r\n landlord = _landlord;\r\n rentAmount = _rentAmount;\r\n period = _period;\r\n nextPayment = block.timestamp + _period;\r\n }\r\n\r\n function deposit() external payable {\r\n require(msg.sender == tenant, \"Only tenant\");\r\n balance += msg.value;\r\n }\r\n\r\n function withdrawRent() external {\r\n require(msg.sender == landlord, \"Only landlord\");\r\n require(block.timestamp >= |