From b616d1153549f024724f6c75fed711214f13feb6 Mon Sep 17 00:00:00 2001 From: Spablob Date: Wed, 31 Jan 2024 15:14:23 -0800 Subject: [PATCH] natspec and other minor fixes --- .../royalty-module/policies/LSClaimer.sol | 51 +------------------ .../policies/RoyaltyPolicyLS.sol | 10 ++-- 2 files changed, 7 insertions(+), 54 deletions(-) diff --git a/contracts/modules/royalty-module/policies/LSClaimer.sol b/contracts/modules/royalty-module/policies/LSClaimer.sol index 4530919ef..9d9966cad 100644 --- a/contracts/modules/royalty-module/policies/LSClaimer.sol +++ b/contracts/modules/royalty-module/policies/LSClaimer.sol @@ -78,7 +78,7 @@ contract LSClaimer is IClaimerLS, ERC1155Holder, ReentrancyGuard { /// @notice Checks if a claiming path is valid /// @param _path The path between the IP_ID and the parent or grandparent ipId - function _checkIfPathIsValid(address[] memory _path) internal view { + function _checkIfPathIsValid(address[] calldata _path) internal view { // the loop below is limited to less than 100 iterations/parents // given the minimum royalty step of 1% only allows max 100 nodes in a tree for (uint256 i = 0; i < _path.length - 1; i++) { @@ -128,53 +128,4 @@ contract LSClaimer is IClaimerLS, ERC1155Holder, ReentrancyGuard { if (!callStatus) revert Errors.RoyaltyPolicyLS__TransferFailed(); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* function withdraw( - address account, - uint256 withdrawETH, - ERC20[] calldata tokens - ) external override { - uint256[] memory tokenAmounts = new uint256[](tokens.length); - uint256 ethAmount; - if (withdrawETH != 0) { - ethAmount = _withdraw(account); - } - unchecked { - // overflow should be impossible in for-loop index - for (uint256 i = 0; i < tokens.length; ++i) { - // overflow should be impossible in array length math - tokenAmounts[i] = _withdrawERC20(account, tokens[i]); - } - emit Withdrawal(account, ethAmount, tokens, tokenAmounts); - } - } */ } \ No newline at end of file diff --git a/contracts/modules/royalty-module/policies/RoyaltyPolicyLS.sol b/contracts/modules/royalty-module/policies/RoyaltyPolicyLS.sol index 1e9bc908f..8fa8e9519 100644 --- a/contracts/modules/royalty-module/policies/RoyaltyPolicyLS.sol +++ b/contracts/modules/royalty-module/policies/RoyaltyPolicyLS.sol @@ -24,8 +24,8 @@ contract RoyaltyPolicyLS is IRoyaltyPolicyLS, ERC1155Holder { struct LSRoyaltyData { address splitClone; // Indicates the address of the LiquidSplitClone contract for a given ipId address claimer; // Indicates the address of the claimer contract for a given ipId - uint32 royaltyStack; // Indicates the royalty stack for a given ipId - uint32 minRoyalty; // Indicates the minimum royalty for a given ipId + uint32 royaltyStack; // Indicates the royalty stack for a given ipId (number between 0 and 1000) + uint32 minRoyalty; // Indicates the minimum royalty for a given ipId (number between 0 and 1000) } /// @notice Percentage scale - 1000 rnfts represents 100% @@ -75,7 +75,7 @@ contract RoyaltyPolicyLS is IRoyaltyPolicyLS, ERC1155Holder { /// @param _ipId The ipId /// @param _parentIpIds The parent ipIds /// @param _data The data to initialize the policy - function initPolicy(address _ipId, address[] memory _parentIpIds, bytes calldata _data) external onlyRoyaltyModule { + function initPolicy(address _ipId, address[] calldata _parentIpIds, bytes calldata _data) external onlyRoyaltyModule { (uint32 minRoyalty) = abi.decode(_data, (uint32)); // root you can choose 0% but children have to choose at least 1% if (minRoyalty == 0 && _parentIpIds.length > 0) revert Errors.RoyaltyPolicyLS__ZeroMinRoyalty(); @@ -141,7 +141,9 @@ contract RoyaltyPolicyLS is IRoyaltyPolicyLS, ERC1155Holder { /// @notice Checks if the royalty stack is valid /// @param _parentIpIds The parent ipIds /// @param _minRoyalty The minimum royalty - function _checkRoyaltyStackIsValid(address[] memory _parentIpIds, uint32 _minRoyalty) internal view returns (uint32, uint32) { + /// @return royaltyStack The royalty stack + /// newRoyaltyStack The new royalty stack + function _checkRoyaltyStackIsValid(address[] calldata _parentIpIds, uint32 _minRoyalty) internal view returns (uint32, uint32) { // the loop below is limited to a length of 100 // given the minimum royalty step of 1% and a cap of 100% uint32 royaltyStack;