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

Commit

Permalink
natspec and other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spablob committed Jan 31, 2024
1 parent 0448c38 commit b616d11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 54 deletions.
51 changes: 1 addition & 50 deletions contracts/modules/royalty-module/policies/LSClaimer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
}
} */
}
10 changes: 6 additions & 4 deletions contracts/modules/royalty-module/policies/RoyaltyPolicyLS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b616d11

Please sign in to comment.