Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Updating the Licensing Image #141

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/license-image.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 22 additions & 4 deletions contracts/registries/LicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ import { DataUniqueness } from "../lib/DataUniqueness.sol";
contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
using Strings for *;

/// @dev Name of the License NFT
/// @notice Emitted for metadata updates, per EIP-4906
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

/// @notice Name of the License NFT
string public name = "Story Protocol License NFT";
jdubpark marked this conversation as resolved.
Show resolved Hide resolved

/// @dev Symbol of the License NFT
/// @notice Symbol of the License NFT
string public symbol = "SPLNFT";
jdubpark marked this conversation as resolved.
Show resolved Hide resolved

/// @notice URL of the Licensing Image
string public imageUrl;

// TODO: deploy with CREATE2 to make this immutable
/// @notice Returns the canonical protocol-wide LicensingModule
ILicensingModule public LICENSING_MODULE;
Expand All @@ -51,7 +57,9 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
_;
}

constructor(address governance) ERC1155("") Governable(governance) {}
constructor(address governance, string memory url) ERC1155("") Governable(governance) {
imageUrl = url;
}

/// @dev Sets the DisputeModule address.
/// @dev Enforced to be only callable by the protocol admin
Expand All @@ -73,6 +81,14 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
LICENSING_MODULE = ILicensingModule(newLicensingModule);
}

/// @dev Sets the Licensing Image URL.
/// @dev Enforced to be only callable by the protocol admin
/// @param url The URL of the Licensing Image
function setLicensingImageUrl(string calldata url) external onlyProtocolAdmin {
imageUrl = url;
emit BatchMetadataUpdate(1, _mintedLicenses);
}

/// @notice Mints license NFTs representing a policy granted by a set of ipIds (licensors). This NFT needs to be
/// burned in order to link a derivative IP with its parents. If this is the first combination of policy and
/// licensors, a new licenseId will be created. If not, the license is fungible and an id will be reused.
Expand Down Expand Up @@ -188,7 +204,9 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
licensorIpIdHex,
'",',
// solhint-disable-next-line max-length
'"image": "https://images.ctfassets.net/5ei3wx54t1dp/1WXOHnPLROsGiBsI46zECe/4f38a95c58d3b0329af3085b36d720c8/Story_Protocol_Icon.png",',
'"image": "',
imageUrl,
'",',
'"attributes": ['
)
);
Expand Down
5 changes: 4 additions & 1 deletion script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ contract Main is Script, BroadcastManager, JsonDeploymentHandler {

contractKey = "LicenseRegistry";
_predeploy(contractKey);
licenseRegistry = new LicenseRegistry(address(governance));
licenseRegistry = new LicenseRegistry(
address(governance),
"https://github.com/storyprotocol/protocol-core/blob/main/assets/license-image.gif"
);
_postdeploy(contractKey, address(licenseRegistry));

contractKey = "LicensingModule";
Expand Down
2 changes: 1 addition & 1 deletion test/foundry/utils/DeployHelper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ contract DeployHelper {
console2.log("DeployHelper: Using REAL IPAssetRegistry");

if (d.licenseRegistry) {
licenseRegistry = new LicenseRegistry(getGovernance());
licenseRegistry = new LicenseRegistry(getGovernance(), "deploy helper");
console2.log("DeployHelper: Using REAL LicenseRegistry");
}
}
Expand Down
Loading