feat: NFT Puzzle Access Rental Smart Contract #109
Open
Akinbola247 wants to merge 6 commits intoMindFlowInteractive:mainfrom
Open
feat: NFT Puzzle Access Rental Smart Contract #109Akinbola247 wants to merge 6 commits intoMindFlowInteractive:mainfrom
Akinbola247 wants to merge 6 commits intoMindFlowInteractive:mainfrom
Conversation
Contributor
|
@Akinbola247 Please resolve conflict |
Author
|
@Mkalbani , the conflict has been resolved |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
closes #81contracts/puzzle_rentalcontract, allowing NFT owners to list exclusive puzzle access for rent in exchange for tokens, with time-bound access control, extension support, early termination with refunds, and a marketplace discovery index.What's Included
Contract (
src/lib.rs)Test (
src/test.rs), 57 test passed, 0 failureData model
RentalListing— owner-defined rental terms: price per period, duration, max periods, payment token, extension policy, and refund percentageRentalAgreement— active rental with time bounds, escrow tracking, and statusRentalRecord— immutable history entry written on every terminal state (expired or terminated)Core functions
Acceptance Criteria
Notes for Reviewers
ActiveListings) is stored in instance storage for efficient pagination. Cancelled listings are eagerly removed from the index.auto_expire_if_neededis called defensively insideextend_rentalandterminate_rentalto prevent acting on a rental that has silently lapsed — this avoids a class of race conditions around the boundary ofend_time.