Completed Code
Follow the completed code all the way through.
- To hold the license and be able to use the underlying IP Asset as the license described (for ex. “Can use commercially as long as you provide proper attribution and share 5% of your revenue)
- Use the license token to link another IP Asset as a derivative of it. Note though that, as you’ll see later, some SDK functions don’t require you to explicitly mint a license token first in order to register a derivative, and will actually handle it for you behind the scenes.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.- Complete the Setup Your Own Project
- An IP Asset has License Terms attached to it. You can learn how to do that here
Mint License
Let’s say that IP Asset (ipId = 0x01
) has License Terms (licenseTermdId = 10
) attached to it. We want to mint 2 License Tokens with those terms to a specific wallet address (0x02
).
Paid LicensesBe mindful that some IP Assets may have license terms attached that require the user minting the license to pay a
mintingFee
.test/3_LicenseToken.t.sol
to see it work and verify the results:
Contract AddressesWe have filled in the addresses from the Story contracts for you. However you can also find the addresses for them here: Deployed Smart Contracts
test/3_LicenseToken.t.sol
Test Your Code!
Runforge build
. If everything is successful, the command should successfully compile.
Now run the test by executing the following command:
Register a Derivative
Completed Code
Follow the completed code all the way through.