From 92adb728ba2209f08641b925331dd3f4cc3f3e98 Mon Sep 17 00:00:00 2001 From: Sebastian Liu Date: Tue, 20 Aug 2024 14:49:49 -0700 Subject: [PATCH 1/2] chore: add missing comments and duplicated asserts --- contracts/StoryProtocolGateway.sol | 2 ++ contracts/interfaces/IStoryProtocolGateway.sol | 1 + test/StoryProtocolGateway.t.sol | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/StoryProtocolGateway.sol b/contracts/StoryProtocolGateway.sol index b73b061..b6fa757 100644 --- a/contracts/StoryProtocolGateway.sol +++ b/contracts/StoryProtocolGateway.sol @@ -263,6 +263,7 @@ contract StoryProtocolGateway is IStoryProtocolGateway, ERC721Holder, AccessMana /// @param derivData The derivative data to be used for registerDerivative. /// @param nftMetadata OPTIONAL. The desired metadata for the newly minted NFT. /// @param ipMetadata OPTIONAL. The desired metadata for the newly registered IP. + /// @param recipient The address to receive the minted NFT. /// @return ipId The ID of the registered IP. /// @return tokenId The ID of the minted NFT. function mintAndRegisterIpAndMakeDerivative( @@ -556,6 +557,7 @@ contract StoryProtocolGateway is IStoryProtocolGateway, ERC721Holder, AccessMana /// @param licenseTemplate The address of the license template. /// @param licenseTermsId The ID of the license terms for the parent IP. /// @param amount The amount of licenses to mint. + /// @return The mint fee for the given parent IP. function _getMintFeeForSingleParent( address childIpId, address parentIpId, diff --git a/contracts/interfaces/IStoryProtocolGateway.sol b/contracts/interfaces/IStoryProtocolGateway.sol index f32a215..96439a1 100644 --- a/contracts/interfaces/IStoryProtocolGateway.sol +++ b/contracts/interfaces/IStoryProtocolGateway.sol @@ -136,6 +136,7 @@ interface IStoryProtocolGateway { /// @param derivData The derivative data to be used for registerDerivative. /// @param nftMetadata OPTIONAL. The desired metadata for the newly minted NFT. /// @param ipMetadata OPTIONAL. The desired metadata for the newly registered IP. + /// @param recipient The address to receive the minted NFT. /// @return ipId The ID of the registered IP. /// @return tokenId The ID of the minted NFT. function mintAndRegisterIpAndMakeDerivative( diff --git a/test/StoryProtocolGateway.t.sol b/test/StoryProtocolGateway.t.sol index a9c2e09..52392fc 100644 --- a/test/StoryProtocolGateway.t.sol +++ b/test/StoryProtocolGateway.t.sol @@ -594,7 +594,6 @@ contract StoryProtocolGatewayTest is BaseTest { assertTrue(ipAssetRegistry.isRegistered(ipIdChild)); assertEq(tokenIdChild, 2); assertMetadata(ipIdChild, ipMetadataDefault); - assertMetadata(ipIdChild, ipMetadataDefault); (address licenseTemplateChild, uint256 licenseTermsIdChild) = licenseRegistry.getAttachedLicenseTerms( ipIdChild, 0 From a267081c874d18fa90ea2f2af9ca07c81e6aec89 Mon Sep 17 00:00:00 2001 From: Sebastian Liu Date: Tue, 20 Aug 2024 14:50:37 -0700 Subject: [PATCH 2/2] fix(upgrade-script): remove create3 deployer --- script/UpgradeSPGNFT.s.sol | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/script/UpgradeSPGNFT.s.sol b/script/UpgradeSPGNFT.s.sol index f7c57b1..955e292 100644 --- a/script/UpgradeSPGNFT.s.sol +++ b/script/UpgradeSPGNFT.s.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.23; import { console2 } from "forge-std/console2.sol"; import { Script } from "forge-std/Script.sol"; -import { ICreate3Deployer } from "@create3-deployer/contracts/Create3Deployer.sol"; import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; @@ -19,9 +18,6 @@ import { JsonDeploymentHandler } from "./utils/JsonDeploymentHandler.s.sol"; contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, BroadcastManager, JsonDeploymentHandler { using StringUtil for uint256; - ICreate3Deployer private constant create3Deployer = ICreate3Deployer(0x384a891dFDE8180b054f04D66379f16B7a678Ad6); - uint256 private constant create3SaltSeed = 12; - StoryProtocolGateway private spg; SPGNFT private spgNftImpl; UpgradeableBeacon private spgNftBeacon; @@ -38,7 +34,7 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas spgNftBeacon = UpgradeableBeacon(spgNftBeaconAddr); _beginBroadcast(); - _deploySPGNFT(deployer); + _deploySPGNFT(); // Upgrade the collections via multisig (can't do here). // spg.upgradeCollections(address(spgNftImpl)); @@ -47,17 +43,12 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas _endBroadcast(); } - function _deploySPGNFT(address accessControlDeployer) private { + function _deploySPGNFT() private { _writeAddress("SPG", address(spg)); _writeAddress("SPGNFTBeacon", address(spgNftBeacon)); _predeploy("SPGNFTImpl"); - spgNftImpl = SPGNFT( - create3Deployer.deploy( - _getSalt(type(SPGNFT).name), - abi.encodePacked(type(SPGNFT).creationCode, abi.encode(address(spg))) - ) - ); + spgNftImpl = new SPGNFT(address(spg)); _postdeploy("SPGNFTImpl", address(spgNftImpl)); } @@ -69,8 +60,4 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas _writeAddress(contractKey, newAddress); console2.log(string.concat(contractKey, " deployed to:"), newAddress); } - - function _getSalt(string memory name) private view returns (bytes32 salt) { - salt = keccak256(abi.encode(name, create3SaltSeed)); - } }