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

Commit fb0aaa7

Browse files
authored
Updating the Licensing Image (#141)
* feat: license image change * nit: add license image asset * fix: license name
1 parent 843f419 commit fb0aaa7

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

assets/license-image.gif

7.51 MB
Loading

contracts/registries/LicenseRegistry.sol

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ import { DataUniqueness } from "../lib/DataUniqueness.sol";
1919
contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
2020
using Strings for *;
2121

22-
/// @dev Name of the License NFT
23-
string public name = "Story Protocol License NFT";
22+
/// @notice Emitted for metadata updates, per EIP-4906
23+
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
2424

25-
/// @dev Symbol of the License NFT
26-
string public symbol = "SPLNFT";
25+
/// @notice Name of the Programmable IP License NFT
26+
string public name = "Programmable IP License NFT";
27+
28+
/// @notice Symbol of the Programmable IP License NFT
29+
string public symbol = "PILNFT";
30+
31+
/// @notice URL of the Licensing Image
32+
string public imageUrl;
2733

2834
// TODO: deploy with CREATE2 to make this immutable
2935
/// @notice Returns the canonical protocol-wide LicensingModule
@@ -51,7 +57,9 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
5157
_;
5258
}
5359

54-
constructor(address governance) ERC1155("") Governable(governance) {}
60+
constructor(address governance, string memory url) ERC1155("") Governable(governance) {
61+
imageUrl = url;
62+
}
5563

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

84+
/// @dev Sets the Licensing Image URL.
85+
/// @dev Enforced to be only callable by the protocol admin
86+
/// @param url The URL of the Licensing Image
87+
function setLicensingImageUrl(string calldata url) external onlyProtocolAdmin {
88+
imageUrl = url;
89+
emit BatchMetadataUpdate(1, _mintedLicenses);
90+
}
91+
7692
/// @notice Mints license NFTs representing a policy granted by a set of ipIds (licensors). This NFT needs to be
7793
/// burned in order to link a derivative IP with its parents. If this is the first combination of policy and
7894
/// 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 {
188204
licensorIpIdHex,
189205
'",',
190206
// solhint-disable-next-line max-length
191-
'"image": "https://images.ctfassets.net/5ei3wx54t1dp/1WXOHnPLROsGiBsI46zECe/4f38a95c58d3b0329af3085b36d720c8/Story_Protocol_Icon.png",',
207+
'"image": "',
208+
imageUrl,
209+
'",',
192210
'"attributes": ['
193211
)
194212
);

script/foundry/deployment/Main.s.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ contract Main is Script, BroadcastManager, JsonDeploymentHandler {
207207

208208
contractKey = "LicenseRegistry";
209209
_predeploy(contractKey);
210-
licenseRegistry = new LicenseRegistry(address(governance));
210+
licenseRegistry = new LicenseRegistry(
211+
address(governance),
212+
"https://github.com/storyprotocol/protocol-core/blob/main/assets/license-image.gif"
213+
);
211214
_postdeploy(contractKey, address(licenseRegistry));
212215

213216
contractKey = "LicensingModule";

test/foundry/utils/DeployHelper.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ contract DeployHelper {
255255
console2.log("DeployHelper: Using REAL IPAssetRegistry");
256256

257257
if (d.licenseRegistry) {
258-
licenseRegistry = new LicenseRegistry(getGovernance());
258+
licenseRegistry = new LicenseRegistry(getGovernance(), "deploy helper");
259259
console2.log("DeployHelper: Using REAL LicenseRegistry");
260260
}
261261
}

0 commit comments

Comments
 (0)