From 1a902d0835f1c1c9a36b8c3f218936fc7cfffdd5 Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 13:39:14 -0600 Subject: [PATCH 01/11] fix: owner, name, and symbol for OpenSea rendering --- contracts/registries/LicenseRegistry.sol | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/contracts/registries/LicenseRegistry.sol b/contracts/registries/LicenseRegistry.sol index 5d481f0a..aae56e34 100644 --- a/contracts/registries/LicenseRegistry.sol +++ b/contracts/registries/LicenseRegistry.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; +import { Ownable, Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol"; import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; @@ -16,9 +17,15 @@ import { DataUniqueness } from "../lib/DataUniqueness.sol"; /// @title LicenseRegistry aka LNFT /// @notice Registry of License NFTs, which represent licenses granted by IP ID licensors to create derivative IPs. -contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable { +contract LicenseRegistry is ILicenseRegistry, ERC1155, Ownable2Step, Governable { using Strings for *; + /// @dev Name of the License NFT + string public name = "Story Protocol License NFT"; + + /// @dev Symbol of the License NFT + string public symbol = "SPLNFT"; + // TODO: deploy with CREATE2 to make this immutable /// @notice Returns the canonical protocol-wide LicensingModule ILicensingModule public LICENSING_MODULE; @@ -45,7 +52,7 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable { _; } - constructor(address governance) ERC1155("") Governable(governance) {} + constructor(address governance) ERC1155("") Ownable(msg.sender) Governable(governance) {} /// @dev Sets the DisputeModule address. /// @dev Enforced to be only callable by the protocol admin @@ -174,7 +181,9 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable { string memory json = string( abi.encodePacked( "{", - '"name": "Story Protocol License NFT",', + '"name": "Story Protocol License #', + id.toString(), + '",', '"description": "License agreement stating the terms of a Story Protocol IPAsset",', '"external_url": "https://protocol.storyprotocol.xyz/ipa/', licensorIpIdHex, From cd43bb31cd68798af2b98474c04cb0344fb69715 Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 13:39:35 -0600 Subject: [PATCH 02/11] fix: beta-rc4 deployment --- CHANGELOG.md | 42 +++++++++++++++++++++++++++ deploy-out/deployment-11155111.json | 44 ++++++++++++++--------------- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf8717c2..569bd8d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # CHANGELOG +## Beta release (beta-rc4) + +This release marks the official beta release of core protocol. + +- Integrate the Royalty and Licensing system with new royalty policy (#99) + +- Integrate the Dispute and Licensing system (#93) + +- Introduce a new Royalty Policy (LAP) for on-chain royalty system (#99, #106) + +- Introduce working registration features in IP Asset Registry for registering IP assets, backward compatible with Registration Module (#74, #89) + +- Support upfront fee payment on license minting (#113) + +- Enhance Modules with Type Support and Introduce Hook Module (#85) + +- Enhance Security by Adding Owner Restriction to Permissions (#104) + +- Unify the unit and integration testing with a modular test framework (#90) + +- Change to configurations and linting (300b0c5, #86) + +- Change absolute to relative imports (#82, #96) + +- Fix logic around license derivatives (#112) + +- Fix Caller Parameter in PFM verify (#119) + +- Refactor Initialization process of IPAccount registration (#108) + +- Clean up and Minimize Base Module Attributes (#81) + +- Clean up NatSpec, comments, and standards (#109) + +- Add more unit and integration tests (#90, #114) + +- Miscellaneous changes (#79, #83, #88, #91, #92, #97, #115) + ## Beta-rc3 This release finalizes the external-facing implementation of core modules and registries, as well as the public interfaces and events. @@ -19,6 +57,8 @@ This release finalizes the external-facing implementation of core modules and re - Review interfaces, events, and variables (#76) and GitHub PR actions (#36, #58) - Refactor contracts for relative imports (#75) +Full Changelog: [beta-rc2...beta-rc3](https://github.com/storyprotocol/protocol-core/compare/beta-rc2...beta-rc3) + ## Beta-rc2 This release introduces new modules, registries, libraries, and other logics into the protocol. @@ -33,4 +73,6 @@ This release introduces new modules, registries, libraries, and other logics int - Enhance the deployment script & post-deployment interactions, as well as the Integration tests to capture more use-case flows (#33) - Enhance the Unit tests for better coverage (#29, #30, #35) +Full Changelog: [beta-rc1...beta-rc2](https://github.com/storyprotocol/protocol-core/compare/d0df7d4...beta-rc2) + ## Beta-rc1 diff --git a/deploy-out/deployment-11155111.json b/deploy-out/deployment-11155111.json index 856e4882..9dc08945 100644 --- a/deploy-out/deployment-11155111.json +++ b/deploy-out/deployment-11155111.json @@ -1,26 +1,26 @@ { "main": { - "AccessController": "0x2F5e751a01F2385d10e044A7FFC25d997DC6f09E", - "AncestorsVaultLAP": "0x1CDffcc14aA77F85101D96949D49B73e40aC9F98", - "ArbitrationPolicySP": "0xa765b52023B21D90ee49498b3cCabFF6a26a0a52", - "DisputeModule": "0x7D0aDeCF1cB4EB2A7430Af5d63eC06df49D8BA4c", - "Governance": "0xE887083e1900001eF106e48bedB36218575ce446", - "IPAccountImpl": "0x05928C75d7304f2F020D604c48035d66CF97f48F", - "IPAccountRegistry": "0xFea427d6d3C4f86631b7AE3DA04612f4097F4753", - "IPAssetRegistry": "0xD30f3199a2E1C0d2b1A53BdeCFC9660Fd0A6E1b6", - "IPAssetRenderer": "0xf2f52517C74865A099E55D89205a1d8d24542ec8", - "IPMetadataProvider": "0xa93E1499134E78E79874aC213E7275766adb9fb0", - "IPResolver": "0xC09b861E1Be9854852161966Bdb88D8fdC3f9A8D", - "LicenseRegistry": "0xe6B99A2AEbb75cED30B588296c6C6D0e41EF5c54", - "LicensingModule": "0xE582a031190C9Dc91ad032605fD5ad71855F733b", - "MockERC20": "0x6d94B2d71d4aE81f8495c212FCc885694723FaF7", - "MockERC721": "0x1be8EE9E08e1eB631eEe27fAe9b2A7840b5a5E3a", - "MockTokenGatedHook": "0x8f5370135B7769e8E48c6c868bf8B69168c920b4", - "ModuleRegistry": "0x3083B93552df047b6d865597b7D37fb018a669C9", - "PILPolicyFrameworkManager": "0xB7E30f33aaAA61cBb0F6dbd815a898Fc3e0a3bA6", - "RegistrationModule": "0x8dC88927Bf6F8c5b5B902C04E2C4d24D5257441c", - "RoyaltyModule": "0xfeCfDF6278610Cad238844A3A3679446E00d6fee", - "RoyaltyPolicyLAP": "0x93eCDdB4d8Ad5662103A58230Eb14Cc4E3CA278f", - "TaggingModule": "0x385AfC3112AeF16E49ffEc9C59b9598c87D7c2Cd" + "AccessController": "0xDE52F5103e8E81988Ea6f2e7f111D4D1033cD511", + "AncestorsVaultLAP": "0x11fA3dAF418DdB408D1770ff0Cca913034922F8D", + "ArbitrationPolicySP": "0xAba6FD307Ae647e4fC345Bd3bAF0bcE03F879A87", + "DisputeModule": "0x4703ec1A6Dc1536CAEE8f0a7922F8a0335Eaff8D", + "Governance": "0xADF008aD48CB800f39CA58c0F3F5231225301383", + "IPAccountImpl": "0x041C77F067C716eE3a0e200ED60Ed45a78ff7c53", + "IPAccountRegistry": "0x1AFcfa8FE8c13747b574894a3EE9D663697E96b9", + "IPAssetRegistry": "0x7B3ad84983a4e926326e5d64380F7F1ddf06cFC7", + "IPAssetRenderer": "0x200Ff773A2e935537daD6379d2004B28a6274C44", + "IPMetadataProvider": "0xCEBe37B1486c6f20cd2d3be73a7178C2DFDD912d", + "IPResolver": "0x7eb182e4a63e8423977f1df27E8Ef800e05bBcba", + "LicenseRegistry": "0xA4f9263EC7251743cF301e8c160cB5F71A743671", + "LicensingModule": "0xeDae9944c4A591e165A79A0888396EE4f2764e59", + "MockERC20": "0x04f879fCC335A4d36dC6ab850023e7690985c8aa", + "MockERC721": "0xE01e9993496944f4bEe5b2b49169743312Fe63dF", + "MockTokenGatedHook": "0x8Eeb3D9bFBa90c4A065c5E9801d0F7c9c207500E", + "ModuleRegistry": "0xA50d85d4A5F41827eaae43cC269a678C1756A205", + "PILPolicyFrameworkManager": "0xD710E6A831A3d5861C9e763976880E4da09D0Bc9", + "RegistrationModule": "0x645F00b4E246e854df451066FD6F9959f6746Fad", + "RoyaltyModule": "0xf671EcC05b91a19cB0c9C3d0e6c9E14255BC63bb", + "RoyaltyPolicyLAP": "0xc2D953B7849811C27D61640f52b33c7dBD0Abb66", + "TaggingModule": "0x9DC6d1B816CA15bf3E3247FAe1Fa36B554e57788" } } \ No newline at end of file From 872389e3baf5c43d8192fd86895c886b25d911a1 Mon Sep 17 00:00:00 2001 From: Spablob Date: Sun, 18 Feb 2024 13:15:58 -0800 Subject: [PATCH 03/11] fix royalty related comments --- .../royalty/policies/IAncestorsVaultLAP.sol | 10 ++--- .../royalty/policies/IRoyaltyPolicy.sol | 10 ++--- .../royalty/policies/IRoyaltyPolicyLAP.sol | 41 +++++++++++-------- .../modules/royalty-module/RoyaltyModule.sol | 4 +- .../policies/AncestorsVaultLAP.sol | 13 +++--- .../policies/RoyaltyPolicyLAP.sol | 37 +++++++++-------- 6 files changed, 62 insertions(+), 53 deletions(-) diff --git a/contracts/interfaces/modules/royalty/policies/IAncestorsVaultLAP.sol b/contracts/interfaces/modules/royalty/policies/IAncestorsVaultLAP.sol index a6621906..2d3880ad 100644 --- a/contracts/interfaces/modules/royalty/policies/IAncestorsVaultLAP.sol +++ b/contracts/interfaces/modules/royalty/policies/IAncestorsVaultLAP.sol @@ -17,11 +17,11 @@ interface IAncestorsVaultLAP { /// @notice Returns the canonical RoyaltyPolicyLAP function ROYALTY_POLICY_LAP() external view returns (IRoyaltyPolicyLAP); - /// @notice Allows an ancestor IP asset to claim their Royalty NFTs and accrued royalties - /// @param ipId The ipId of the IP asset - /// @param claimerIpId The ipId of the claimer - /// @param ancestors The ancestors of the IP - /// @param ancestorsRoyalties The royalties of the ancestors + /// @notice Claims all available royalty nfts and accrued royalties for an ancestor of a given ipId + /// @param ipId The ipId of the ancestors vault to claim from + /// @param claimerIpId The claimer ipId is the ancestor address that wants to claim + /// @param ancestors The ancestors for the selected ipId + /// @param ancestorsRoyalties The royalties of the ancestors for the selected ipId /// @param withdrawETH Indicates if the claimer wants to withdraw ETH /// @param tokens The ERC20 tokens to withdraw function claim( diff --git a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicy.sol b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicy.sol index 04426c45..fc53d79f 100644 --- a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicy.sol +++ b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicy.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.23; interface IRoyaltyPolicy { /// @notice Executes royalty related logic on minting a license /// @dev Enforced to be only callable by RoyaltyModule - /// @param ipId The children ipId that is being linked to parents + /// @param ipId The ipId whose license is being minted (licensor) /// @param licenseData The license data custom to each the royalty policy /// @param externalData The external data custom to each the royalty policy function onLicenseMinting(address ipId, bytes calldata licenseData, bytes calldata externalData) external; @@ -13,7 +13,7 @@ interface IRoyaltyPolicy { /// @notice Executes royalty related logic on linking to parents /// @dev Enforced to be only callable by RoyaltyModule /// @param ipId The children ipId that is being linked to parents - /// @param parentIpIds The selected parent ipIds + /// @param parentIpIds The parent ipIds that the children ipId is being linked to /// @param licenseData The license data custom to each the royalty policy /// @param externalData The external data custom to each the royalty policy function onLinkToParents( @@ -23,9 +23,9 @@ interface IRoyaltyPolicy { bytes calldata externalData ) external; - /// @notice Allows the caller to pay royalty to the given IP asset - /// @param caller The caller - /// @param ipId The ID of the IP asset + /// @notice Allows the caller to pay royalties to the given IP asset + /// @param caller The caller is the address from which funds will transferred from + /// @param ipId The ipId of the receiver of the royalties /// @param token The token to pay /// @param amount The amount to pay function onRoyaltyPayment(address caller, address ipId, address token, uint256 amount) external; diff --git a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol index 82f411fe..4d394b28 100644 --- a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol +++ b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol @@ -8,12 +8,12 @@ import { IRoyaltyPolicy } from "../../../../interfaces/modules/royalty/policies/ /// @title RoyaltyPolicy interface interface IRoyaltyPolicyLAP is IRoyaltyPolicy { struct InitParams { - address[] targetAncestors; // the expected ancestors of an ipId - uint32[] targetRoyaltyAmount; // the expected royalties of each of the ancestors for an ipId - address[] parentAncestors1; // all the ancestors of the first parent - address[] parentAncestors2; // all the ancestors of the second parent - uint32[] parentAncestorsRoyalties1; // the royalties of each of the ancestors for the first parent - uint32[] parentAncestorsRoyalties2; // the royalties of each of the ancestors for the second parent + address[] targetAncestors; // the expected ancestors addresses of an ipId + uint32[] targetRoyaltyAmount; // the expected royalties of each of the ancestors for a given ipId + address[] parentAncestors1; // addresses of the ancestors of the first parent + address[] parentAncestors2; // addresses of the the ancestors of the second parent + uint32[] parentAncestorsRoyalties1; // the royalties of each of the first parent ancestors + uint32[] parentAncestorsRoyalties2; // the royalties of each of the second parent ancestors } /// @notice Event emitted when a policy is initialized @@ -34,11 +34,11 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { /// @notice Returns the royalty data for a given IP asset /// @param ipId The ID of the IP asset - /// @return isUnlinkable Indicates if the ipId is unlinkable - /// @return splitClone The split clone address - /// @return ancestorsVault The ancestors vault address - /// @return royaltyStack The royalty stack - /// @return ancestorsHash The unique ancestors hash + /// @return isUnlinkable Indicates if the ipId is unlinkable to new parents + /// @return splitClone The address of the liquid split clone contract for a given ipId + /// @return ancestorsVault The address of the ancestors vault contract for a given ipId + /// @return royaltyStack The royalty stack for a given ipId is the sum of the royalties to be paid to all its ancestors + /// @return ancestorsHash The hash of the unique ancestors addresses and royalties arrays function royaltyData( address ipId ) @@ -79,10 +79,12 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { /// @notice Distributes funds internally so that accounts holding the royalty nfts at distribution moment can /// claim afterwards - /// @param ipId The ipId + /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call + /// claimFromIpPoolAsTotalRnftOwner() instead + /// @param ipId The ipId whose received funds will be distributed /// @param token The token to distribute /// @param accounts The accounts to distribute to - /// @param distributorAddress The distributor address + /// @param distributorAddress The distributor address (if any) function distributeIpPoolFunds( address ipId, address token, @@ -91,22 +93,25 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { ) external; /// @notice Claims the available royalties for a given address + /// @dev If there are no funds available in split main contract but there are funds in the split clone contract + /// then a distributeIpPoolFunds() call should precede this call /// @param account The account to claim for /// @param withdrawETH The amount of ETH to withdraw /// @param tokens The tokens to withdraw function claimFromIpPool(address account, uint256 withdrawETH, ERC20[] calldata tokens) external; /// @notice Claims the available royalties for a given address that holds all the royalty nfts of an ipId - /// @param ipId The ipId + /// @dev This call will revert if the caller does not hold all the royalty nfts of the ipId + /// @param ipId The ipId whose received funds will be distributed /// @param withdrawETH The amount of ETH to withdraw /// @param token The token to withdraw function claimFromIpPoolAsTotalRnftOwner(address ipId, uint256 withdrawETH, address token) external; /// @notice Claims all available royalty nfts and accrued royalties for an ancestor of a given ipId - /// @param ipId The ipId - /// @param claimerIpId The claimer ipId - /// @param ancestors The ancestors of the IP - /// @param ancestorsRoyalties The royalties of the ancestors + /// @param ipId The ipId of the ancestors vault to claim from + /// @param claimerIpId The claimer ipId is the ancestor address that wants to claim + /// @param ancestors The ancestors for the selected ipId + /// @param ancestorsRoyalties The royalties of the ancestors for the selected ipId /// @param withdrawETH Indicates if the claimer wants to withdraw ETH /// @param tokens The ERC20 tokens to withdraw function claimFromAncestorsVault( diff --git a/contracts/modules/royalty-module/RoyaltyModule.sol b/contracts/modules/royalty-module/RoyaltyModule.sol index 397b91e3..592901e8 100644 --- a/contracts/modules/royalty-module/RoyaltyModule.sol +++ b/contracts/modules/royalty-module/RoyaltyModule.sol @@ -132,8 +132,8 @@ contract RoyaltyModule is IRoyaltyModule, Governable, ReentrancyGuard, BaseModul } /// @notice Allows the function caller to pay royalties to the receiver IP asset on behalf of the payer IP asset. - /// @param receiverIpId The ID of the IP asset that receives the royalties - /// @param payerIpId The ID of the IP asset that pays the royalties + /// @param receiverIpId The ipId that receives the royalties + /// @param payerIpId The ipId that pays the royalties /// @param token The token to use to pay the royalties /// @param amount The amount to pay function payRoyaltyOnBehalf( diff --git a/contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol b/contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol index 38ced787..cd118e4a 100644 --- a/contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol +++ b/contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol @@ -15,7 +15,7 @@ import { ArrayUtils } from "../../../lib/ArrayUtils.sol"; import { Errors } from "../../../lib/Errors.sol"; /// @title Liquid Absolute Percentage Policy Ancestors Vault -/// @notice The ancestors vault allows parents and grandparents to claim their share +/// @notice The ancestors vault allows parents and grandparents to claim their share of /// the royalty nfts of their children and grandchildren along with any accrued royalties. contract AncestorsVaultLAP is IAncestorsVaultLAP, ERC1155Holder, ReentrancyGuard { using SafeERC20 for IERC20; @@ -32,12 +32,11 @@ contract AncestorsVaultLAP is IAncestorsVaultLAP, ERC1155Holder, ReentrancyGuard ROYALTY_POLICY_LAP = IRoyaltyPolicyLAP(royaltyPolicyLAP); } - // TODO: double check everything given this is a permissionless call - /// @notice Allows an ancestor IP asset to claim their Royalty NFTs and accrued royalties - /// @param ipId The ipId of the IP asset - /// @param claimerIpId The ipId of the claimer - /// @param ancestors The ancestors of the IP - /// @param ancestorsRoyalties The royalties of the ancestors + /// @notice Claims all available royalty nfts and accrued royalties for an ancestor of a given ipId + /// @param ipId The ipId of the ancestors vault to claim from + /// @param claimerIpId The claimer ipId is the ancestor address that wants to claim + /// @param ancestors The ancestors for the selected ipId + /// @param ancestorsRoyalties The royalties of the ancestors for the selected ipId /// @param withdrawETH Indicates if the claimer wants to withdraw ETH /// @param tokens The ERC20 tokens to withdraw function claim( diff --git a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol index 5261eca1..556d50d5 100644 --- a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol +++ b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol @@ -27,8 +27,8 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @param isUnlinkableToParents Indicates if the ipId is unlinkable to new parents /// @param splitClone The address of the liquid split clone contract for a given ipId /// @param ancestorsVault The address of the ancestors vault contract for a given ipId - /// @param royaltyStack The royalty stack for a given ipId is the sum of the royalties to be paid to all its parents - /// @param ancestorsHash The hash of the unique ancestors array + /// @param royaltyStack The royalty stack for a given ipId is the sum of the royalties to be paid to all its ancestors + /// @param ancestorsHash The hash of the unique ancestors addresses and royalties arrays struct LAPRoyaltyData { bool isUnlinkableToParents; address splitClone; @@ -103,7 +103,7 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @notice Executes royalty related logic on minting a license /// @dev Enforced to be only callable by RoyaltyModule - /// @param ipId The children ipId that is being linked to parents + /// @param ipId The ipId whose license is being minted (licensor) /// @param licenseData The license data custom to each the royalty policy /// @param externalData The external data custom to each the royalty policy function onLicenseMinting( @@ -146,7 +146,7 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @notice Executes royalty related logic on linking to parents /// @dev Enforced to be only callable by RoyaltyModule /// @param ipId The children ipId that is being linked to parents - /// @param parentIpIds The selected parent ipIds + /// @param parentIpIds The parent ipIds that the children ipId is being linked to /// @param licenseData The license data custom to each the royalty policy /// @param externalData The external data custom to each the royalty policy function onLinkToParents( @@ -162,8 +162,8 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @dev Initializes the royalty policy for a given IP asset. /// @dev Enforced to be only callable by RoyaltyModule - /// @param ipId The ipId - /// @param parentIpIds The selected parent ipIds + /// @param ipId The to initialize the policy for + /// @param parentIpIds The parent ipIds that the children ipId is being linked to (if any) /// @param licenseData The license data custom to each the royalty policy /// @param externalData The external data custom to each the royalty policy function _initPolicy( @@ -216,9 +216,9 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent ); } - /// @notice Allows the caller to pay royalty to the given IP asset - /// @param caller The caller - /// @param ipId The ID of the IP asset + /// @notice Allows the caller to pay royalties to the given IP asset + /// @param caller The caller is the address from which funds will transferred from + /// @param ipId The ipId of the receiver of the royalties /// @param token The token to pay /// @param amount The amount to pay function onRoyaltyPayment(address caller, address ipId, address token, uint256 amount) external onlyRoyaltyModule { @@ -228,10 +228,12 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @notice Distributes funds internally so that accounts holding the royalty nfts at distribution moment can /// claim afterwards - /// @param ipId The ipId + /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call + /// claimFromIpPoolAsTotalRnftOwner() instead + /// @param ipId The ipId whose received funds will be distributed /// @param token The token to distribute /// @param accounts The accounts to distribute to - /// @param distributorAddress The distributor address + /// @param distributorAddress The distributor address (if any) function distributeIpPoolFunds( address ipId, address token, @@ -242,6 +244,8 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent } /// @notice Claims the available royalties for a given address + /// @dev If there are no funds available in split main contract but there are funds in the split clone contract + /// then a distributeIpPoolFunds() call should precede this call /// @param account The account to claim for /// @param withdrawETH The amount of ETH to withdraw /// @param tokens The tokens to withdraw @@ -250,7 +254,8 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent } /// @notice Claims the available royalties for a given address that holds all the royalty nfts of an ipId - /// @param ipId The ipId + /// @dev This call will revert if the caller does not hold all the royalty nfts of the ipId + /// @param ipId The ipId whose received funds will be distributed /// @param withdrawETH The amount of ETH to withdraw /// @param token The token to withdraw function claimFromIpPoolAsTotalRnftOwner(address ipId, uint256 withdrawETH, address token) external nonReentrant { @@ -287,10 +292,10 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent } /// @notice Claims all available royalty nfts and accrued royalties for an ancestor of a given ipId - /// @param ipId The ipId - /// @param claimerIpId The claimer ipId - /// @param ancestors The ancestors of the IP - /// @param ancestorsRoyalties The royalties of the ancestors + /// @param ipId The ipId of the ancestors vault to claim from + /// @param claimerIpId The claimer ipId is the ancestor address that wants to claim + /// @param ancestors The ancestors for the selected ipId + /// @param ancestorsRoyalties The royalties of the ancestors for the selected ipId /// @param withdrawETH Indicates if the claimer wants to withdraw ETH /// @param tokens The ERC20 tokens to withdraw function claimFromAncestorsVault( From ae6313c0cd97c7b9acaa74e97f7b07ae710ca2d3 Mon Sep 17 00:00:00 2001 From: Spablob Date: Sun, 18 Feb 2024 13:18:29 -0800 Subject: [PATCH 04/11] lint fix --- .../interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol | 2 +- contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol index 4d394b28..1be4b067 100644 --- a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol +++ b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol @@ -79,7 +79,7 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { /// @notice Distributes funds internally so that accounts holding the royalty nfts at distribution moment can /// claim afterwards - /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call + /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call /// claimFromIpPoolAsTotalRnftOwner() instead /// @param ipId The ipId whose received funds will be distributed /// @param token The token to distribute diff --git a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol index 556d50d5..84e6b6bc 100644 --- a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol +++ b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol @@ -228,7 +228,7 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @notice Distributes funds internally so that accounts holding the royalty nfts at distribution moment can /// claim afterwards - /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call + /// @dev This call will revert if the caller holds all the royalty nfts of the ipId - in that case can call /// claimFromIpPoolAsTotalRnftOwner() instead /// @param ipId The ipId whose received funds will be distributed /// @param token The token to distribute From 2de5e1bb10fa448cd9281ef23dffe657a35598d2 Mon Sep 17 00:00:00 2001 From: Spablob Date: Sun, 18 Feb 2024 13:25:27 -0800 Subject: [PATCH 05/11] additional lint fix --- .../interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol | 4 ++-- .../modules/royalty-module/policies/RoyaltyPolicyLAP.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol index 1be4b067..c0c7ac7c 100644 --- a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol +++ b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol @@ -37,7 +37,7 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { /// @return isUnlinkable Indicates if the ipId is unlinkable to new parents /// @return splitClone The address of the liquid split clone contract for a given ipId /// @return ancestorsVault The address of the ancestors vault contract for a given ipId - /// @return royaltyStack The royalty stack for a given ipId is the sum of the royalties to be paid to all its ancestors + /// @return royaltyStack The royalty stack of a given ipId is the sum of the royalties to be paid to each ancestors /// @return ancestorsHash The hash of the unique ancestors addresses and royalties arrays function royaltyData( address ipId @@ -107,7 +107,7 @@ interface IRoyaltyPolicyLAP is IRoyaltyPolicy { /// @param token The token to withdraw function claimFromIpPoolAsTotalRnftOwner(address ipId, uint256 withdrawETH, address token) external; - /// @notice Claims all available royalty nfts and accrued royalties for an ancestor of a given ipId + /// @notice Claims available royalty nfts and accrued royalties for an ancestor of a given ipId /// @param ipId The ipId of the ancestors vault to claim from /// @param claimerIpId The claimer ipId is the ancestor address that wants to claim /// @param ancestors The ancestors for the selected ipId diff --git a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol index 84e6b6bc..8ba90865 100644 --- a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol +++ b/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol @@ -27,7 +27,7 @@ contract RoyaltyPolicyLAP is IRoyaltyPolicyLAP, Governable, ERC1155Holder, Reent /// @param isUnlinkableToParents Indicates if the ipId is unlinkable to new parents /// @param splitClone The address of the liquid split clone contract for a given ipId /// @param ancestorsVault The address of the ancestors vault contract for a given ipId - /// @param royaltyStack The royalty stack for a given ipId is the sum of the royalties to be paid to all its ancestors + /// @param royaltyStack The royalty stack of a given ipId is the sum of the royalties to be paid to each ancestors /// @param ancestorsHash The hash of the unique ancestors addresses and royalties arrays struct LAPRoyaltyData { bool isUnlinkableToParents; From bfba901eac26aa4bd3e5b789ed9cc2661b4eafac Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 16:30:15 -0600 Subject: [PATCH 06/11] fix: NatSpec and unused event --- .../modules/royalty/IRoyaltyModule.sol | 6 ------ .../royalty/policies/IRoyaltyPolicyLAP.sol | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/contracts/interfaces/modules/royalty/IRoyaltyModule.sol b/contracts/interfaces/modules/royalty/IRoyaltyModule.sol index c85f5f91..169bee25 100644 --- a/contracts/interfaces/modules/royalty/IRoyaltyModule.sol +++ b/contracts/interfaces/modules/royalty/IRoyaltyModule.sol @@ -15,12 +15,6 @@ interface IRoyaltyModule is IModule { /// @param allowed Indicates if the royalty token is whitelisted or not event RoyaltyTokenWhitelistUpdated(address token, bool allowed); - /// @notice Event emitted when a royalty policy is set - /// @param ipId The ID of IP asset - /// @param royaltyPolicy The address of the royalty policy - /// @param data The data to initialize the policy - event RoyaltyPolicySet(address ipId, address royaltyPolicy, bytes data); - /// @notice Event emitted when royalties are paid /// @param receiverIpId The ID of IP asset that receives the royalties /// @param payerIpId The ID of IP asset that pays the royalties diff --git a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol index c0c7ac7c..72e63789 100644 --- a/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol +++ b/contracts/interfaces/modules/royalty/policies/IRoyaltyPolicyLAP.sol @@ -7,13 +7,20 @@ import { IRoyaltyPolicy } from "../../../../interfaces/modules/royalty/policies/ /// @title RoyaltyPolicy interface interface IRoyaltyPolicyLAP is IRoyaltyPolicy { + /// @notice Initializes a royalty policy LAP for a given IP asset + /// @param targetAncestors The expected ancestors addresses of an ipId + /// @param targetRoyaltyAmount The expected royalties of each of the ancestors for a given ipId + /// @param parentAncestors1 The addresses of the ancestors of the first parent + /// @param parentAncestors2 The addresses of the ancestors of the second parent + /// @param parentAncestorsRoyalties1 The royalties of each of the ancestors of the first parent + /// @param parentAncestorsRoyalties2 The royalties of each of the ancestors of the second parent struct InitParams { - address[] targetAncestors; // the expected ancestors addresses of an ipId - uint32[] targetRoyaltyAmount; // the expected royalties of each of the ancestors for a given ipId - address[] parentAncestors1; // addresses of the ancestors of the first parent - address[] parentAncestors2; // addresses of the the ancestors of the second parent - uint32[] parentAncestorsRoyalties1; // the royalties of each of the first parent ancestors - uint32[] parentAncestorsRoyalties2; // the royalties of each of the second parent ancestors + address[] targetAncestors; + uint32[] targetRoyaltyAmount; + address[] parentAncestors1; + address[] parentAncestors2; + uint32[] parentAncestorsRoyalties1; + uint32[] parentAncestorsRoyalties2; } /// @notice Event emitted when a policy is initialized From 52bbe3c218ae78a992b075d81888e8cb0df41147 Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 16:45:22 -0600 Subject: [PATCH 07/11] refactor: rename royalty & dispute module folder --- .../interfaces/modules/licensing/ILicensingModule.sol | 2 +- .../{dispute-module => dispute}/DisputeModule.sol | 0 .../policies/ArbitrationPolicySP.sol | 0 contracts/modules/licensing/LicensingModule.sol | 2 +- .../{royalty-module => royalty}/RoyaltyModule.sol | 0 .../policies/AncestorsVaultLAP.sol | 0 .../policies/RoyaltyPolicyLAP.sol | 0 contracts/registries/metadata/IPAssetRenderer.sol | 2 +- script/foundry/deployment/Main.s.sol | 10 +++++----- test/foundry/mocks/module/MockLicensingModule.sol | 2 +- test/foundry/modules/dispute/ArbitrationPolicySP.t.sol | 2 +- test/foundry/modules/dispute/DisputeModule.t.sol | 2 +- test/foundry/modules/royalty/AncestorsVaultLAP.t.sol | 2 +- test/foundry/modules/royalty/RoyaltyModule.t.sol | 4 ++-- test/foundry/modules/royalty/RoyaltyPolicyLAP.t.sol | 2 +- test/foundry/utils/BaseTest.t.sol | 2 +- test/foundry/utils/DeployHelper.t.sol | 10 +++++----- 17 files changed, 21 insertions(+), 21 deletions(-) rename contracts/modules/{dispute-module => dispute}/DisputeModule.sol (100%) rename contracts/modules/{dispute-module => dispute}/policies/ArbitrationPolicySP.sol (100%) rename contracts/modules/{royalty-module => royalty}/RoyaltyModule.sol (100%) rename contracts/modules/{royalty-module => royalty}/policies/AncestorsVaultLAP.sol (100%) rename contracts/modules/{royalty-module => royalty}/policies/RoyaltyPolicyLAP.sol (100%) diff --git a/contracts/interfaces/modules/licensing/ILicensingModule.sol b/contracts/interfaces/modules/licensing/ILicensingModule.sol index 45ab5882..f3c8b7e0 100644 --- a/contracts/interfaces/modules/licensing/ILicensingModule.sol +++ b/contracts/interfaces/modules/licensing/ILicensingModule.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.23; import { Licensing } from "../../../lib/Licensing.sol"; import { IModule } from "../base/IModule.sol"; -import { RoyaltyModule } from "../../../modules/royalty-module/RoyaltyModule.sol"; +import { RoyaltyModule } from "../../../modules/royalty/RoyaltyModule.sol"; import { ILicenseRegistry } from "../../registries/ILicenseRegistry.sol"; import { IDisputeModule } from "../dispute/IDisputeModule.sol"; diff --git a/contracts/modules/dispute-module/DisputeModule.sol b/contracts/modules/dispute/DisputeModule.sol similarity index 100% rename from contracts/modules/dispute-module/DisputeModule.sol rename to contracts/modules/dispute/DisputeModule.sol diff --git a/contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol b/contracts/modules/dispute/policies/ArbitrationPolicySP.sol similarity index 100% rename from contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol rename to contracts/modules/dispute/policies/ArbitrationPolicySP.sol diff --git a/contracts/modules/licensing/LicensingModule.sol b/contracts/modules/licensing/LicensingModule.sol index e69ef570..64ee743d 100644 --- a/contracts/modules/licensing/LicensingModule.sol +++ b/contracts/modules/licensing/LicensingModule.sol @@ -18,7 +18,7 @@ import { Errors } from "../../lib/Errors.sol"; import { DataUniqueness } from "../../lib/DataUniqueness.sol"; import { Licensing } from "../../lib/Licensing.sol"; import { IPAccountChecker } from "../../lib/registries/IPAccountChecker.sol"; -import { RoyaltyModule } from "../../modules/royalty-module/RoyaltyModule.sol"; +import { RoyaltyModule } from "../../modules/royalty/RoyaltyModule.sol"; import { AccessControlled } from "../../access/AccessControlled.sol"; import { LICENSING_MODULE_KEY } from "../../lib/modules/Module.sol"; import { BaseModule } from "../BaseModule.sol"; diff --git a/contracts/modules/royalty-module/RoyaltyModule.sol b/contracts/modules/royalty/RoyaltyModule.sol similarity index 100% rename from contracts/modules/royalty-module/RoyaltyModule.sol rename to contracts/modules/royalty/RoyaltyModule.sol diff --git a/contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol b/contracts/modules/royalty/policies/AncestorsVaultLAP.sol similarity index 100% rename from contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol rename to contracts/modules/royalty/policies/AncestorsVaultLAP.sol diff --git a/contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol b/contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol similarity index 100% rename from contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol rename to contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol diff --git a/contracts/registries/metadata/IPAssetRenderer.sol b/contracts/registries/metadata/IPAssetRenderer.sol index a7ea6771..eda962d2 100644 --- a/contracts/registries/metadata/IPAssetRenderer.sol +++ b/contracts/registries/metadata/IPAssetRenderer.sol @@ -10,7 +10,7 @@ import { IPAssetRegistry } from "../../registries/IPAssetRegistry.sol"; import { IMetadataProvider } from "../../interfaces/registries/metadata/IMetadataProvider.sol"; import { LicenseRegistry } from "../../registries/LicenseRegistry.sol"; import { TaggingModule } from "../../modules/tagging/TaggingModule.sol"; -import { RoyaltyModule } from "../../modules/royalty-module/RoyaltyModule.sol"; +import { RoyaltyModule } from "../../modules/royalty/RoyaltyModule.sol"; /// @title IP Asset Renderer /// @notice The IP asset renderer is responsible for rendering canonical diff --git a/script/foundry/deployment/Main.s.sol b/script/foundry/deployment/Main.s.sol index fb82334c..14c70113 100644 --- a/script/foundry/deployment/Main.s.sol +++ b/script/foundry/deployment/Main.s.sol @@ -29,11 +29,11 @@ import { LicensingModule } from "contracts/modules/licensing/LicensingModule.sol import { IPResolver } from "contracts/resolvers/IPResolver.sol"; import { RegistrationModule } from "contracts/modules/RegistrationModule.sol"; import { TaggingModule } from "contracts/modules/tagging/TaggingModule.sol"; -import { RoyaltyModule } from "contracts/modules/royalty-module/RoyaltyModule.sol"; -import { AncestorsVaultLAP } from "contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol"; -import { RoyaltyPolicyLAP } from "contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol"; -import { DisputeModule } from "contracts/modules/dispute-module/DisputeModule.sol"; -import { ArbitrationPolicySP } from "contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol"; +import { RoyaltyModule } from "contracts/modules/royalty/RoyaltyModule.sol"; +import { AncestorsVaultLAP } from "contracts/modules/royalty/policies/AncestorsVaultLAP.sol"; +import { RoyaltyPolicyLAP } from "contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol"; +import { DisputeModule } from "contracts/modules/dispute/DisputeModule.sol"; +import { ArbitrationPolicySP } from "contracts/modules/dispute/policies/ArbitrationPolicySP.sol"; // solhint-disable-next-line max-line-length import { PILPolicyFrameworkManager, PILPolicy, RegisterPILPolicyParams } from "contracts/modules/licensing/PILPolicyFrameworkManager.sol"; import { MODULE_TYPE_HOOK } from "contracts/lib/modules/Module.sol"; diff --git a/test/foundry/mocks/module/MockLicensingModule.sol b/test/foundry/mocks/module/MockLicensingModule.sol index 3f53576f..c0c77b6b 100644 --- a/test/foundry/mocks/module/MockLicensingModule.sol +++ b/test/foundry/mocks/module/MockLicensingModule.sol @@ -9,7 +9,7 @@ import { ILicenseRegistry } from "../../../../contracts/interfaces/registries/IL import { IDisputeModule } from "../../../../contracts/interfaces/modules/dispute/IDisputeModule.sol"; import { DataUniqueness } from "../../../../contracts/lib/DataUniqueness.sol"; import { Licensing } from "../../../../contracts/lib/Licensing.sol"; -import { RoyaltyModule } from "../../../../contracts/modules/royalty-module/RoyaltyModule.sol"; +import { RoyaltyModule } from "../../../../contracts/modules/royalty/RoyaltyModule.sol"; import { BaseModule } from "../../../../contracts/modules/BaseModule.sol"; contract MockLicensingModule is BaseModule, ILicensingModule { diff --git a/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol b/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol index dbf4474c..46e0c207 100644 --- a/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol +++ b/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol @@ -7,7 +7,7 @@ import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; import { ERC6551AccountLib } from "erc6551/lib/ERC6551AccountLib.sol"; // contracts import { Errors } from "contracts/lib/Errors.sol"; -import { ArbitrationPolicySP } from "contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol"; +import { ArbitrationPolicySP } from "contracts/modules/dispute/policies/ArbitrationPolicySP.sol"; import { PILPolicy } from "contracts/modules/licensing/PILPolicyFrameworkManager.sol"; // test import { BaseTest } from "test/foundry/utils/BaseTest.t.sol"; diff --git a/test/foundry/modules/dispute/DisputeModule.t.sol b/test/foundry/modules/dispute/DisputeModule.t.sol index f3db5a0e..5f2521e5 100644 --- a/test/foundry/modules/dispute/DisputeModule.t.sol +++ b/test/foundry/modules/dispute/DisputeModule.t.sol @@ -8,7 +8,7 @@ import { ERC6551AccountLib } from "erc6551/lib/ERC6551AccountLib.sol"; // contracts import { Errors } from "contracts/lib/Errors.sol"; import { IModule } from "contracts/interfaces/modules/base/IModule.sol"; -import { ArbitrationPolicySP } from "contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol"; +import { ArbitrationPolicySP } from "contracts/modules/dispute/policies/ArbitrationPolicySP.sol"; import { ShortStringOps } from "contracts/utils/ShortStringOps.sol"; import { PILPolicy } from "contracts/modules/licensing/PILPolicyFrameworkManager.sol"; // test diff --git a/test/foundry/modules/royalty/AncestorsVaultLAP.t.sol b/test/foundry/modules/royalty/AncestorsVaultLAP.t.sol index fe875353..d7a0e990 100644 --- a/test/foundry/modules/royalty/AncestorsVaultLAP.t.sol +++ b/test/foundry/modules/royalty/AncestorsVaultLAP.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.23; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import { AncestorsVaultLAP } from "../../../../contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol"; +import { AncestorsVaultLAP } from "../../../../contracts/modules/royalty/policies/AncestorsVaultLAP.sol"; import { ILiquidSplitClone } from "../../../../contracts/interfaces/modules/royalty/policies/ILiquidSplitClone.sol"; import { ILiquidSplitMain } from "../../../../contracts/interfaces/modules/royalty/policies/ILiquidSplitMain.sol"; import { Errors } from "../../../../contracts/lib/Errors.sol"; diff --git a/test/foundry/modules/royalty/RoyaltyModule.t.sol b/test/foundry/modules/royalty/RoyaltyModule.t.sol index 388f29d0..8b4b62fa 100644 --- a/test/foundry/modules/royalty/RoyaltyModule.t.sol +++ b/test/foundry/modules/royalty/RoyaltyModule.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.23; // contracts import { Errors } from "../../../../contracts/lib/Errors.sol"; -import { RoyaltyModule } from "../../../../contracts/modules/royalty-module/RoyaltyModule.sol"; -import { RoyaltyPolicyLAP } from "../../../../contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol"; +import { RoyaltyModule } from "../../../../contracts/modules/royalty/RoyaltyModule.sol"; +import { RoyaltyPolicyLAP } from "../../../../contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol"; // tests import { BaseTest } from "../../utils/BaseTest.t.sol"; diff --git a/test/foundry/modules/royalty/RoyaltyPolicyLAP.t.sol b/test/foundry/modules/royalty/RoyaltyPolicyLAP.t.sol index b4c20ba6..82a40e30 100644 --- a/test/foundry/modules/royalty/RoyaltyPolicyLAP.t.sol +++ b/test/foundry/modules/royalty/RoyaltyPolicyLAP.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.23; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; -import { RoyaltyPolicyLAP } from "../../../../contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol"; +import { RoyaltyPolicyLAP } from "../../../../contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol"; import { ILiquidSplitMain } from "../../../../contracts/interfaces/modules/royalty/policies/ILiquidSplitMain.sol"; import { Errors } from "../../../../contracts/lib/Errors.sol"; diff --git a/test/foundry/utils/BaseTest.t.sol b/test/foundry/utils/BaseTest.t.sol index 614426d6..8ea4338f 100644 --- a/test/foundry/utils/BaseTest.t.sol +++ b/test/foundry/utils/BaseTest.t.sol @@ -12,7 +12,7 @@ import { AccessController } from "../../../contracts/AccessController.sol"; import { IP_RESOLVER_MODULE_KEY, REGISTRATION_MODULE_KEY, DISPUTE_MODULE_KEY, TAGGING_MODULE_KEY, ROYALTY_MODULE_KEY, LICENSING_MODULE_KEY } from "../../../contracts/lib/modules/Module.sol"; import { AccessPermission } from "../../../contracts/lib/AccessPermission.sol"; import { LicenseRegistry } from "../../../contracts/registries/LicenseRegistry.sol"; -import { RoyaltyModule } from "../../../contracts/modules/royalty-module/RoyaltyModule.sol"; +import { RoyaltyModule } from "../../../contracts/modules/royalty/RoyaltyModule.sol"; // test import { DeployHelper } from "./DeployHelper.t.sol"; diff --git a/test/foundry/utils/DeployHelper.t.sol b/test/foundry/utils/DeployHelper.t.sol index e41282cd..6c2b47f9 100644 --- a/test/foundry/utils/DeployHelper.t.sol +++ b/test/foundry/utils/DeployHelper.t.sol @@ -25,13 +25,13 @@ import { ModuleRegistry } from "../../../contracts/registries/ModuleRegistry.sol import { LicenseRegistry } from "../../../contracts/registries/LicenseRegistry.sol"; import { IPResolver } from "../../../contracts/resolvers/IPResolver.sol"; import { RegistrationModule } from "../../../contracts/modules/RegistrationModule.sol"; -import { RoyaltyModule } from "../../../contracts/modules/royalty-module/RoyaltyModule.sol"; -import { AncestorsVaultLAP } from "../../../contracts/modules/royalty-module/policies/AncestorsVaultLAP.sol"; -import { RoyaltyPolicyLAP } from "../../../contracts/modules/royalty-module/policies/RoyaltyPolicyLAP.sol"; +import { RoyaltyModule } from "../../../contracts/modules/royalty/RoyaltyModule.sol"; +import { AncestorsVaultLAP } from "../../../contracts/modules/royalty/policies/AncestorsVaultLAP.sol"; +import { RoyaltyPolicyLAP } from "../../../contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol"; import { TaggingModule } from "../../../contracts/modules/tagging/TaggingModule.sol"; -import { DisputeModule } from "../../../contracts/modules/dispute-module/DisputeModule.sol"; +import { DisputeModule } from "../../../contracts/modules/dispute/DisputeModule.sol"; import { LicensingModule } from "../../../contracts/modules/licensing/LicensingModule.sol"; -import { ArbitrationPolicySP } from "../../../contracts/modules/dispute-module/policies/ArbitrationPolicySP.sol"; +import { ArbitrationPolicySP } from "../../../contracts/modules/dispute/policies/ArbitrationPolicySP.sol"; // test import { MockAccessController } from "../mocks/access/MockAccessController.sol"; From 54729ae65d0091f9ebf50882ed05afbee0e31bad Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 17:04:53 -0600 Subject: [PATCH 08/11] undo: changelog edits --- CHANGELOG.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 569bd8d1..bf8717c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,43 +1,5 @@ # CHANGELOG -## Beta release (beta-rc4) - -This release marks the official beta release of core protocol. - -- Integrate the Royalty and Licensing system with new royalty policy (#99) - -- Integrate the Dispute and Licensing system (#93) - -- Introduce a new Royalty Policy (LAP) for on-chain royalty system (#99, #106) - -- Introduce working registration features in IP Asset Registry for registering IP assets, backward compatible with Registration Module (#74, #89) - -- Support upfront fee payment on license minting (#113) - -- Enhance Modules with Type Support and Introduce Hook Module (#85) - -- Enhance Security by Adding Owner Restriction to Permissions (#104) - -- Unify the unit and integration testing with a modular test framework (#90) - -- Change to configurations and linting (300b0c5, #86) - -- Change absolute to relative imports (#82, #96) - -- Fix logic around license derivatives (#112) - -- Fix Caller Parameter in PFM verify (#119) - -- Refactor Initialization process of IPAccount registration (#108) - -- Clean up and Minimize Base Module Attributes (#81) - -- Clean up NatSpec, comments, and standards (#109) - -- Add more unit and integration tests (#90, #114) - -- Miscellaneous changes (#79, #83, #88, #91, #92, #97, #115) - ## Beta-rc3 This release finalizes the external-facing implementation of core modules and registries, as well as the public interfaces and events. @@ -57,8 +19,6 @@ This release finalizes the external-facing implementation of core modules and re - Review interfaces, events, and variables (#76) and GitHub PR actions (#36, #58) - Refactor contracts for relative imports (#75) -Full Changelog: [beta-rc2...beta-rc3](https://github.com/storyprotocol/protocol-core/compare/beta-rc2...beta-rc3) - ## Beta-rc2 This release introduces new modules, registries, libraries, and other logics into the protocol. @@ -73,6 +33,4 @@ This release introduces new modules, registries, libraries, and other logics int - Enhance the deployment script & post-deployment interactions, as well as the Integration tests to capture more use-case flows (#33) - Enhance the Unit tests for better coverage (#29, #30, #35) -Full Changelog: [beta-rc1...beta-rc2](https://github.com/storyprotocol/protocol-core/compare/d0df7d4...beta-rc2) - ## Beta-rc1 From 2f038a84737a2563ad4eafa58189748bcc484a5d Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 17:46:45 -0600 Subject: [PATCH 09/11] fix: rename test files for PIL --- ...ework.derivation.t.sol => PILPolicyFramework.derivation.t.sol} | 0 ...ework.multi-parent.sol => PILPolicyFramework.multi-parent.sol} | 0 .../{UMLPolicyFramework.t.sol => PILPolicyFramework.t.sol} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/foundry/modules/licensing/{UMLPolicyFramework.derivation.t.sol => PILPolicyFramework.derivation.t.sol} (100%) rename test/foundry/modules/licensing/{UMLPolicyFramework.multi-parent.sol => PILPolicyFramework.multi-parent.sol} (100%) rename test/foundry/modules/licensing/{UMLPolicyFramework.t.sol => PILPolicyFramework.t.sol} (100%) diff --git a/test/foundry/modules/licensing/UMLPolicyFramework.derivation.t.sol b/test/foundry/modules/licensing/PILPolicyFramework.derivation.t.sol similarity index 100% rename from test/foundry/modules/licensing/UMLPolicyFramework.derivation.t.sol rename to test/foundry/modules/licensing/PILPolicyFramework.derivation.t.sol diff --git a/test/foundry/modules/licensing/UMLPolicyFramework.multi-parent.sol b/test/foundry/modules/licensing/PILPolicyFramework.multi-parent.sol similarity index 100% rename from test/foundry/modules/licensing/UMLPolicyFramework.multi-parent.sol rename to test/foundry/modules/licensing/PILPolicyFramework.multi-parent.sol diff --git a/test/foundry/modules/licensing/UMLPolicyFramework.t.sol b/test/foundry/modules/licensing/PILPolicyFramework.t.sol similarity index 100% rename from test/foundry/modules/licensing/UMLPolicyFramework.t.sol rename to test/foundry/modules/licensing/PILPolicyFramework.t.sol From ef0522304e156a23377d08e5aecd7f87a713838f Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 17:58:51 -0600 Subject: [PATCH 10/11] undo: deploy addresses --- deploy-out/deployment-11155111.json | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/deploy-out/deployment-11155111.json b/deploy-out/deployment-11155111.json index 9dc08945..856e4882 100644 --- a/deploy-out/deployment-11155111.json +++ b/deploy-out/deployment-11155111.json @@ -1,26 +1,26 @@ { "main": { - "AccessController": "0xDE52F5103e8E81988Ea6f2e7f111D4D1033cD511", - "AncestorsVaultLAP": "0x11fA3dAF418DdB408D1770ff0Cca913034922F8D", - "ArbitrationPolicySP": "0xAba6FD307Ae647e4fC345Bd3bAF0bcE03F879A87", - "DisputeModule": "0x4703ec1A6Dc1536CAEE8f0a7922F8a0335Eaff8D", - "Governance": "0xADF008aD48CB800f39CA58c0F3F5231225301383", - "IPAccountImpl": "0x041C77F067C716eE3a0e200ED60Ed45a78ff7c53", - "IPAccountRegistry": "0x1AFcfa8FE8c13747b574894a3EE9D663697E96b9", - "IPAssetRegistry": "0x7B3ad84983a4e926326e5d64380F7F1ddf06cFC7", - "IPAssetRenderer": "0x200Ff773A2e935537daD6379d2004B28a6274C44", - "IPMetadataProvider": "0xCEBe37B1486c6f20cd2d3be73a7178C2DFDD912d", - "IPResolver": "0x7eb182e4a63e8423977f1df27E8Ef800e05bBcba", - "LicenseRegistry": "0xA4f9263EC7251743cF301e8c160cB5F71A743671", - "LicensingModule": "0xeDae9944c4A591e165A79A0888396EE4f2764e59", - "MockERC20": "0x04f879fCC335A4d36dC6ab850023e7690985c8aa", - "MockERC721": "0xE01e9993496944f4bEe5b2b49169743312Fe63dF", - "MockTokenGatedHook": "0x8Eeb3D9bFBa90c4A065c5E9801d0F7c9c207500E", - "ModuleRegistry": "0xA50d85d4A5F41827eaae43cC269a678C1756A205", - "PILPolicyFrameworkManager": "0xD710E6A831A3d5861C9e763976880E4da09D0Bc9", - "RegistrationModule": "0x645F00b4E246e854df451066FD6F9959f6746Fad", - "RoyaltyModule": "0xf671EcC05b91a19cB0c9C3d0e6c9E14255BC63bb", - "RoyaltyPolicyLAP": "0xc2D953B7849811C27D61640f52b33c7dBD0Abb66", - "TaggingModule": "0x9DC6d1B816CA15bf3E3247FAe1Fa36B554e57788" + "AccessController": "0x2F5e751a01F2385d10e044A7FFC25d997DC6f09E", + "AncestorsVaultLAP": "0x1CDffcc14aA77F85101D96949D49B73e40aC9F98", + "ArbitrationPolicySP": "0xa765b52023B21D90ee49498b3cCabFF6a26a0a52", + "DisputeModule": "0x7D0aDeCF1cB4EB2A7430Af5d63eC06df49D8BA4c", + "Governance": "0xE887083e1900001eF106e48bedB36218575ce446", + "IPAccountImpl": "0x05928C75d7304f2F020D604c48035d66CF97f48F", + "IPAccountRegistry": "0xFea427d6d3C4f86631b7AE3DA04612f4097F4753", + "IPAssetRegistry": "0xD30f3199a2E1C0d2b1A53BdeCFC9660Fd0A6E1b6", + "IPAssetRenderer": "0xf2f52517C74865A099E55D89205a1d8d24542ec8", + "IPMetadataProvider": "0xa93E1499134E78E79874aC213E7275766adb9fb0", + "IPResolver": "0xC09b861E1Be9854852161966Bdb88D8fdC3f9A8D", + "LicenseRegistry": "0xe6B99A2AEbb75cED30B588296c6C6D0e41EF5c54", + "LicensingModule": "0xE582a031190C9Dc91ad032605fD5ad71855F733b", + "MockERC20": "0x6d94B2d71d4aE81f8495c212FCc885694723FaF7", + "MockERC721": "0x1be8EE9E08e1eB631eEe27fAe9b2A7840b5a5E3a", + "MockTokenGatedHook": "0x8f5370135B7769e8E48c6c868bf8B69168c920b4", + "ModuleRegistry": "0x3083B93552df047b6d865597b7D37fb018a669C9", + "PILPolicyFrameworkManager": "0xB7E30f33aaAA61cBb0F6dbd815a898Fc3e0a3bA6", + "RegistrationModule": "0x8dC88927Bf6F8c5b5B902C04E2C4d24D5257441c", + "RoyaltyModule": "0xfeCfDF6278610Cad238844A3A3679446E00d6fee", + "RoyaltyPolicyLAP": "0x93eCDdB4d8Ad5662103A58230Eb14Cc4E3CA278f", + "TaggingModule": "0x385AfC3112AeF16E49ffEc9C59b9598c87D7c2Cd" } } \ No newline at end of file From a5fe1318f204b9a62cd38c0c06604c4725ac0dc5 Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Sun, 18 Feb 2024 18:18:00 -0600 Subject: [PATCH 11/11] undo: owner() in LicenseRegistry 1155 --- contracts/registries/LicenseRegistry.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/registries/LicenseRegistry.sol b/contracts/registries/LicenseRegistry.sol index aae56e34..65711d49 100644 --- a/contracts/registries/LicenseRegistry.sol +++ b/contracts/registries/LicenseRegistry.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; -import { Ownable, Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol"; import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; @@ -17,7 +16,7 @@ import { DataUniqueness } from "../lib/DataUniqueness.sol"; /// @title LicenseRegistry aka LNFT /// @notice Registry of License NFTs, which represent licenses granted by IP ID licensors to create derivative IPs. -contract LicenseRegistry is ILicenseRegistry, ERC1155, Ownable2Step, Governable { +contract LicenseRegistry is ILicenseRegistry, ERC1155, Governable { using Strings for *; /// @dev Name of the License NFT @@ -52,7 +51,7 @@ contract LicenseRegistry is ILicenseRegistry, ERC1155, Ownable2Step, Governable _; } - constructor(address governance) ERC1155("") Ownable(msg.sender) Governable(governance) {} + constructor(address governance) ERC1155("") Governable(governance) {} /// @dev Sets the DisputeModule address. /// @dev Enforced to be only callable by the protocol admin