Completed Code
Follow the completed code all the way through.
Prerequisites
There are a few steps you have to complete before you can start the tutorial.- Complete the Setup Your Own Project
Before We Start
It’s important to know that if License Terms already exist for the identical set of parameters you intend to create, it is unnecessary to create it again. License Terms are protocol-wide, so you can use existing License Terms by itslicenseTermsId
.
Register License Terms
You can view the full set of terms in PIL Terms. Let’s create a test file undertest/1_LicenseTerms.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/1_LicenseTerms.t.sol
PIL Flavors
As you see above, you have to choose between a lot of terms. We have convenience functions to help you register new terms. We have created PIL Flavors, which are pre-configured popular combinations of License Terms to help you decide what terms to use. You can view those PIL Flavors and then register terms using the following convenience functions:Non-Commercial Social Remixing
Free remixing with attribution. No commercialization.
Commercial Use
Pay to use the license with attribution, but don’t have to share revenue.
Commercial Remix
Pay to use the license with attribution and pay % of revenue earned.
Creative Commons Attribution
Free remixing and commercial use with attribution.
Solidity
Test Your Code!
Runforge build
. If everything is successful, the command should successfully compile.
Now run the test by executing the following command:
Attach Terms to Your IP
Congratulations, you created new license terms!Completed Code
Follow the completed code all the way through.