4

Let's say I want to create a non-fungible token which represents a ticket to a venue. And I don't want ticket scalpers to buy tickets and resell these tickets for a higher price. It should only be possible to resell the ticket for the same or a lower price.

Does an ERC standard exist where one can set the maximum reselling price?

If not, how could this be achieved? The best way I can think of right now is to copy the ERC721 contract and modify the transfer function. But then I lose all the benefits from ERC721 compatibility...

3 Answers 3

1

TL;DR

Adding an additional function in an ERC-1155 contract that handles the issuance of the ERC-721 tokens it contains. This function would have logic to check the amount of ether being sent to a method. If it's not enough, mint fails. If it's just enough, mint goes through. If it's too much, mint occurs and sends the extra back (minus tx fees) to the owner.

Details

You will have to create an ERC-1155 collection responsible for minting the ERC-721 tokens and define custom logic for price. Any time mint, transfer, or transferTo is called on the NFT, it must call the collection which owns it to determine if the price is enough, right, or too much.

Use Cases

Your logic could be rigid, and place a hard cap on price, or dynamic to allow events like discounts to take place. Since your question is vague, I'll indulge both slightly.

A collection contains many ERC-721 NFTs which may have slightly different properties; a ticket would have metadata like _section, _seat, _gameId and _tokenId.

This is a novel area of development and ripe for improvisation and unique solutions. I would encourage you to think outside the box while working on this project.

Flexible

Unlike traditional markets, you don't need a counterparty to determine the price using this model. The price you get for an asset is determined by a formula. If I'm looking at a single source of ETH:DAI liquidity, and I want to buy all of the ETH, I could not, as each ETH purchased exponentially increases the price with zero as a limit, if either x or y reach zero, the equation doesn't work, our k value goes to zero, making the asset unbuyable.

Static Price

If you want a price set in stone with no change at all, collection need only to limit the maximum number of ETH that can be sent to call the mint function on an NFT within it, with remainder being returned to the purchasing account.

But right now, prices are not always set in stone. There are early bird specials, discounts for purchasing many tickets (e.g. company gatherings), and even discounts after an underwhelming sale to fill seats are all commonplace.

You could loosely define the value of something (arbitrarily) as:

Value = Utility + Ownership History + Future Value + Liquidity

A ticket's has high utility, low/no ownership history impact, no future value, and liquidity varies (depending on number of sold out tickets, hype surrounding the event, number of seats). Compared to a piece of art that's sold 100 times which has low utility, high ownership history, potential future value, and liquidity without an ending time.

Since ownership history and future value are not important for tickets, we have liquidity (availability) and demand.

Value = Availability / Demand

Where demand is dependent on availability. Your 1155 contract would set the initial demand value, and the availability is determined by the number of tokens not claimed by an address in the collection leading up to the event.

A fixed price requires less code, as you simply need to set it's value in the purchasing token. availability is not part of any equation and serves only to see the remaining number of tickets.

In the case of a fluctuating price, demand could be represented as a floating point variable between 0-1. When tickets first go on sale, demand starts at 1 as zero tickets have been minted. We can approach zero, but can never reach it even if there is no demand for tickets as it creates a mathematical impossibility. It is likely that demand will remain constant: people who want to go to something want to go to something regardless. If they can afford it, they'll go. The only thing this does is reduce the price proportionally depending on the number of requests for tickets, which is not unlike tickets to events today where promoters will give discounts just to fill the seats.

Setting the equation up like this also prevents the price from going above the sale price as you cap demand at 1 in the controlling contract. However, you could alter this and allow for some resale within a reasonable range. If it's last minute, sometimes ticket prices do go up (scalpers or not). Perhaps setting demand to a floating point value slightly above one would make more sense.

Note

If the NFT is controlled by an 1155 collection with custom logic, you can define any type of price issuance from fixed price to a bonding curve, or even lower the cost automatically if N number of tickets are still unsold X days prior to the event in order to sell out.

0

The ERC721 standard defines the token. Similarily ERC20 standard defines a different type of token. Neither of them define how the token is sold or under what circumstances it is transferred around - the standard simply enables transfers when needed.

So what typically happens is that a separate selling contract (or in the case of ERC20 ICOs - a crowdsale contract) is created. In the case of ERC20 the process is quite straightforward: initially the crowdsale contract holds all the tokens which are for sale and when someone sends Ethers to the contract is calls the token contract to transfer the appropriate amount of tokens to the buyer.

I'm not so familiar with the ways how ERC721 tokens are being sold but I'd imagine it's more one-off sales. So there's a selling contract where seller sends the token and says what price it wants for it. Then a buyer sends the requested amount of Ether to the contract and the contract calls the ERC721 token contract to transfer the token and transfers the Ethers to the buyer.

As for your specific case I'd suggest that you create a selling contract which simply doesn't allow reselling of the token for a higher price. That is, if the seller uses that contract - typically nothing prevents him from using any means he wants in selling the token. You could either write the token so that it allows transfers only from a certain address (the seller contract) and/or you can instruct your users to only sell their tokens through this one contract.

-2

Yes. You can do this. And this use case is supported by the standards.

If you are making something and need help call me.

3
  • This is an extremely interesting question, if you have something to contribute, please update your answer so the community can benefit. Commented Dec 22, 2020 at 2:27
  • This is a low-effort question. The asker did not show what they tried and where they failed. Typically, these low-quality questions can be on-topic on Ethereum Stack but they wouldn't last more than a few minutes on Stack Overflow until getting flagged. My answer doesn't give the answer to the non-question that was asked. But at least it's authoritative. Commented Jan 11, 2021 at 0:01
  • Normally I would agree that this is a very low quality question, however after taking into account the novelty and specificity of the subject matter, I think it at least warrants something informative. Commented Jan 13, 2021 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.