A smart contract for the Stacks blockchain that enables digital asset holders to lease their tokens for revenue generation while allowing lessees to utilize assets temporarily without full acquisition.
This platform creates a decentralized marketplace where:
- Asset Holders can post their digital assets for lease and earn passive income
- Lessees can temporarily use assets without purchasing them outright
- Platform facilitates secure transactions with dispute resolution mechanisms
- List digital assets for lease with custom pricing
- Set minimum and maximum lease terms
- Earn revenue from multiple lease cycles
- Update pricing when assets are not actively leased
- Remove listings when no active leases exist
- Browse available assets and get instant pricing quotes
- Lease assets for flexible durations
- Deposit system ensures responsible usage
- Automatic deposit return upon asset return
- Transaction history tracking
- 5% service fee (configurable by admin)
- Automated expiration handling
- Dispute resolution system
- User metrics and reputation scoring
- Revenue tracking and withdrawal
Posts a digital asset for lease with specified terms.
(post-asset-for-lease asset-contract asset-id rate-per-block minimum-term maximum-term)Leases an available asset for a specified duration.
(lease-asset post-id term)Returns a leased asset and retrieves deposit.
(return-asset post-id)Anyone can trigger return of expired leases.
(auto-return-expired post-id)Asset holders can update pricing when not actively leased.
(update-lease-rate post-id new-rate-per-block)Asset holders can remove listings when no active lease exists.
(remove-posting post-id)get-posting(post-id)- Get lease posting detailsget-current-lease(post-id)- Get active lease informationget-user-metrics(user)- Get user statistics and reputationget-lease-estimate(post-id, term)- Calculate lease costs before committingis-lease-expired(post-id)- Check if a lease has expiredget-platform-statistics()- View platform metrics
- Lease Cost:
rate-per-block × lease-duration - Service Fee: 5% of lease cost (goes to platform)
- Deposit: 20% of lease cost (returned when asset is returned)
- Total Payment:
lease-cost + deposit
- Asset Holder: 95% of lease cost
- Platform: 5% service fee
- Lessee: Deposit returned upon asset return
- 20% deposit required from lessees
- Automatically returned when asset is properly returned
- Can be forfeited in dispute resolution
- Only asset holders can modify their postings
- Only lessees can return their leased assets
- Platform admin can resolve disputes
- Prevents self-leasing
- Comprehensive input validation
- Ownership verification requirements
- Duration limits enforcement
- Prevents double-listing of assets
Platform administrators can:
set-service-fee-percentage- Adjust platform fees (max 20%)set-term-limits- Configure minimum/maximum lease durationswithdraw-service-fees- Withdraw accumulated platform revenueresolve-conflict- Handle disputes between parties
u200- Admin-only functionu201- Item not foundu202- Access deniedu203- Invalid valueu204- Asset already postedu205- Asset not accessible for leaseu206- Lease currently in progressu207- Lease has endedu208- Insufficient fundsu209- Invalid timeframeu210- Asset not controlled by caller
;; 1. Post an asset for lease
(contract-call? .asset-lease-contract post-asset-for-lease
.my-nft-contract
u123
u100 ;; 100 microSTX per block
u144 ;; minimum 1 day
u1440 ;; maximum 10 days
)
;; 2. Get a quote for leasing
(contract-call? .asset-lease-contract get-lease-estimate u1 u720) ;; 5 days
;; 3. Lease the asset
(contract-call? .asset-lease-contract lease-asset u1 u720)
;; 4. Return the asset
(contract-call? .asset-lease-contract return-asset u1)