This repository has been archived by the owner on Apr 30, 2024. It is now read-only.
generated from storyprotocol/solidity-template
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds metadata module and resolvers (#30)
* Adds metadata and resolver module * Fix linting * remove duplicate imports
- Loading branch information
Showing
27 changed files
with
970 additions
and
659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
contracts/interfaces/registries/metadata/IMetadataProvider.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf | ||
pragma solidity ^0.8.23; | ||
|
||
/// @title Metadata Provider Interface | ||
interface IMetadataProvider { | ||
|
||
/// @notice Gets the metadata associated with an IP asset. | ||
/// @param ipId The address identifier of the IP asset. | ||
function getMetadata(address ipId) external view returns (bytes memory); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf | ||
pragma solidity ^0.8.23; | ||
|
||
/// @title Key Value Resolver Interface | ||
interface IKeyValueResolver { | ||
|
||
/// @notice Emits when a new key-value pair is set for the resolver. | ||
event KeyValueSet( | ||
address indexed ipId, | ||
string indexed key, | ||
string value | ||
); | ||
|
||
/// @notice Retrieves the string value associated with a key for an IP asset. | ||
function value( | ||
address ipId, | ||
string calldata key | ||
) external view returns (string memory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,21 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf | ||
pragma solidity ^0.8.21; | ||
pragma solidity ^0.8.23; | ||
|
||
/// @title IP Library | ||
/// @notice Library for constants, structs, and helper functions used for IP. | ||
library IP { | ||
/// @notice Core metadata associated with an IP. | ||
/// @dev This is what is fetched when `metadata()` is called from an IP | ||
/// resolver, and includes aggregated attributes fetched from various | ||
/// modules in addition to that which is stored on the resolver itself. | ||
/// @notice Core metadata to associate with each IP. | ||
struct Metadata { | ||
// The current owner of the IP. | ||
address owner; | ||
// The name associated with the IP. | ||
string name; | ||
// A description associated with the IP. | ||
string description; | ||
// A keccak-256 hash of the IP content. | ||
bytes32 hash; | ||
// The date which the IP was registered. | ||
uint64 registrationDate; | ||
// The address of the initial IP registrant. | ||
address registrant; | ||
// The token URI associated with the IP. | ||
string uri; | ||
} | ||
|
||
/// @notice Core metadata exclusively saved by the IP resolver. | ||
/// @dev This only encompasses metadata which is stored on the IP metadata | ||
/// resolver itself, and does not include those attributes which may | ||
/// be fetched from different modules (e.g. the licensing modules). | ||
struct MetadataRecord { | ||
// The name associated with the IP. | ||
string name; | ||
// A description associated with the IP. | ||
string description; | ||
// A keccak-256 hash of the IP content. | ||
bytes32 hash; | ||
// The date which the IP was registered. | ||
uint64 registrationDate; | ||
// The address of the initial IP registrant. | ||
address registrant; | ||
// The token URI associated with the IP. | ||
// An external URI associated with the IP. | ||
string uri; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf | ||
pragma solidity ^0.8.21; | ||
pragma solidity ^0.8.23; | ||
|
||
// String values for core protocol modules. | ||
string constant METADATA_RESOLVER_MODULE_KEY = "METADATA_RESOLVER_MODULE"; | ||
string constant IP_RESOLVER_MODULE_KEY = "IP_RESOLVER_MODULE"; | ||
|
||
// String values for core protocol modules. | ||
string constant REGISTRATION_MODULE_KEY = "REGISTRATION_MODULE"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.