Combine all of our tutorials together in a practical example.
mintAndRegisterAndCreateTermsAndAttach
that allows you to mint & register a new IP Asset, register new License Terms, and attach those terms to an IP Asset. It will also accept a receiver
field to be the owner of the new IP Asset.
./src/Example.sol
and paste the following:
mintLicenseTokenAndRegisterDerivative
that allows a potentially different user to register their own “child” (derivative) IP Asset, mint a License Token from the “parent” (root) IP Asset, and register their child IPA as a derivative of the parent IPA. It will accept a few parameters:
parentIpId
: the ipId
of the parent IPAlicenseTermsId
: the id of the License Terms you want to mint a License Token forreceiver
: the owner of the child IPAExample.sol
contract, add the following function at the bottom:
test/Example.t.sol
and paste the following:
forge build
. If everything is successful, the command should successfully compile.
To test this out, simply run the following command:
--constructor-args
come from Deployed Smart Contracts.
Deployed to: 0xfb0923D531C1ca54AB9ee10CB8364b23d0C7F47d
in the console. Paste that address into the explorer and see your verified contract!