CDR vaults can be gated behind Story Protocol license tokens so that only license holders can decrypt the vault contents. In the current Aeneid release, this is a manual integration: you encode the CDR condition data yourself and mint Story license tokens separately.Documentation Index
Fetch the complete documentation index at: https://docs.story.foundation/llms.txt
Use this file to discover all available pages before exploring further.
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
| Contract | Address |
|---|---|
| OwnerWriteCondition | 0x4C9bFC96d7092b590D497A191826C3dA2277c34B |
| LicenseReadCondition | 0xC0640AD4CF2CaA9914C8e5C44234359a9102f7a3 |
| LicenseToken | 0xFe3838BFb30B34170F00030B52eA4893d8aAC6bC |
How the Story License Read Pattern Works
Every CDR vault has awriteConditionAddr and readConditionAddr. For a
Story 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 Story 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 Story license-gated vault, they still need to mint a license token. The Story 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.
Story’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.
