Hi, I deployed a contract, minted a Token to wallet A, transferred that from A to B and then try to use the Update_operators entrypoint.
Now come the question: if i call the function with A, which token’s operator change? Because A now doesn’t have any token, but the contract accept the call anyways.
Thanks
The definitive source of truth for FA2 is this document: TZIP-12 and the associated documents.
Operator permissions are not reliant on the current ownership of tokens nor the existence of the token within the contract.
The update_operators
add or remove permissions for a specific combination of:
-
Token ID: The unique identifier for a specific token.
-
Owner: The true owner of the token.
-
Operator: The individual granted the authority to request transfers for the given token.
By default, the permission lasts forever and can be added/removed by the owner. However, you can implement custom rules to regulate who can modify permissions and how. For instance, you might disallow non-owners from adding token permissions, remove permissions when the last token has been transferred, or revoke all permissions after any transfer.
FA2 is designed so you can transfer 0 tokens to test permissions.
Example
Alice owns 0 tokens with token_id = 1
.
- If the token doesn’t exist, any transfer fail with `“FA2_TOKEN_UNDEFINED”.
- If the token exists:
- Alice and Alice’s operators can transfer 0 tokens
- others cannot transfer even 0 tokens, it would fail with
"FA2_NOT_OPERATOR"
.
Thanks Jordan! Now is clear!