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

Commit

Permalink
feat: license image change
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark committed Feb 27, 2024
1 parent ac8377c commit 8c0f356
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
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";

/// @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;
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

0 comments on commit 8c0f356

Please sign in to comment.