diff --git a/contracts/registries/LicenseRegistry.sol b/contracts/registries/LicenseRegistry.sol index b007b8638..20f8de102 100644 --- a/contracts/registries/LicenseRegistry.sol +++ b/contracts/registries/LicenseRegistry.sol @@ -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"; - /// @dev Symbol of the License NFT + /// @notice Symbol of the License NFT string public symbol = "SPLNFT"; + /// @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; @@ -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 @@ -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. @@ -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": [' ) ); diff --git a/script/foundry/deployment/Main.s.sol b/script/foundry/deployment/Main.s.sol index 5f9f016e9..85a14951a 100644 --- a/script/foundry/deployment/Main.s.sol +++ b/script/foundry/deployment/Main.s.sol @@ -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"; diff --git a/test/foundry/utils/DeployHelper.t.sol b/test/foundry/utils/DeployHelper.t.sol index 712e73e06..e956e4478 100644 --- a/test/foundry/utils/DeployHelper.t.sol +++ b/test/foundry/utils/DeployHelper.t.sol @@ -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"); } }