Completed Code
All of this page is covered in this working code example.
- You simply want to “tip” an IP
- You have to because your license terms with an ancestor IP require you to forward a certain % of payment
payRoyaltyOnBehalf function. When this happens, the Royalty Module automatically handles the different payment flows such that parent IP Assets who have negotiated a certain commercialRevShare with the IPA being paid can claim their due share.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.- Complete the TypeScript SDK Setup
- Have a basic understanding of the Royalty Module
Before We Start
You can pay an IP Asset using thepayRoyaltyOnBehalf function.
You will be paying the IP Asset with $WIP. Note that if you don’t have enough $WIP, the function will auto wrap an equivalent amount of $IP into $WIP for you. If you don’t have enough of either, it will fail.
To help with the following scenarios, let’s say we have a parent IP Asset that has negotiated a 50% commercialRevShare with its child IP Asset.
Whitelisted Revenue Tokens
Only tokens that are whitelisted by our protocol can be used as payment (“revenue”) tokens. $WIP is one of those tokens. To see that list, go here.Scenario #1: Tipping an IP Asset
In this scenario, you’re an external 3rd-party user who wants to pay an IP Asset 2 $WIP for being cool. When you call the function below, you should makepayerIpId a zero address because you are not paying on behalf of an IP Asset. Additionally, you would set amount to 2.
Associated Docs:
royalty.payRoyaltyOnBehalf
main.ts
commercialRevShare, 50% of the revenue (2*0.5 = 1) would automatically be claimable by the parent thanks to the Royalty Module, such that both the parent and child IP Assets earn 1 $WIP. We’ll go over this on the next page.
Scenario #2: Paying Due Share
In this scenario, lets say a derivative IP Asset earned 2 USD off-chain. Because the derivative owes the parent IP Asset 50% of its revenue, it could give the parent 1 USD off-chain and be ok. Or, it can send 1 $USD equivalent to the parent on-chain (for this example, let’s just assume 1 $WIP = 1 USD).Associated Docs:
royalty.payRoyaltyOnBehalf
main.ts
Complex Royalty Graphs
Let’s say the child earned 1,000 USD off-chain, and is linked to a huge ancestor tree where each parent has a different set of complex license terms. In this scenario, you won’t be able to individually calculate each payment to each parent. Instead, you would just pay yourself the amount you earned, and the Royalty Module will automate the payment, such that each ancestor gets their due share.View Completed Code
Congratulations, you paid an IP Asset on-chain!Completed Code
All of this page is covered in this working code example.

