Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Turk <[email protected]>
  • Loading branch information
steven2308 and ThunderDeliverer authored Jan 18, 2023
1 parent fdeea26 commit 8ac48a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion contracts/RMRK/library/RMRKErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ error RMRKNotOwnerOrContributor();
error RMRKNewOwnerIsZeroAddress();
/// Attempting to assign a 0x0 address as a contributor
error RMRKNewContributorIsZeroAddress();
/// Attempting do an operation assuming a token is nested, while it is not
/// Attempting an operation requiring the token being nested, while it is not
error RMRKParentIsNotNFT();
/// Attempting to add a `Part` with an ID that is already used
error RMRKPartAlreadyExists();
Expand Down
14 changes: 7 additions & 7 deletions contracts/RMRK/utils/RMRKEquipRenderUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ contract RMRKEquipRenderUtils is RMRKRenderUtils, RMRKMultiAssetRenderUtils {
* ]
* @param target Address of the smart contract of the given token
* @param tokenId ID of the token to retrieve the extended active assets for
* @return ExtendedActiveAssets[] An array of ExtendedActiveAssets present on the given token
* @return ExtendedEquippableActiveAsset[] An array of ExtendedEquippableActiveAssets present on the given token
*/
function getExtendedEquippableActiveAssets(
address target,
Expand Down Expand Up @@ -363,7 +363,7 @@ contract RMRKEquipRenderUtils is RMRKRenderUtils, RMRKMultiAssetRenderUtils {
}

/**
* @notice Used to get the child's assets and slot parts pairs, for which the child asset can be equipped into parent's slot part.
* @notice Used to get the child's assets and slot parts pairs, identifying parts the said assets can be equipped into.
* @dev The full `AssetWithSlot` struct looks like this:
* [
* assetId,
Expand Down Expand Up @@ -433,9 +433,9 @@ contract RMRKEquipRenderUtils is RMRKRenderUtils, RMRKMultiAssetRenderUtils {

/**
* @notice Used to retrieve the equippable data of the specified token's asset with the highest priority.
* @param target Address of the smart contract of the given token
* @param target Address of the collection smart contract of the specified token
* @param tokenId ID of the token for which to retrieve the equippable data of the asset with the highest priority
* @return topAsset ExtendedEquippableActiveAsset struct with the equippable data for the the asset with the highest priority
* @return topAsset `ExtendedEquippableActiveAsset` struct with the equippable data containing the asset with the highest priority
*/
function getTopAssetAndEquippableDataForToken(
address target,
Expand Down Expand Up @@ -465,12 +465,12 @@ contract RMRKEquipRenderUtils is RMRKRenderUtils, RMRKMultiAssetRenderUtils {
}

/**
* @notice Used to retrieve the parent address and is slot part ids for a given target child.
* @param target Address of the smart contract of the given token
* @notice Used to retrieve the parent address and its slot part IDs for a given target child.
* @param target Address of the collection smart contract of the given token
* @param tokenId ID of the child token
* @param parentAssetId ID of the parent asset from which to get the slot parts
* @return parentAddress Address of the parent token owning the target child
* @return parentSlotPartIds Array of slot part ids of the parent asset
* @return parentSlotPartIds Array of slot part IDs of the parent token's asset
* @dev Reverts if the parent is not an NFT or if the parent asset is not composable.
*/
function _getParentAndSlotParts(
Expand Down
3 changes: 2 additions & 1 deletion contracts/RMRK/utils/RMRKMultiAssetRenderUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ contract RMRKMultiAssetRenderUtils {
* @notice Used to retrieve the ID of the specified token's asset with the highest priority.
* @param target Address of the smart contract of the given token
* @param tokenId ID of the token for which to retrieve the ID of the asset with the highest priority
* @return string The ID of the asset with the highest priority
* @return The ID of the asset with the highest priority
* @return The priority value of the asset with the highest priority
*/
function getAssetIdWithTopPriority(
address target,
Expand Down
14 changes: 7 additions & 7 deletions contracts/RMRK/utils/RMRKRenderUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import "../library/RMRKErrors.sol";
*/
contract RMRKRenderUtils {
/**
* @notice Used to get a list of existing token Ids in the range given by pageStart and pageSize
* @dev It does not optimize to avoid checking Ids out of max supply nor total supply.
* @dev The resulting array might be smaller than the given pageSize since not existing Ids are not included.
* @param target Address of the smart contract of the given token
* @param pageStart The first Id to check
* @param pageSize The number of Ids to check
* @return page An array of existing token Ids
* @notice Used to get a list of existing token IDs in the range between `pageStart` and `pageSize`.
* @dev It is not optimized to avoid checking IDs out of max supply nor total supply, since this is not meant to be used during transaction execution; it is only meant to be used as a getter.
* @dev The resulting array might be smaller than the given `pageSize` since no-existent IDs are not included.
* @param target Address of the collection smart contract of the given token
* @param pageStart The first ID to check
* @param pageSize The number of IDs to check
* @return page An array of IDs of the existing tokens
*/
function getPaginatedMintedIds(
address target,
Expand Down

0 comments on commit 8ac48a6

Please sign in to comment.