Attach Terms to an IPA
Learn how to attach License Terms to an IP Asset in Solidity.
Completed Code
Follow the completed code all the way through.
This section demonstrates how to attach License Terms to an IP Asset. By attaching terms, users can publicly mint License Tokens (the on-chain “license”) with those terms from the IP.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.
- Complete the Setup Your Own Project
- Create License Terms and have a
licenseTermsId
. You can do that by following the previous page.
Attach License Terms
Now that we have created terms and have the associated licenseTermsId
, we can attach them to an existing IP Asset.
Let’s create a test file under test/2_AttachTerms.t.sol
to see it work and verify the results:
Contract Addresses
We 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 Your Code!
Run forge build
. If everything is successful, the command should successfully compile.
Now run the test by executing the following command:
Mint a License
Congratulations, you attached terms to an IPA!
Completed Code
Follow the completed code all the way through.
Now that we have attached License Terms to our IP, the next step is minting a License Token, which we’ll go over on the next page.