Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
LotM Renting Protocol V1
https://github.com/zharta/lotm-renting-protocol-v1
Admin
Tokens:
11,705
Snippets:
55
Trust Score:
3.9
Update:
1 year ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Project Setup and Testing Commands Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Commands for setting up the development environment and running various types of tests for the Lotm Renting Protocol. Includes commands for installation, unit tests, integration tests, fuzz tests, and gas profiling. ```makefile make install-dev make unit-tests make integration-tests make fuzz-tests make gas ``` -------------------------------- ### RentingV3 Contract Methods Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Core methods for managing rentals within the RentingV3 contract. These methods handle starting, closing, extending, withdrawing, and claiming rentals, as well as revoking listing conditions. ```APIDOC RentingV3: start_rentals(listing_id: uint256, renter: address, delegate: address, duration: uint256, signature: bytes): Starts a new rental. Requires listing details, renter, delegate wallet, duration, and owner's signature. close_rentals(listing_id: uint256, renter: address, signature: bytes): Allows a renter to close an ongoing rental before its due date. Pays only for time used. extend_rentals(listing_id: uint256, renter: address, duration: uint256, signature: bytes): Allows a renter to extend an ongoing rental, requiring upfront payment for the extension. withdraw(listing_id: uint256, owner: address, signature: bytes): Allows the NFT owner to withdraw the NFT from the vault, including any unclaimed fees. claim(listing_id: uint256, owner: address, signature: bytes): Allows the NFT owner to claim unclaimed fees associated with a rental. revoke_listing(listing_id: uint256, timestamp: uint256, signature: bytes): Allows the owner to set a timestamp after which listings set before it are no longer valid. ``` -------------------------------- ### Renting Protocol Entry Point Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md The RentingV3.vy contract serves as the primary entry point for users and external protocols interacting with the LOTM Renting Protocol. It manages NFT deposits, rental initiation, extensions, early closures, fee claims, and NFT withdrawals. ```APIDOC RentingV3.vy (Protocol Entry Point): - Manages NFT deposits by owners, creating vaults if necessary. - Handles rental initiation by renters, including upfront payment. - Supports renters extending existing rentals. - Allows renters to close rentals before the scheduled end date. - Enables NFT owners to claim earned rental fees. - Facilitates NFT owners withdrawing their assets from the protocol. - Supports NFT owners staking APE tokens and trading vaults. ``` -------------------------------- ### Deployment Command Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md A general command to deploy the protocol contracts to a specific environment, such as the development network. ```makefile make deploy-dev ``` -------------------------------- ### RentingV3.vy Contract Overview and Fee Management Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Details the RentingV3.vy contract's role in managing rentals and protocol fees. It outlines key parameters like protocol_fee, protocol_wallet, and max_protocol_fee, and describes how fees are applied during rental creation, closure, and other lifecycle events. ```APIDOC Contract: RentingV3.vy Description: The single user-facing contract for each Renting Market. It manages payment tokens, creates vaults, and handles rental states, delegating calls to vaults except for admin functions. Key Parameters and State Variables: - protocol_fee: The fee percentage applied to the rental amount. This value is set during rental creation and can be changed by the admin for future rentals. - protocol_wallet: The wallet address designated to receive protocol fees. This value is set during rental creation and can be changed by the admin for future rentals. - max_protocol_fee: A deployment-time set limit for the maximum possible value of protocol_fee that the admin can set. This value cannot be changed after deployment. Methods: - start_rental(params): - Description: Initiates a new rental. The protocol_fee and protocol_wallet initially defined or passed in parameters are used for this rental. - Usage: Called to begin a rental agreement. - Fee Application: Uses the protocol_fee and protocol_wallet valid at the time of creation. - withdraw(): - Description: Allows for the accumulation and transfer of protocol fees. - Fee Handling: Protocol fees can be accumulated and transferred via this method. - claim(): - Description: Allows for the accumulation and transfer of protocol fees. - Fee Handling: Protocol fees can be accumulated and transferred via this method. - close_rental(rental_id, ...): - Description: Terminates a rental early. - Fee Application: Fees are applied over the pro-rata rental amount, similar to rewards. - extend_rental(rental_id, ...): - Description: Extends the duration of an existing rental. - Fee Handling: Protocol fees can be accumulated and transferred via this method. Admin Role: - The 'admin' role can change both the `protocol_fee` and `protocol_wallet` values. These changes become effective for all new rentals created thereafter. Fee Accumulation and Transfer: - Protocol fees follow a similar process to rental rewards, meaning they can be accumulated and transferred on specific actions: `withdraw`, `claim`, `close_rental`, and `extend_rental`. ``` -------------------------------- ### Renting Market Contract Parameters Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Defines the deployment parameters and descriptions for the `Renting.vy` and `Vault.vy` contracts, which are deployed for each Renting Market. These parameters specify dependencies like payment tokens, NFT contracts, and delegation services. ```APIDOC Renting.vy Deployment Parameters: _vault_impl_addr: address Description: address of the Vault implementation contract for the renting market _payment_token_addr: address Description: address of the payment token (ERC20) contract for the renting market _nft_contract_addr: address Description: address of the NFT (ERC721) contract for the renting market _delegation_registry_addr: address Description: address of the delegation (warm.xyz) contract _max_protocol_fee: uint256 Description: maximum value for the admin configurable `protocol_fee` parameter _protocol_fee: uint256 Description: fraction of the rentals' values (in bps) to be paid as fee _protocol_wallet: address Description: wallet address to receive the protocol fees _protocol_admin: address Description: wallet address of the protocol admin Vault.vy Deployment Parameters: _payment_token_addr: address Description: address of the payment token (ERC20) contract for the renting market _nft_contract_addr: address Description: address of the NFT (ERC721) contract for the renting market _delegation_registry_addr: address Description: address of the delegation (warm.xyz) contract ``` -------------------------------- ### Project Dependencies and Compilation Command Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt This snippet includes the command used to compile the project's dependencies and the resulting requirements list. It specifies the Python packages and their exact versions needed for the LotM Renting Protocol V1. ```Python uv pip compile -o requirements.txt pyproject.toml aiohttp==3.9.3 # via web3 aiosignal==1.3.1 # via aiohttp annotated-types==0.6.0 # via pydantic ape-alchemy==0.8.7 # via lotm-renting-protocol-v1 (pyproject.toml) ape-arbitrum==0.8.3 # via lotm-renting-protocol-v1 (pyproject.toml) ape-base==0.8.1 # via lotm-renting-protocol-v1 (pyproject.toml) ape-foundry==0.8.7 # via lotm-renting-protocol-v1 (pyproject.toml) ape-optimism==0.8.3 # via ape-base ape-vyper==0.8.9 # via lotm-renting-protocol-v1 (pyproject.toml) asttokens==2.4.1 # via # eth-ape # stack-data # vyper attrs==23.2.0 # via aiohttp base58==1.0.3 # via # py-cid # py-multihash bitarray==2.9.2 # via eth-account cached-property==1.5.2 # via # py-ecc # py-evm cbor2==5.6.2 # via vyper cchecksum==0.0.4 # via eth-ape certifi==2024.2.2 # via requests charset-normalizer==3.3.2 # via requests ckzg==2.0.1 # via # eth-account # py-evm click==8.1.7 # via eth-ape cytoolz==0.12.3 # via eth-utils dataclassy==0.11.1 # via eip712 decorator==5.1.1 # via ipython eip712==0.2.10 # via eth-ape eth-abi==5.2.0 # via # eip712 # eth-account # eth-ape # eth-tester # ethpm-types # web3 eth-account==0.13.5 # via # eip712 # eth-ape # eth-tester # web3 eth-ape==0.8.27 # via # lotm-renting-protocol-v1 (pyproject.toml) # ape-alchemy # ape-arbitrum # ape-base # ape-foundry # ape-optimism # ape-vyper eth-bloom==3.0.0 # via py-evm eth-hash==0.6.0 # via # eth-bloom # eth-tester # eth-utils # trie # web3 eth-keyfile==0.7.0 # via eth-account eth-keys==0.6.1 # via # eth-account # eth-keyfile # eth-tester # py-evm eth-pydantic-types==0.1.3 # via # ape-alchemy # ape-arbitrum # ape-foundry # eth-ape # ethpm-types # evm-trace eth-rlp==2.2.0 # via eth-account eth-tester==0.12.1b1 # via web3 eth-typing==5.2.0 # via # cchecksum # eip712 # eth-abi # eth-ape # eth-keys # eth-pydantic-types # eth-utils # py-ecc # py-evm # web3 eth-utils==5.2.0 # via # cchecksum # eip712 # eth-abi # eth-account # eth-ape # eth-keyfile # eth-keys # eth-pydantic-types # eth-rlp # eth-tester # ethpm-types # evm-trace # py-ecc # py-evm # rlp # trie # web3 ethpm-types==0.6.24 # via # ape-alchemy # ape-arbitrum # ape-base # ape-foundry # ape-optimism # ape-vyper # eth-ape evm-trace==0.2.4 # via # ape-alchemy # ape-foundry # eth-ape evmchains==0.1.3 # via # ape-alchemy # eth-ape executing==2.0.1 # via stack-data frozenlist==1.4.1 # via # aiohttp # aiosignal hexbytes==1.3.0 # via # ape-foundry # eip712 # eth-account # eth-ape # eth-pydantic-types # eth-rlp # trie # web3 idna==3.6 # via # requests # yarl ijson==3.2.3 # via eth-ape importlib-metadata==7.0.1 # via vyper iniconfig==2.0.0 # via pytest ipython==8.21.0 # via eth-ape jedi==0.19.1 # via ipython lark==1.2.2 # via vyper lazyasd==0.1.4 # via eth-ape lru-dict==1.2.0 # via py-evm markdown-it-py==3.0.0 # via rich matplotlib-inline==0.1.6 # via ipython mdurl==0.1.2 # via markdown-it-py morphys==1.0 # via # py-cid # py-multibase # py-multicodec # py-multihash msgspec==0.18.6 # via evm-trace multidict==6.0.5 # via # aiohttp # yarl numpy==1.26.4 # via # eth-ape # pandas packaging==23.2 # via # eth-ape # pytest # vvm # vyper pandas==2.2.3 # via eth-ape parsimonious==0.10.0 # via eth-abi parso==0.8.3 # via jedi pexpect==4.9.0 # via ipython pluggy==1.5.0 # via # eth-ape # pytest prompt-toolkit==3.0.43 # via ipython ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data py-cid==0.3.0 # via ethpm-types py-ecc==7.0.1 # via py-evm py-evm==0.10.1b2 # via # eth-tester # evm-trace py-geth==5.2.1 # via # eth-ape # web3 py-multibase==1.0.3 # via py-cid py-multicodec==0.2.1 # via py-cid py-multihash==0.2.3 # via py-cid pycryptodome==3.20.0 # via # eth-hash # eth-keyfile # vyper pydantic==2.10.6 # via # eth-account # eth-ape # eth-pydantic-types # ethpm-types # evm-trace # evmchains # py-geth # pydantic-settings # web3 pydantic-core==2.27.2 # via pydantic pydantic-settings==2.8.0 # via eth-ape pygments==2.17.2 # via # ipython # rich ``` -------------------------------- ### Mock Contract Deployments Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Mock implementations of external dependencies used for testing and private deployments. These contracts are located in the `contracts/auxiliary` directory and are not part of the core protocol. ```vyper contracts/ └── auxiliary ├── ERC20.vy ├── ERC721.vy └── HotWalletMock.vy ``` -------------------------------- ### traitlets Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt traitlets provides configuration system for Python. It is a dependency for eth-ape, ipython, and matplotlib-inline. ```Python traitlets==5.14.1 # via # eth-ape # ipython # matplotlib-inline ``` -------------------------------- ### vvm Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt vvm is a tool for managing virtual environments. It is a dependency for ape-vyper. ```Python vvm==0.3.2 # via ape-vyper ``` -------------------------------- ### tqdm Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt tqdm is a fast, extensible progress bar for Python. It is a dependency for ape-vyper and eth-ape. ```Python tqdm==4.66.2 # via # ape-vyper # eth-ape ``` -------------------------------- ### watchdog Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt watchdog is an API for monitoring file system events. It is a dependency for eth-ape. ```Python watchdog==3.0.0 # via eth-ape ``` -------------------------------- ### wcwidth Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt wcwidth is a library for determining the display width of Unicode characters. It is a dependency for prompt-toolkit. ```Python wcwidth==0.2.13 # via prompt-toolkit ``` -------------------------------- ### python-dotenv Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt python-dotenv loads environment variables from a .env file. It is a dependency for pydantic-settings. ```Python python-dotenv==1.0.1 # via pydantic-settings ``` -------------------------------- ### six Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt six is a Python 2 and 3 compatibility library. It is a dependency for many packages, including asttokens and py-multibase. ```Python six==1.16.0 # via # asttokens # py-multibase # py-multicodec # py-multihash # python-dateutil ``` -------------------------------- ### pytest Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt pytest is a testing framework for Python. This entry lists its version and its direct dependency on eth-ape. ```Python pytest==8.3.4 # via eth-ape ``` -------------------------------- ### Vault Creation with CREATE2 Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md The protocol utilizes CREATE2 opcode and minimal proxies for efficient vault creation. This allows the destination address of a vault to be deterministically computed before its actual creation, enabling atomic vault creation and NFT deposit operations. ```APIDOC Vault Creation Mechanism: - Uses CREATE2 opcode for deterministic vault address calculation. - Employs minimal proxies for efficient vault deployment. - Enables atomic operations: vault creation and NFT deposit can occur in a single transaction. - Protocol creates vaults automatically when an NFT is deposited, eliminating the need for manual vault creation by users. ``` -------------------------------- ### web3 Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt web3.py is a Python library for interacting with Ethereum. It is a dependency for multiple packages including ape-alchemy and eth-ape. ```Python web3==7.8.0 # via # ape-alchemy # ape-foundry # eth-ape ``` -------------------------------- ### pyunormalize Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt pyunormalize is a library for Unicode normalization. It is a dependency for web3. ```Python pyunormalize==15.1.0 # via web3 ``` -------------------------------- ### wheel Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt wheel is a built-package format for Python. It is a dependency for vyper. ```Python wheel==0.42.0 # via vyper ``` -------------------------------- ### toolz Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt toolz provides utility functions for iterators, functions, and dictionaries. It is a dependency for cytoolz. ```Python toolz==0.12.1 # via cytoolz ``` -------------------------------- ### typing-extensions Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt typing-extensions provides backported features from the typing module. It is a dependency for many libraries including eth-typing and web3. ```Python typing-extensions==4.12.2 # via # eth-pydantic-types # eth-typing # py-geth # pydantic # pydantic-core # sqlalchemy # web3 ``` -------------------------------- ### semantic-version Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt semantic-version is a Python library for parsing and comparing semantic versions. It is a dependency for eth-tester and py-geth. ```Python semantic-version==2.10.0 # via # eth-tester # py-geth ``` -------------------------------- ### zipp Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt zipp provides a path-like object for zip files. It is a dependency for importlib-metadata. ```Python zipp==3.17.0 # via importlib-metadata ``` -------------------------------- ### urllib3 Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt urllib3 is a powerful HTTP client for Python. It is a dependency for eth-ape, requests, and types-requests. ```Python urllib3==2.2.1 # via # eth-ape # requests # types-requests ``` -------------------------------- ### rlp Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt rlp is a Python implementation of the Recursive Length Prefix encoding. It is a dependency for several Ethereum-related libraries. ```Python rlp==4.1.0 # via # eth-account # eth-rlp # eth-tester # py-evm # trie ``` -------------------------------- ### Lotm Renting Protocol V1 Functions Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md This section details the external functions of the Lotm Renting Protocol V1, including their purpose, allowed roles, modifiers, and descriptions. These functions manage asset delegation, rentals, staking, and protocol administration. ```APIDOC LotmRentingProtocolV1: delegate_to_wallet(token_address: address, hot_wallet_address: address) Roles Allowed: Owner Modifier: Nonpayable Description: Delegates call to each token's vault to perform a delegation to a given hot wallet. renter_delegate_to_wallet(token_address: address, hot_wallet_address: address) Roles Allowed: Owner Modifier: Nonpayable Description: Delegates call to each token's vault to perform a delegation to a given hot wallet when an NFT is rented. deposit(token_addresses: address[]) Roles Allowed: Any (becomes Owner) Modifier: Nonpayable Description: Creates and initializes vaults for given tokens and delegates for each vault the deposit of the token and creation of a listing. mint(token_address: address) Roles Allowed: Owner Modifier: Nonpayable Description: Mints an NFT representation of the vault that can be transacted and/or used as collateral. revoke_listing(token_address: address) Roles Allowed: Owner Modifier: Nonpayable Description: Sets a timestamp before which past listings become invalidated. start_rentals(token_addresses: address[], duration: uint256) Roles Allowed: Any (becomes Renter) Modifier: Nonpayable Description: Starts rentals for the specific duration and delegates call to each token's vault to delegate themselves to the renter. close_rentals(token_addresses: address[]) Roles Allowed: Renter Modifier: Nonpayable Description: Cancels the rentals and delegates call to each token's vault to cancel the delegation. extend_rentals(token_addresses: address[], new_duration: uint256) Roles Allowed: Renter Modifier: Nonpayable Description: Extends the rentals and delegates call to each token's vault to extend the delegation. withdraw(token_addresses: address[]) Roles Allowed: Owner Modifier: Nonpayable Description: After delegating calls to each token's vault to withdraw the NFTs and mark the vaults as inactive, claims pending rewards. stake_deposit(token_addresses: address[]) Roles Allowed: Owner Modifier: Nonpayable Description: Transfers APE to the vaults and delegates call to each token's vault to stake in the corresponding APE staking pool. stake_withdraw(token_addresses: address[]) Roles Allowed: Owner Modifier: Nonpayable Description: Delegates call to each token's vault to claim pending staking rewards and to unstake and send APE to the owner's wallet. stake_claim(token_addresses: address[]) Roles Allowed: Owner Modifier: Nonpayable Description: Delegates call to each token's vault to claim pending staking rewards to the owner's wallet. stake_compound(token_addresses: address[]) Roles Allowed: Owner Modifier: Nonpayable Description: Delegates call to each token's vault to claim pending staking rewards and stake them in the same staking pool. claim() Roles Allowed: Owner Modifier: Nonpayable Description: Claims all unclaimed owner rewards. claim_token_ownership(token_address: address) Roles Allowed: Owner Modifier: Nonpayable Description: Changes the owner of the vault to the owner of the vault's NFT representation (useful when the vault is traded). claim_fees() Roles Allowed: Admin Modifier: Nonpayable Description: Claims all unclaimed protocol fees. set_protocol_fee(fee_bps: uint256) Roles Allowed: Admin Modifier: Nonpayable Description: Sets the protocol fee (in basis points) to be charged for each rental. change_protocol_wallet(new_wallet_address: address) Roles Allowed: Admin Modifier: Nonpayable Description: Changes the wallet address to receive the protocol fees. set_paused(paused: bool) Roles Allowed: Admin Modifier: Nonpayable Description: Pauses and unpauses the protocol. propose_admin(proposed_admin_address: address) Roles Allowed: Admin Modifier: Nonpayable Description: Sets the `proposed_admin` variable, which can then claim ownership. claim_ownership() Roles Allowed: *proposed owner* Modifier: Nonpayable Description: Claims ownership of the contract, setting the `protocol_admin` variable. is_vault_available(token_address: address) Roles Allowed: Any Modifier: View Description: Checks if the vault for a given token already exists and if it is not active. tokenid_to_vault(token_id: uint256) Roles Allowed: Any Modifier: View Description: Returns the address of an existing or yet to be created vault, allowing asset approvals for deposits or creation of rentals. ``` -------------------------------- ### stack-data Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt stack-data is a library for extracting and formatting stack traces. It is a dependency for ipython. ```Python stack-data==0.6.3 # via ipython ``` -------------------------------- ### Owner Signature Parameters Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Defines the parameters comprising an owner's signature for a listing within the Lotm Renting Protocol. This includes the signature components (v, r, s) and their respective data types. ```APIDOC OwnerSignatureParameters: Signature Components: - v: uint256 - r: uint256 - s: uint256 Description: Parameters of the owner's signature of a listing. Required: Yes ``` -------------------------------- ### python-dateutil Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt python-dateutil provides extensions to the standard datetime module. It is a dependency for eth-ape and pandas. ```Python python-dateutil==2.8.2 # via # eth-ape # pandas ``` -------------------------------- ### LotM Renting Protocol V1 State Variables Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md This section details the state variables managed by the LotM Renting Protocol V1 smart contract. These variables store critical configuration, addresses of dependent contracts, and mapping data essential for the protocol's operation. They define the contract's persistent state and how it interacts with other components. ```APIDOC State Variables: - vault_impl_addr: address - Description: Address of the Vault implementation contract for the renting market. - Mutable: No - payment_token_addr: address - Description: Address of the payment token (ERC20) contract for the renting market. - Mutable: No - nft_contract_addr: address - Description: Address of the NFT (ERC721) contract for the renting market. - Mutable: No - delegation_registry_addr: address - Description: Address of the delegation (warm.xyz) contract. - Mutable: No - staking_addr: address - Description: Address of the APE Staking (apestake.io) contract. - Mutable: No - renting_erc721: address - Description: Address of the ERC721 interface of the vault contract. - Mutable: No - max_protocol_fee: uint256 - Description: Maximum value for the admin configurable `protocol_fee` parameter. - Mutable: No - staking_pool_id: uint256 - Description: Integer specifying the APE Staking (apestake.io) pool to be used for the renting market. - Mutable: No - protocol_wallet: address - Description: Wallet address to receive the protocol fees. - Mutable: Yes - protocol_fee: uint256 - Description: Fraction of the rentals' values (in bps) to be paid as fee. - Mutable: Yes - protocol_admin: address - Description: Wallet address of the protocol admin. - Mutable: Yes - proposed_admin: address - Description: Wallet to be proposed as admin by using the `propose_admin` function; it becomes the `protocol_admin` after the wallet claims it by calling `claim_ownership`. - Mutable: Yes - rental_states: HashMap[uint256, bytes32] - Description: Map of rental states: stores the hash of a Rental structure for a given token ID (NFT). - Mutable: Yes - listing_revocations: HashMap[uint256, uint256] - Description: Map of listing revocations: for each token ID, stores the timestamp before which past listings become invalidated. - Mutable: Yes - unclaimed_rewards: uint256 - Description: Keeps the amount of the owner's unclaimed rewards, which result from rentals expiration and must be accounted for later claim. - Mutable: Yes - protocol_fees_amount: uint256 - Description: Keeps the amount of unclaimed protocol fees, which result from rentals expiration and must be accounted for later claim by the protocol admin. - Mutable: Yes ``` -------------------------------- ### Listing Struct Schema Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Defines the structure for listing state, including token ID, pricing, duration limits, and submission timestamp. All members are considered part of the state for contract integrity. ```APIDOC Listing: token_id: uint256 (Yes) - id of the deposited token price: uint256 (Yes) - price per hour, 0 means not listed min_duration: uint256 (Yes) - min duration in hours max_duration: uint256 (Yes) - max duration in hours, 0 means unlimited timestamp: uint256 (Yes) - timestamp when the listing was submitted offchain ``` -------------------------------- ### vyper Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt Vyper is a Pythonic smart contract language for the EVM. It is a direct dependency for the project and ape-vyper. ```Python vyper==0.4.1 # via # lotm-renting-protocol-v1 (pyproject.toml) # ape-vyper ``` -------------------------------- ### Rental Struct Schema Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Defines the structure for rental state, including renter, token ID, rental period, and payment details. Key members are marked as part of the state for contract integrity. ```APIDOC Rental: id: bytes32 (Yes) - id of a rental, calculated as the keccak256 of the renter, token_id, start and expiration; empty if there's no active rental owner: address (Yes) - wallet address owner of the deposited NFT renter: address (Yes) - wallet address renting the NFT delegate: address (No) - used as hot wallet during the rental period token_id: uint256 (Yes) - id of the deposited token start: uint256 (Yes) - timestamp marking the start of the rental period min_expiration: uint256 (Yes) - timestamp marking the minimal period charged in case of rental cancelation by the renter expiration: uint256 (Yes) - timestamp marking the end of the rental period amount: uint256 (Yes) - amount (of the payment token) to be paid by the renter for the rental protocol_fee: uint256 (Yes) - fee in bps to be charged for the rental protocol_wallet: address (Yes) - wallet to receive the protocol fee ``` -------------------------------- ### Delegation Management Methods Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Methods related to wallet delegation for vaults, managed by both renters and NFT owners. Delegation allows specifying a hot wallet for rental durations or without expiration. ```APIDOC RentingV3: deposit(listing_id: uint256, delegate: address): Sets an optional delegate as the vault hot wallet during deposit, without an expiration period. delegate_to_wallet(listing_id: uint256, delegate: address): Allows the vault owner to set a new delegate as the vault hot wallet without an expiration period, when no rental is ongoing. renter_delegate_to_wallet(listing_id: uint256, delegate: address): Allows a renter with an ongoing rental to specify a different wallet for delegation. ``` -------------------------------- ### regex Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt regex is a third-party regex module for Python. It is a dependency for parsimonious. ```Python regex==2023.12.25 # via parsimonious ``` -------------------------------- ### websockets Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt websockets is a library for building WebSocket servers and clients. It is a dependency for web3. ```Python websockets==12.0 # via web3 ``` -------------------------------- ### safe-pysha3 Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt safe-pysha3 provides a SHA3 implementation. It is a dependency for eth-hash. ```Python safe-pysha3==1.0.4 # via eth-hash ``` -------------------------------- ### sqlalchemy Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt SQLAlchemy is a SQL toolkit and Object Relational Mapper (ORM) for Python. It is a dependency for eth-ape. ```Python sqlalchemy==2.0.27 # via eth-ape ``` -------------------------------- ### rich Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt rich is a Python library for rich text and beautiful formatting in the terminal. It is a dependency for eth-ape. ```Python rich==13.7.0 # via eth-ape ``` -------------------------------- ### pytz Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt pytz provides timezone definitions for Python. It is a dependency for pandas. ```Python pytz==2024.1 # via pandas ``` -------------------------------- ### pyyaml Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt PyYAML is a YAML parser and emitter for Python. It is a dependency for eth-ape. ```Python pyyaml==6.0.1 # via eth-ape ``` -------------------------------- ### requests Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt requests is an HTTP library for Python. It is a dependency for multiple packages including ape-alchemy and eth-ape. ```Python requests==2.32.3 # via # ape-alchemy # eth-ape # ethpm-types # py-geth # vvm # web3 ``` -------------------------------- ### trie Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt trie is a Python implementation of a trie data structure. It is a dependency for eth-ape and py-evm. ```Python trie==3.1.0 # via # eth-ape # py-evm ``` -------------------------------- ### Renting Contract Roles and Ownership Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Details on roles within the Renting contract and associated ownership management functions. The admin role manages protocol fees and wallets, while owner and vault owner roles relate to NFT and vault management. ```APIDOC Renting: Roles: admin: Manages protocol fees and protocol wallet. Can be changed via propose_admin and claim_ownership. owner: Owner of the NFT escrowed in the vault. vault owner: Owner of the NFT representing the vault itself. Can claim ownership of escrowed NFTs. propose_admin(new_admin: address): Proposes a new admin address. claim_ownership(): Allows the proposed admin to claim ownership. ``` -------------------------------- ### python-baseconv Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt python-baseconv is a library for base conversion. It is listed as a dependency via py-multibase. ```Python python-baseconv==1.2.2 # via py-multibase ``` -------------------------------- ### types-requests Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt types-requests provides type stubs for the requests library. It is a dependency for py-geth and web3. ```Python types-requests==2.32.0.20241016 # via # py-geth # web3 ``` -------------------------------- ### sortedcontainers Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt sortedcontainers provides sorted list, dict, and set types. It is a dependency for trie. ```Python sortedcontainers==2.4.0 # via trie ``` -------------------------------- ### VaultV3 External Functions Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Lists the external functions available in the VaultV3 contract. These functions define the contract's interface for interacting with the Renting contract and users, covering initialization, asset management, and staking operations. ```APIDOC VaultV3 External Functions: initialise() - Roles Allowed: -- - Modifier: Nonpayable - Description: Called by Renting to set up the initial vault state. deposit() - Roles Allowed: Any - Modifier: Nonpayable - Description: Transfers the token from the user to the vault, optionally creates a listing and sets up a delegation to a given wallet. withdraw() - Roles Allowed: Any - Modifier: Nonpayable - Description: Transfers the token back to the owner together with any pending rewards, transfers any pending protocol fees and uninitializes the vault. delegate_to_wallet(wallet: address) - Roles Allowed: Any - Modifier: Nonpayable - Description: Creates a delegation for a given wallet if no rental is active. is_initialised() -> bool - Roles Allowed: Any - Modifier: Nonpayable - Description: Returns whether the vault is currently initialized. stake_deposit() - Roles Allowed: Any - Modifier: Nonpayable - Description: Stakes the APE and the NFT in the corresponding APE staking pool. stake_withdraw() - Roles Allowed: Any - Modifier: Nonpayable - Description: Claims pending staking rewards and unstakes and sends APE to the owner's wallet. stake_claim() - Roles Allowed: Any - Modifier: Nonpayable - Description: Claims pending staking rewards to the owner's wallet. stake_compound() - Roles Allowed: Any - Modifier: Nonpayable - Description: Claims pending staking rewards and stakes them in the same staking pool. ``` -------------------------------- ### yarl Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt yarl is a subclass of URL that is a subclass of str. It is a dependency for aiohttp and ape-foundry. ```Python yarl==1.9.4 # via # aiohttp # ape-foundry ``` -------------------------------- ### varint Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt varint is a Python library for variable-length integer encoding. It is a dependency for py-multicodec and py-multihash. ```Python varint==1.0.2 # via # py-multicodec # py-multihash ``` -------------------------------- ### Vault ERC721 Interface Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md The RentingERC721V3.vy contract implements the ERC721 interface for the vaults themselves. This allows the vaults to be treated as standard NFTs, enabling them to be traded or used in other DeFi applications. ```APIDOC RentingERC721V3.vy (Vault ERC721 Interface): - Implements the ERC721 standard for vaults. - Enables vaults to be transferred between users. - Allows vaults to be listed and traded on NFT marketplaces. - Supports the use of vaults as collateral in other financial protocols. ``` -------------------------------- ### VaultV3 State Variables Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md Defines the persistent state variables within the VaultV3 contract. These variables store critical addresses and configuration parameters necessary for the vault's operation, such as payment tokens, NFT contracts, and staking contract addresses. ```APIDOC VaultV3 State Variables: caller: address - Mutable: Yes - Description: Address of the Renting contract who deployed and manages the vault. payment_token_addr: address - Mutable: No - Description: Address of the payment token (ERC20) contract for the renting market. nft_contract_addr: address - Mutable: No - Description: Address of the NFT (ERC721) contract for the renting market. delegation_registry_addr: address - Mutable: No - Description: Address of the delegation (warm.xyz) contract. staking_addr: address - Mutable: No - Description: Address of the APE staking (apestake.io) contract. staking_pool_id: address - Mutable: Yes - Description: Integer specifying the APE Staking (apestake.io) pool to be used for the renting market. ``` -------------------------------- ### Vault Contract Functionality Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/README.md The VaultV3.vy contract is responsible for holding and managing individual NFTs deposited into the protocol. Each NFT is typically housed in its own vault due to delegation limitations. ```APIDOC VaultV3.vy (NFT Vaults): - Acts as a dedicated escrow for individual LOTM NFTs. - Facilitates delegation of the NFT to a renter's wallet for the rental duration. - Can be represented as NFTs themselves, allowing for exchange and use as collateral in other NFT-FI protocols. ``` -------------------------------- ### tzdata Dependency Source: https://github.com/zharta/lotm-renting-protocol-v1/blob/main/requirements.txt tzdata provides timezone data for Python. It is a dependency for pandas. ```Python tzdata==2025.1 # via pandas ```