At SmartPy we’ve read the proposal and wrote a contract with some tests that implements it.
The contract is here: FA2_nft_minimal.py.
I encourage people to read it if they want to understand how the standard is supposed to work. Please tell us if there is any mistake.
Our remarks are:
- Overall it’s a good and interesting proposal.
- We are waiting for the merge of the TZIP proposal.
- The
approve
entrypoint explanations need to be a bit more explicit:-
Indicate that the transfer fails if the approve falls under zero.
-
Explicit the error message. We have 3 suggestions:
- Keep
"FA2_NOT_OPERATOR"
to be fully compatible with FA2 "FA2_INSUFFICIENT_ALLOWANCE"
- Mix 1) and 2) and fails with a pair of
"FA2_NOT_OPERATOR"
and"FA2_INSUFFICIENT_ALLOWANCE"
. We can even give the allowance in the error message.
- Keep
-
Clarify what to do if the
allowance
equals 0 with a transfer of 0 tokens?
I suggest to pass because it permits to test the allowance system.
To be clear, a transfer of 0 tokens with:- no allowance => fail (so the system remains compatible with FA2)
- allowance of 0 => pass
In this case the allowance should not be removed if a
transfer
, andexport_ticket
or anything that reduces the allowance to zero. It must be zero.
We are open to alternatives.
-