# NFT that yield ERC20 tokens to holders each day

**URL:** <https://forum.openzeppelin.com/t/nft-that-yield-erc20-tokens-to-holders-each-day/22776>\
**Category:** Smart Contracts\
**Tags:** erc20, erc721\
**Created:** [January 16, 2022, 11:22am UTC](https://forum.openzeppelin.com/t/nft-that-yield-erc20-tokens-to-holders-each-day/22776 "2022-01-16T11:22:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudicslevente](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dudicslevente](https://forum.openzeppelin.com/u/dudicslevente)\
**Post date:** [January 16, 2022, 11:22am UTC](https://forum.openzeppelin.com/t/nft-that-yield-erc20-tokens-to-holders-each-day/22776/1 "2022-01-16T11:22:00Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![banks305](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/banks305/32/12359_2.png) [@banks305](https://forum.openzeppelin.com/u/banks305)\
**Post date:** [January 16, 2022, 11:22pm UTC](https://forum.openzeppelin.com/t/nft-that-yield-erc20-tokens-to-holders-each-day/22776/2 "2022-01-16T23:22:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![defitokens](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/defitokens/32/14539_2.png) [@defitokens](https://forum.openzeppelin.com/u/defitokens)\
**Post date:** [April 22, 2022, 2:13pm UTC](https://forum.openzeppelin.com/t/nft-that-yield-erc20-tokens-to-holders-each-day/22776/3 "2022-04-22T14:13:01Z")

</div>

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.
