Storage provider for Story Protocol canonical IP metadata (v1).
constructor(address ipAssetRegistry) public
Initializes the metadata provider contract.
Name | Type | Description |
---|
ipAssetRegistry | address | The protocol-wide IP asset registry. |
function metadata(address ipId) external view returns (struct IP.MetadataV1)
Fetches the metadata linked to an IP asset.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | struct IP.MetadataV1 | metadata The metadata linked to the IP asset. |
function name(address ipId) external view returns (string)
Gets the name associated with the IP asset.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | string | name The name associated with the IP asset. |
function hash(address ipId) external view returns (bytes32)
Gets the hash associated with the IP asset.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | bytes32 | hash The hash associated with the IP asset. |
function registrationDate(address ipId) external view returns (uint64)
Gets the date in which the IP asset was registered.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | uint64 | registrationDate The date in which the IP asset was registered. |
function registrant(address ipId) external view returns (address)
Gets the initial registrant address of the IP asset.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | address | registrant The initial registrant address of the IP asset. |
function uri(address ipId) external view returns (string)
Gets the external URI associated with the IP asset.
Name | Type | Description |
---|
ipId | address | The address identifier of the IP asset. |
Name | Type | Description |
---|
[0] | string | uri The external URI associated with the IP asset. |
function _verifyMetadata(bytes data) internal virtual
Checks that the data conforms to the canonical metadata standards.
Name | Type | Description |
---|
data | bytes | The canonical metadata in bytes to verify. |
function _compatible(bytes m1, bytes m2) internal pure virtual returns (bool)
Checks whether two sets of metadata are compatible with one another.
TODO: Add try-catch for ABI-decoding error handling.
function _hash(struct IP.MetadataV1 data) internal pure returns (bytes32)
Gets the bytes32 hash for a MetadataV1 data struct.
function _metadataV1(address ipId) internal view returns (struct IP.MetadataV1)
Get the decoded canonical metadata belonging to an IP asset.