Noob here.
What can I research to limit my ERC721 to holders of another NFT?
Noob here.
What can I research to limit my ERC721 to holders of another NFT?
I believe you can find relevant examples in this repo.
You could add a check in _beforeTokenTransfer
like require(otherNft.balanceOf(receiver) > 0)
.
But that doesn't guarantee that the receiver will continue being a holder of the other NFT. They may transfer it. If you want to limit it to continued holders of the other NFT, you could have a function that takes a token away from an account if it's observed not to be a holder of the other NFT, and transfers it to some central location perhaps. Though I find this mechanism a little controversial. It's hard to communicate transparently to buyers that what they're buying could be taken away.
Just going to answer my own question after digging in to solidity for a few weeks.
The answer for me was to add functions from the original ERC721 contract using 'interface'... and then checking that addresses are owners of the ERC721 before minting.