The current implementation of the set_approval_for_all
method in the CEP-78 NFT standard does not behave as expected. Ideally, this method should allow for the approval of multiple operators, enabling token owners to list their tokens on multiple marketplaces. However, this is not currently possible with the CEP-78 standard, limiting it to exclusive listings.
The method only approves tokens owned at the time of the entry point call, and does not cover tokens acquired later. This is because it simply loops over all of the owner's tokens and approves them individually, making the operation very expensive in terms of gas usage. In fact, a warning in the comments next to the entry point advises developers to "DO NOT invoke this entrypoint unless absolutely necessary."
This unexpected behavior may also confuse dApp developers who are familiar with Ethereum's ERC-721 standard, potentially hurting the adoption of the Casper network.
To address these issues, we propose changing the set_approval_for_all
implementation in the following ways:
- The entry point should allow owners to approve operators to manage all of their tokens in the contract, rather than individual tokens owned at the time of execution.
- The entry point should make it possible to allow approval of multiple operators.
- The entry point should have a corresponding getter method called
is_approved_for_all
, which returns whether an operator is approved to manage all tokens owned by an owner.