NiftyTap allows anyone to distribute holders of an NFT collection to any number of Superfluid token streams. Imagine the creators of an NFT art collection who want to airdrop streams of tokens to their holders or a clever promoter who wants to promote his product by incentivising holders of an NFT collection. Maybe advertise to Lens profile holders or ENS domain holders? There are many more possibilities not even thought of yet!
Anyone who wants to distribute some token using Superfluid constant flows can create a Tap using my smart contract. A tap is responsible for allowing a particular NFT collection's holders with claimable Superfluid streams. These streams are perpetual as long as the tap balance is maintained by the creator (of the tap). A holder can choose to claim any number of streams max up to the number of NFT token IDs they hold. Furthermore, if the holder transfers the NFT corresponding to which he claimed a stream, the new holder is eligible to claim a stream from a tap and the previous holder's streams will be adjusted accordingly.
There are a bunch of things which can be done:
And many more!
It was difficult to manage interactions between current holders of a particular NFT id and previous holders of the same token id as the contract can't react to NFT transfers. The solution is to track the token id holders optimistically. That is, whenever a current NFT id holder comes, we adjust the streams of immediately one previous holder.
Adjusting streams for current and previous holders of an id was a bit tricky and and involved a lot of calculations.
Technologies used
Discussion