Prerequisites
- CDR SDK setup complete
@story-protocol/core-sdkinstalled if you plan to mint license tokens in code- Familiarity with IP Assets and License Tokens
Aeneid Contracts
How the DATA Foundation License Read Pattern Works
Every CDR vault has awriteConditionAddr and readConditionAddr. For a
DATA Foundation license-gated vault on Aeneid:
writeConditionAddrusually points atOwnerWriteCondition, withwriteConditionData = abi.encode(ownerAddress)readConditionAddrpoints atLicenseReadCondition, withreadConditionData = abi.encode(licenseTokenAddress, ipId)accessAuxDataat read time isabi.encode(uint256[] licenseTokenIds)
ipId with DATA Foundation tooling first, then configure
the vault.
If you have not registered the asset yet, start with
Register IP Asset. If you need
to attach or inspect license terms before minting, see
Attach Terms.
Upload a License-Gated Vault
The same condition setup works with
uploadFile() if the encrypted content
lives off-chain.Mint a License Token Before Reading
Before a user can read a DATA Foundation license-gated vault, they still need to mint a license token. The DATA Foundation core SDK’swipClient handles the WIP wrap and
approval steps so the reader can wrap IP, approve the RoyaltyModule, and mint
in three short calls.
WIP is Wrapped IP, the ERC-20 wrapped form of the native IP token.
the DATA Foundation’s royalty / license flows use WIP, so the reader first wraps IP, then
approves the RoyaltyModule to spend it.
licenseTermsId: 2054 is only an example. Replace it with the license terms
ID actually attached to your IP Asset. You receive that ID when you register
the asset or attach terms.The wrap, approve, and mint calls above are all on-chain transactions. The
later
accessCDR() call adds one more on-chain read request.Read With a License Token
At read time, pass the caller’s license token ID throughaccessAuxData.
Custom Condition Contracts
License gating is just one pattern. You can deploy your own condition contract for any access control logic by implementing one or both of these interfaces:write() or read() operation. Return true to allow, false to deny. Then pass your contract’s address as readConditionAddr or writeConditionAddr when allocating a vault.