Skip to content

Commit

Permalink
Updating the Licensing Image (storyprotocol#141)
Browse files Browse the repository at this point in the history
* feat: license image change
* nit: add license image asset
* fix: license name
  • Loading branch information
jdubpark authored Feb 27, 2024
1 parent 843f419 commit fb0aaa7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
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.
30 changes: 24 additions & 6 deletions contracts/registries/LicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ import { DataUniqueness } from "../lib/DataUniqueness.sol";
contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable {
using Strings for *;

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

/// @dev Symbol of the License NFT
string public symbol = "SPLNFT";
/// @notice Name of the Programmable IP License NFT
string public name = "Programmable IP License NFT";

/// @notice Symbol of the Programmable IP License NFT
string public symbol = "PILNFT";

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

// TODO: deploy with CREATE2 to make this immutable
/// @notice Returns the canonical protocol-wide LicensingModule
Expand Down Expand Up @@ -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 fb0aaa7

Please sign in to comment.