Hi there, I want to use something like the crowdsale contract but for erc721. What approach should I follow? I saw this was scoped in this PR, but is stale atm(?
I’m learning and planned to build a lottery, where the tickets are NFTs. Using something similar to the crowdsale contract makes sense, right?
If you are selling NFTs, then using the equivalent of a crowdsale sounds like a viable option.
A user purchases a number of tokens (in this case NFTs) for a fixed price and is issued the tokens. (if the user overpays, then they can be refunded any over payment).
You could look at ERC721Metadata.baseURI in OpenZeppelin Contracts 2.5:
OpenZeppelin Contracts v2.5 ERC721Metadata.baseURI : a neat extension for massive gas savings when the token URIs share a prefix, like https://my.cool.app/token/<id>
In the lottery space, you could look at PoolTogether, which is a protocol that allows users to join a trust-minimized no-loss lottery on the Ethereum network. OpenZeppelin recently published an audit: https://blog.openzeppelin.com/pooltogether-audit/