{"id":30082618,"url":"https://github.com/blockful/ens.rent","last_synced_at":"2026-04-11T21:07:38.883Z","repository":{"id":263131773,"uuid":"889323297","full_name":"blockful/ens.rent","owner":"blockful","description":"ENS rental platform","archived":false,"fork":false,"pushed_at":"2025-03-21T19:01:42.000Z","size":613,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T15:54:16.107Z","etag":null,"topics":["ens","solidity"],"latest_commit_sha":null,"homepage":"https://ens.rent/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-16T04:32:30.000Z","updated_at":"2025-03-21T19:01:47.000Z","dependencies_parsed_at":"2024-11-16T12:32:18.854Z","dependency_job_id":"85aa6577-db41-4164-a31d-e6ace5bae54a","html_url":"https://github.com/blockful/ens.rent","commit_stats":null,"previous_names":["blockful-io/ens-rent-contracts","blockful-io/ens.rent","blockful/ens.rent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blockful/ens.rent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockful%2Fens.rent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockful%2Fens.rent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockful%2Fens.rent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockful%2Fens.rent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockful","download_url":"https://codeload.github.com/blockful/ens.rent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockful%2Fens.rent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269489752,"owners_count":24425574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ens","solidity"],"created_at":"2025-08-08T21:14:55.078Z","updated_at":"2026-04-11T21:07:38.837Z","avatar_url":"https://github.com/blockful.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ENS Domain Rental Contract\n\nA smart contract system that enables ENS domain owners to rent out their domains for a specified duration. This contract supports both wrapped (ERC1155) and unwrapped (ERC721) ENS names.\n\n## Features\n\n### Domain Listing\n\n- Owners can list their ENS domains for rent\n- Set a price per second in ETH\n- Define a maximum end date for rentals\n- Supports both wrapped and unwrapped ENS domains\n- Automatic handling of domain custody during rental period\n\n### Domain Renting\n\n- Renters can lease domains for any period up to the maximum end date\n- Pay-per-second pricing model\n- Automatic refund of excess payments\n- Instant transfer of ENS name control to renter\n- Protection against rental period overlaps\n\n### Safety Features\n\n- Automatic validation of domain expiry\n- Protection against zero prices\n- Validation of rental end dates\n- Checks for active rental periods\n- Safe handling of both ERC721 and ERC1155 tokens\n- Proper ETH transfer safety checks\n\n### Domain Management\n\n- Lenders can reclaim domains after rental period\n- Recovery mechanism for expired rentals\n- Automatic return of domain control\n- Clear rental terms tracking\n\n### Ideas\n\n- [ ] Rental ownership through NFT\n- [ ] Protocol fees\n- [ ] Dynamic auction parameters\n\n## Technical Details\n\n### Contract Architecture\n\nThe system consists of three main components:\n\n1. Base Registrar Interface (ERC721)\n2. Name Wrapper Interface (ERC1155)\n3. ENS Registry Interface\n\n### Commands\n\n#### Lend and Borrow\n\nChange the domain name in the script to the desired domain and set the private key in the .env file.\n\n```bash\nforge script script/lendAndBorrow.s.sol \\\n    --rpc-url sepolia \\\n    -vvvvv \\\n    --chain 11155111 \\\n    --verify \\\n    --broadcast \\\n    --slow\n```\n\n### Key Structs\n\n```solidity\nstruct RentalTerms {\n    address lender;          // Domain owner\n    uint256 pricePerSecond;  // Rental price in wei/second\n    uint256 maxEndTimestamp; // Maximum rental end date\n    address currentBorrower; // Current renter\n    uint256 rentalEnd;      // Current rental end time\n    bytes32 nameNode;       // ENS node hash\n}\n```\n\n### Main Functions\n\n#### List Domain\n\n```solidity\nfunction listDomain(\n    uint256 tokenId,\n    uint256 pricePerSecond,\n    uint256 maxEndTimestamp,\n    bytes32 nameNode\n) external\n```\n\n#### Rent Domain\n\n```solidity\nfunction rentDomain(\n    uint256 tokenId,\n    uint256 desiredEndTimestamp\n) external payable\n```\n\n#### Reclaim Domain\n\n```solidity\nfunction reclaimDomain(\n    uint256 tokenId\n) external\n```\n\n## Events\n\n```solidity\nevent DomainListed(uint256 indexed tokenId, address indexed lender, uint256 pricePerSecond, uint256 maxEndTimestamp, bytes32 nameNode);\nevent DomainRented(uint256 indexed tokenId, address indexed borrower, uint256 rentalEnd, uint256 totalPrice);\nevent DomainReclaimed(uint256 indexed tokenId, address indexed lender);\n```\n\n## Error Handling\n\nThe contract includes custom errors for better gas efficiency and clearer error messages:\n\n- `ZeroPriceNotAllowed()`\n- `MaxEndTimeMustBeFuture()`\n- `MaxEndTimeExceedsExpiry()`\n- `DomainNotListed()`\n- `ExceedsMaxEndTime()`\n- And more...\n\n## Usage Examples\n\n### List a Domain for Rent\n\n```solidity\n// List domain for 0.0001 ETH per second until Dec 31, 2024\ncontract.listDomain(\n    tokenId,\n    100000000000000, // 0.0001 ETH in wei\n    1735689600,      // Dec 31, 2024\n    nameNode\n);\n```\n\n### Rent a Domain\n\n```solidity\n// Rent domain until Nov 1, 2024\ncontract.rentDomain{value: 1 ether}(\n    tokenId,\n    1698796800  // Nov 1, 2024\n);\n```\n\n## Security Considerations\n\n- Contract holds ENS domains during rental periods\n- Implements reentrancy protection\n- Safe ETH transfer handling\n- Proper access control for domain operations\n- Validation of all time-based parameters\n- Protection against rental overlap\n\n## Dependencies\n\n- OpenZeppelin Contracts\n  - ERC721Holder\n  - ERC1155Holder\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockful%2Fens.rent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockful%2Fens.rent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockful%2Fens.rent/lists"}