-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TestNet] Non Fungible Ticket #92
[TestNet] Non Fungible Ticket #92
Conversation
We should make some research about ticketing and how it is done in other chains. If there is currently any ERC standard then we should consider it to use. Big issue i see on current design is, it changes current NFT implementation with none-standard methods for public usage. That means current NFTs are not going to compatible with these changes. Also we break standard implementation of the NFT. My recommendation would be Design another contract which you can transfer NFT and the contract can mark NFT as used then the contract send asset to destination address. The app can track logs of that contract. I followed such design on some other sale NFT contracts. Here is NFTStore contract example. When NFT ticket is placed for sale then you transfer ticket to Ticket contract address. Ticket contract is going to be notified by its OnNonFungibleTokenReceived method already by NFT Contract after it is transferred. OnNonFungibleTokenReceived method takes the parameter about which token transferred and by who. Also it takes another byte[] parameter which you can transfer extra data.
In here you can see that SafeTransferFrom is able to carry extra data to another contract. CirrusSmartContracts/Testnet/NonFungibleToken/NonFungibleToken/NonFungibleToken.cs Line 186 in 2e017e5
CirrusSmartContracts/Testnet/NonFungibleToken/NonFungibleToken/NonFungibleToken.cs Line 370 in 2e017e5
In this way you can mark NFT tickets as used in Ticketing contract and read the logs. I can give more details but let me know your opinion on this @madrazzl3 @fenix2222 |
Testnet/NonFungibleToken-Ticket/NonFungibleToken/NonFungibleToken.cs
Outdated
Show resolved
Hide resolved
public void MarkAsUsed(UInt256 tokenId) | ||
{ | ||
EnsureOwnerOnly(); | ||
this.SetIsUsed(tokenId, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove This
from here and others.
Testnet/NonFungibleToken-Ticket/NonFungibleToken/NonFungibleToken.cs
Outdated
Show resolved
Hide resolved
I left some more reviews and approved. You can merge after reviews. |
Co-authored-by: YakupIpek <[email protected]>
Contract has been whitelisted on CirrusTest |
Description:
Extends the NonFungibleToken contract with methods for preventing transfer of used tickets:
bool IsUsed(UInt256 tokenId)
void MarkAsUsed(UInt256 tokenId)
It's different from #82
Compiler Version
Contract Hash
Contract Byte Code