NFT that yield ERC20 tokens to holders each day

Hi guys, i want to create a smart contract that have a supply of x NFT what people can mint and every 24 hours the NFT holders get x amount of ERC20 tokens. Like Cyberkongz contract but without the breeding and other extra functions.
Thanks for the help!

I'm looking for something similar.

I want to be able to send ERC20 or ETH to the holder of a specific NFT. Whenever the NFT exchanges ownership, the new owner will receive the assets.

Are there any Open Zeppelin contracts that can be used for this type of functionality?

1 Like

Please post more details. What exactly is your question? The way you posted it is very generic.

Post the address of the contract you are basing on.

I already have a suggestion:

  • when the NFT switches ownership (this switch is a sellNFT function, for example), call a sendERC20 or sendETH function inside the swap function, and it will be she who will send the value to the new owner.
  • don't forget to set the ERC20 standard in your contract and inheritance the main contract as well.
  • sendETH will use transfer
  • sendERC20 will use transferFrom.

Post your code or what you have been able to do so far.