@bannynet/core-v6 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Banny721TokenUriResolver.sol +23 -23
package/package.json
CHANGED
|
@@ -151,12 +151,12 @@ contract Banny721TokenUriResolver is
|
|
|
151
151
|
/// @custom:param upc The universal product code that the SVG contents represent.
|
|
152
152
|
mapping(uint256 upc => string) internal _svgContentOf;
|
|
153
153
|
|
|
154
|
-
/// @notice The ID of the banny body each background is
|
|
154
|
+
/// @notice The ID of the banny body each background is used by.
|
|
155
155
|
/// @custom:param hook The hook address of the collection.
|
|
156
156
|
/// @custom:param backgroundId The ID of the background.
|
|
157
157
|
mapping(address hook => mapping(uint256 backgroundId => uint256)) internal _userOf;
|
|
158
158
|
|
|
159
|
-
/// @notice The ID of the banny body each outfit is
|
|
159
|
+
/// @notice The ID of the banny body each outfit is worn by.
|
|
160
160
|
/// @custom:param hook The hook address of the collection.
|
|
161
161
|
/// @custom:param outfitId The ID of the outfit.
|
|
162
162
|
mapping(address hook => mapping(uint256 outfitId => uint256)) internal _wearerOf;
|
|
@@ -503,7 +503,7 @@ contract Banny721TokenUriResolver is
|
|
|
503
503
|
|
|
504
504
|
/// @notice Checks to see which banny body is currently using a particular background.
|
|
505
505
|
/// @param hook The hook address of the collection.
|
|
506
|
-
/// @param backgroundId The ID of the background
|
|
506
|
+
/// @param backgroundId The ID of the background to check.
|
|
507
507
|
/// @return The ID of the banny body using the background.
|
|
508
508
|
function userOf(address hook, uint256 backgroundId) public view override returns (uint256) {
|
|
509
509
|
// Get a reference to the banny body using the background.
|
|
@@ -518,7 +518,7 @@ contract Banny721TokenUriResolver is
|
|
|
518
518
|
|
|
519
519
|
/// @notice Checks to see which banny body is currently wearing a particular outfit.
|
|
520
520
|
/// @param hook The hook address of the collection.
|
|
521
|
-
/// @param outfitId The ID of the outfit
|
|
521
|
+
/// @param outfitId The ID of the outfit to check.
|
|
522
522
|
/// @return The ID of the banny body wearing the outfit.
|
|
523
523
|
function wearerOf(address hook, uint256 outfitId) public view override returns (uint256) {
|
|
524
524
|
// Get a reference to the banny body wearing the outfit.
|
|
@@ -547,7 +547,7 @@ contract Banny721TokenUriResolver is
|
|
|
547
547
|
//*********************************************************************//
|
|
548
548
|
|
|
549
549
|
/// @notice The SVG contents for a banny body.
|
|
550
|
-
/// @param upc The ID of the token whose product's SVG
|
|
550
|
+
/// @param upc The ID of the token whose product's SVG to return.
|
|
551
551
|
/// @return contents The SVG contents of the banny body.
|
|
552
552
|
function _bannyBodySvgOf(uint256 upc) internal view returns (string memory) {
|
|
553
553
|
(
|
|
@@ -580,7 +580,7 @@ contract Banny721TokenUriResolver is
|
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
/// @notice The name of each token's category.
|
|
583
|
-
/// @param category The category of the token
|
|
583
|
+
/// @param category The category of the token to name.
|
|
584
584
|
/// @return name The token's category name.
|
|
585
585
|
function _categoryNameOf(uint256 category) internal pure returns (string memory) {
|
|
586
586
|
if (category == _BODY_CATEGORY) {
|
|
@@ -691,7 +691,7 @@ contract Banny721TokenUriResolver is
|
|
|
691
691
|
}
|
|
692
692
|
|
|
693
693
|
/// @notice The fills for a product.
|
|
694
|
-
/// @param upc The ID of the token whose product's fills
|
|
694
|
+
/// @param upc The ID of the token whose product's fills to return.
|
|
695
695
|
/// @return fills The fills for the product.
|
|
696
696
|
function _fillsFor(uint256 upc)
|
|
697
697
|
internal
|
|
@@ -720,8 +720,8 @@ contract Banny721TokenUriResolver is
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
/// @notice The full name of each product, including category and inventory.
|
|
723
|
-
/// @param tokenId The ID of the token
|
|
724
|
-
/// @param product The product of the token
|
|
723
|
+
/// @param tokenId The ID of the token to name.
|
|
724
|
+
/// @param product The product of the token to name.
|
|
725
725
|
/// @return name The full name.
|
|
726
726
|
function _fullNameOf(uint256 tokenId, JB721Tier memory product) internal view returns (string memory name) {
|
|
727
727
|
// Start with the item's name.
|
|
@@ -817,7 +817,7 @@ contract Banny721TokenUriResolver is
|
|
|
817
817
|
/// @notice The SVG contents for a list of outfit IDs.
|
|
818
818
|
/// @param hook The 721 contract that the product belongs to.
|
|
819
819
|
/// @param outfitIds The IDs of the outfits that'll be associated with the specified banny.
|
|
820
|
-
/// @param bodyUpc The UPC of the banny body
|
|
820
|
+
/// @param bodyUpc The UPC of the banny body to dress (used for default eyes selection).
|
|
821
821
|
/// @return contents The SVG contents of the outfits.
|
|
822
822
|
function _outfitContentsFor(
|
|
823
823
|
address hook,
|
|
@@ -919,7 +919,7 @@ contract Banny721TokenUriResolver is
|
|
|
919
919
|
}
|
|
920
920
|
|
|
921
921
|
/// @notice The name of each token's product type.
|
|
922
|
-
/// @param upc The ID of the token whose product type
|
|
922
|
+
/// @param upc The ID of the token whose product type to name.
|
|
923
923
|
/// @return name The item's product name.
|
|
924
924
|
function _productNameOf(uint256 upc) internal view returns (string memory) {
|
|
925
925
|
// Get the token's name.
|
|
@@ -945,10 +945,10 @@ contract Banny721TokenUriResolver is
|
|
|
945
945
|
return _storeOf(hook).tierOfTokenId({hook: hook, tokenId: tokenId, includeResolvedUri: false});
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
-
/// @notice Revert if an equipped asset is
|
|
948
|
+
/// @notice Revert if an equipped asset is reassigned away from a locked source body.
|
|
949
949
|
/// @param hook The hook storing the assets.
|
|
950
950
|
/// @param bannyBodyId The body currently using the asset.
|
|
951
|
-
/// @param exemptBodyId The destination body currently
|
|
951
|
+
/// @param exemptBodyId The destination body currently decorated.
|
|
952
952
|
function _revertIfBodyLocked(address hook, uint256 bannyBodyId, uint256 exemptBodyId) internal view {
|
|
953
953
|
// Outfit locks are user-selected display locks; timestamp tolerance is acceptable here.
|
|
954
954
|
// forge-lint: disable-next-line(block-timestamp)
|
|
@@ -1100,7 +1100,7 @@ contract Banny721TokenUriResolver is
|
|
|
1100
1100
|
/// NFTs) or re-equip different items. Sellers should unequip valuable outfits before transferring a banny body.
|
|
1101
1101
|
///
|
|
1102
1102
|
/// @param hook The hook storing the assets.
|
|
1103
|
-
/// @param bannyBodyId The ID of the banny body
|
|
1103
|
+
/// @param bannyBodyId The ID of the banny body to dress.
|
|
1104
1104
|
/// @param backgroundId The ID of the background that'll be associated with the specified banny.
|
|
1105
1105
|
/// @param outfitIds The IDs of the outfits that'll be associated with the specified banny. Only one outfit per
|
|
1106
1106
|
/// outfit category allowed at a time and they must be passed in order.
|
|
@@ -1169,7 +1169,7 @@ contract Banny721TokenUriResolver is
|
|
|
1169
1169
|
// transfers. Users and UIs should always use safeTransferFrom.
|
|
1170
1170
|
/// @param operator The address that initiated the transaction.
|
|
1171
1171
|
/// @param from The address that initiated the transfer.
|
|
1172
|
-
/// @param tokenId The ID of the token
|
|
1172
|
+
/// @param tokenId The ID of the token to transfer.
|
|
1173
1173
|
/// @param data The data of the transfer.
|
|
1174
1174
|
/// @return The ERC-721 receiver selector.
|
|
1175
1175
|
function onERC721Received(
|
|
@@ -1239,7 +1239,7 @@ contract Banny721TokenUriResolver is
|
|
|
1239
1239
|
|
|
1240
1240
|
/// @notice The owner of this contract can store SVG files for product IDs.
|
|
1241
1241
|
/// @param upcs The universal product codes of the products having SVGs stored.
|
|
1242
|
-
/// @param svgContents The svg contents
|
|
1242
|
+
/// @param svgContents The svg contents to store, not including the parent <svg></svg> element.
|
|
1243
1243
|
function setSvgContentsOf(uint256[] memory upcs, string[] calldata svgContents) external override {
|
|
1244
1244
|
if (upcs.length != svgContents.length) revert Banny721TokenUriResolver_ArrayLengthMismatch();
|
|
1245
1245
|
|
|
@@ -1273,7 +1273,7 @@ contract Banny721TokenUriResolver is
|
|
|
1273
1273
|
/// @notice Allows the owner of this contract to upload the hash of an svg file for a universal product code.
|
|
1274
1274
|
/// @dev This allows anyone to lazily upload the correct svg file.
|
|
1275
1275
|
/// @param upcs The universal product codes of the products having SVG hashes stored.
|
|
1276
|
-
/// @param svgHashes The svg hashes
|
|
1276
|
+
/// @param svgHashes The svg hashes to store, not including the parent <svg></svg> element.
|
|
1277
1277
|
function setSvgHashesOf(uint256[] memory upcs, bytes32[] memory svgHashes) external override onlyOwner {
|
|
1278
1278
|
if (upcs.length != svgHashes.length) revert Banny721TokenUriResolver_ArrayLengthMismatch();
|
|
1279
1279
|
|
|
@@ -1301,7 +1301,7 @@ contract Banny721TokenUriResolver is
|
|
|
1301
1301
|
|
|
1302
1302
|
/// @notice Add a background to a banny body.
|
|
1303
1303
|
/// @param hook The hook storing the assets.
|
|
1304
|
-
/// @param bannyBodyId The ID of the banny body
|
|
1304
|
+
/// @param bannyBodyId The ID of the banny body to dress.
|
|
1305
1305
|
/// @param backgroundId The ID of the background that'll be associated with the specified banny.
|
|
1306
1306
|
/// @param sender The cached msg sender.
|
|
1307
1307
|
function _decorateBannyWithBackground(
|
|
@@ -1387,9 +1387,9 @@ contract Banny721TokenUriResolver is
|
|
|
1387
1387
|
}
|
|
1388
1388
|
|
|
1389
1389
|
/// @notice Add outfits to a banny body.
|
|
1390
|
-
/// @dev The caller must own the banny body
|
|
1390
|
+
/// @dev The caller must own the banny body to dress and all outfits to wear.
|
|
1391
1391
|
/// @param hook The hook storing the assets.
|
|
1392
|
-
/// @param bannyBodyId The ID of the banny body
|
|
1392
|
+
/// @param bannyBodyId The ID of the banny body to dress.
|
|
1393
1393
|
/// @param outfitIds The IDs of the outfits that'll be associated with the specified banny. Only one outfit per
|
|
1394
1394
|
/// outfit category allowed at a time and they must be passed in order.
|
|
1395
1395
|
/// @param sender The cached msg sender.
|
|
@@ -1576,7 +1576,7 @@ contract Banny721TokenUriResolver is
|
|
|
1576
1576
|
/// @dev Entries in `previousOutfitIds` that are still non-zero represent outfits whose transfer back to the
|
|
1577
1577
|
/// owner failed. These are appended to `outfitIds` so the attachment record is preserved and the owner can retry.
|
|
1578
1578
|
/// @param hook The hook storing the assets.
|
|
1579
|
-
/// @param bannyBodyId The ID of the banny body
|
|
1579
|
+
/// @param bannyBodyId The ID of the banny body to dress.
|
|
1580
1580
|
/// @param outfitIds The new outfit IDs to store.
|
|
1581
1581
|
/// @param previousOutfitIds The previous outfit IDs array (zeroed entries were successfully transferred or
|
|
1582
1582
|
/// handled).
|
|
@@ -1645,7 +1645,7 @@ contract Banny721TokenUriResolver is
|
|
|
1645
1645
|
}
|
|
1646
1646
|
|
|
1647
1647
|
/// @notice Transfer a token from one address to another.
|
|
1648
|
-
/// @param hook The 721 contract of the token
|
|
1648
|
+
/// @param hook The 721 contract of the token to transfer.
|
|
1649
1649
|
/// @param from The address to transfer the token from.
|
|
1650
1650
|
/// @param to The address to transfer the token to.
|
|
1651
1651
|
/// @param assetId The ID of the token to transfer.
|
|
@@ -1655,7 +1655,7 @@ contract Banny721TokenUriResolver is
|
|
|
1655
1655
|
|
|
1656
1656
|
/// @notice Try to transfer a token, returning whether the transfer succeeded.
|
|
1657
1657
|
/// @dev Used when returning previously equipped items that may no longer exist.
|
|
1658
|
-
/// @param hook The 721 contract of the token
|
|
1658
|
+
/// @param hook The 721 contract of the token to transfer.
|
|
1659
1659
|
/// @param from The address to transfer the token from.
|
|
1660
1660
|
/// @param to The address to transfer the token to.
|
|
1661
1661
|
/// @param assetId The ID of the token to transfer.
|