1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00
docs/developers/contracts/revenue.md
2023-07-15 15:06:28 +03:00

3.6 KiB

description
Explore and manage the revenue generated from your data NFTs.

Revenue

Having a data NFT that generates revenue continuously, even when you're not actively involved, is an excellent source of income. This revenue stream allows you to earn consistently without actively dedicating your time and effort. Each time someone buys access to your NFT, you receive money, further enhancing the financial benefits. This steady income allows you to enjoy the rewards of your asset while minimizing the need for constant engagement💰

Make it rain

By default, the revenue generated from a data NFT is directed to the owner of the NFT. This arrangement automatically updates whenever the data NFT is transferred to a new owner. C

However, there are scenarios where you may prefer the revenue to be sent to a different account instead of the owner. This can be accomplished by designating a new payment collector. This feature becomes particularly beneficial when the data NFT is owned by an organization or enterprise rather than an individual.

{% hint style="info" %} There are two templates available: ERC20Template and ERC20TemplateEnterprise.

In the case of ERC20TemplateEnterprise, when you deploy a fixed rate exchange, the funds generated as revenue are automatically sent to the owner's address. The owner receives the revenue without any manual intervention.

On the other hand, with ERC20Template, for a fixed rate exchange, the revenue is available at the fixed rate exchange level. The owner or the payment collector has the authority to manually retrieve the revenue. {% endhint %}

There are several methods available for establishing a new payment collector. You have the option to utilize the ERC20Template/ERC20TemplateEnterprise contract directly. Another approach is to leverage the ocean.py and ocean.js libraries. Alternatively, you can employ the network explorer associated with your asset. Lastly, you can directly set it up within the Ocean Market.

Here are some examples of how to set up a new payment collector using the mentioned methods:

  1. Using Ocean.js.
datatokenAddress = 'Your datatoken address'
paymentCollectorAddress = 'New payment collector address'

await datatoken.setPaymentCollector(datatokenAddress, callerAddress, paymentCollectorAddress)
  1. Using Ocean.py.
datatokenAddress = 'Your datatoken address'
paymentCollectorAddress = 'New payment collector address'

datatoken.setPaymentCollector(paymentCollectorAddress, {"from": publisher_wallet})
  1. Using the Ocean Market.

Go to the asset detail page and then click on “Edit Asset” and then scroll down to the field called “Payment Collector Address”. Add the new Ethereum address in this field and then click “Submit“. Finally, you will then need to sign two transactions to finalize the update.

Update payment collector