Feat/allfixes - #153
Merged
Merged
Conversation
…cooldown, and blocklist
…erification for tickets
|
@Otaiki1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
This PR closes #25
This PR closes #81
This PR closes #103
Here is a summary of the changes made:
Contract Updates: Added Name, Symbol, BaseUri, and per-token TokenUri storage.
New Methods: Implemented
name()
,
symbol()
,
token_uri(token_id)
, and
set_token_uri(token_id, uri)
(minter-only).
Constructor: Updated the contract constructor to accept
name
,
symbol
, and base_uri.
2. Transfer Restrictions and Cooldown (#81)
Restriction Logic: Added a global transfer toggle, blocklist support, and a configurable transfer cooldown period.
Error Handling: Introduced specific error variants for TransferDisabled, TransferCooldownActive, and AddressBlocked.
Management: Added minter-only functions to manage restrictions (
set_transfer_restrictions
,
set_blocklist
) and track the OriginalPrice for future resale cap enforcement.
Testing: Added 12 comprehensive tests in
test.rs
covering minting, burning, metadata, and all transfer restrictions (cooldown, blocklist, etc.). All tests passed successfully.
3. QR Code Generation for Verification (#103)
Contract Support: Added
get_token_id(owner)
to the
ticket_nft
contract to allow the client to retrieve the specific NFT ID for an owner for QR generation.
Client Implementation:
My Tickets Page: Created a new /my-tickets page that lists all tickets owned by the connected user.
Ticket QR Modal: Implemented a modal that generates a QR code containing ticket data (
token_id
, event_id,
owner
).
Cryptographic Signing: Added a "Generate Verified QR" feature that uses the Freighter wallet to sign the ticket data, ensuring the QR code cannot be easily forged or spoofed by screenshots.
Verifier Page: Created a /verifier scanner page for event organizers. It supports offline verification by checking the cryptographic signature and online verification by querying the Soroban network for current ownership.
Dependencies: Installed react-qr-code and html5-qrcode in the soroban-client package.
Key Files Modified:
lib.rs
: Core contract logic for metadata and restrictions.
test.rs
: Comprehensive unit tests.
soroban.ts
: SDK wrapper for new contract calls.
my-tickets/page.tsx
: User ticket wallet.
verifier/page.tsx
: Organizer ticket verifier.