Conversation
|
Can we merge it? |
Of course not. I'm still reviewing. And there is no approval at all. |
| public abstract string Symbol { get; } | ||
| public BigInteger Factor { get; } | ||
|
|
||
| public const byte Decimals = 0; |
| return new InteropInterface(OwnerOf(engine.Snapshot, tokenId)); | ||
| } | ||
|
|
||
| public virtual IEnumerator OwnerOf(StoreView snapshot, byte[] tokenId) |
| IEnumerator enumerator = OwnerOf(engine.Snapshot, tokenId); | ||
| if (!enumerator.Next()) return false; | ||
| UInt160 owner = new UInt160(enumerator.Value().GetSpan().ToArray()); | ||
| if (!engine.CheckWitnessInternal(owner)) return false; |
There was a problem hiding this comment.
If the owner it's the second in the enumerator?
There was a problem hiding this comment.
It has only one owner, when Decimals = 0.
There was a problem hiding this comment.
This will not happen, because in this contract NFT is restricted to be indivisible, so there is no second owner.
There was a problem hiding this comment.
We need IEnumerator for tokensOf methods of nep11 .
public static enumerator tokensOf(byte[] owner)There was a problem hiding this comment.
Maybe we can use UInt160 as the return type of the internal tokensOf, it's ok for me.
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
|
Any thoughts on #1670 (comment)? |
|
Wait for #1629 |
|
go? |
|
Please wait. |
| [ContractMethod(0_08000000, CallFlags.AllowModifyStates)] | ||
| public virtual bool Transfer(ApplicationEngine engine, UInt160 to, byte[] tokenId) | ||
| { | ||
| if (tokenId.Length > MaxTokenIdLength) return false; |
There was a problem hiding this comment.
Accorging to
https://github.com/neo-project/proposals/pull/41/files?short_path=afd2225#diff-afd22253b102da74b022d8c022201ee6
The parameter tokenid SHOULD be a valid NFT. If not, this method SHOULD throw an exception.
| [ContractMethod(0_01000000, CallFlags.AllowStates)] | ||
| public virtual BigInteger BalanceOf(StoreView snapshot, UInt160 account, byte[] tokenId) | ||
| { | ||
| if (tokenId.Length > MaxTokenIdLength) return BigInteger.Zero; |
There was a problem hiding this comment.
The parameter owner SHOULD be a 20-byte address. If not, this method SHOULD throw an exception.
We should unify it like https://github.com/neo-project/neo/pull/1670/files#diff-f7ac0fe60b0bcd46ff4d867627d38bf6R112
There was a problem hiding this comment.
Not necessary, because the incorrectly formatted parameters cannot call the method
There was a problem hiding this comment.
Sorry, I copied the wrong text, i means that token id should be checked in all methods in the same way, throwing an exception.
|
Happy to see this, a check from @hal0x2328 would be a good to see. |
required for #1644
This is the pre-PR of Nns. The token prototype is implemented according to the Nep11 standard, and other NFT assets can inherit this class, simplifying the implementation