feat(#675): implement operator approvals (set_approval_for_all / is_approved_for_all) - #709
Merged
Eniola3321 merged 1 commit intoAug 1, 2026
Conversation
…l / is_approved_for_all) Soroban contract (contracts/nft-contract/src/): - storage.rs: add set_approval_for_all / is_approved_for_all using persistent key (op_appr, owner, operator) - lib.rs: add set_approval_for_all(owner, operator, approved) function restricted by owner.require_auth() and pause check - lib.rs: add is_approved_for_all(owner, operator) read-only view - lib.rs: update transfer_from to accept operator-approved callers (owner || token-approved spender || operator-approved spender) - lib.rs: add emit_approval_for_all event emitted on every grant/revoke NestJS backend (src/nft/nft.controller.ts): - POST /nfts/tokens/:tokenId/approve — prepare single-token approve XDR - POST /nfts/approvals/operator — prepare set_approval_for_all XDR - GET /nfts/approvals/operator — query is_approved_for_all on-chain Closes ANYTECHS#675
|
@ellaevans2323-pixel 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.
Summary
Closes #675
Adds full NFT marketplace approval support: both per-token approvals (already present via
approve) and operator-level approvals that cover all tokens owned by an address.Changes
Soroban contract (
contracts/nft-contract/src/)storage.rs
set_approval_for_all(owner, operator, approved)— stores/removes operator approval under persistent key(op_appr, owner, operator)is_approved_for_all(owner, operator)— reads the same keylib.rs
set_approval_for_all(owner, operator, approved)— owner-authed, pause-checked; emitsapproval_alleventis_approved_for_all(owner, operator)— read-only viewtransfer_from— updated authorisation check: owner OR token-level approved spender OR operator-approved spenderemit_approval_for_allevent added to the events moduleNestJS backend (
src/nft/nft.controller.ts)POST /nfts/tokens/:tokenId/approve— prepares unsigned single-token approve XDR (existing contract function, new endpoint)POST /nfts/approvals/operator— prepares unsignedset_approval_for_allXDRGET /nfts/approvals/operator?ownerAddress=&operatorAddress=— queriesis_approved_for_allon-chain via simulationAcceptance Criteria
approve+get_approved)set_approval_for_all+is_approved_for_all)transfer_fromhonours operator approvalapproval_allevent emitted on grant/revoke