@@ -17,7 +17,7 @@ interface IERC165 {
1717
1818abstract contract TokenBundle is ITokenBundle {
1919 /// @dev Mapping from bundle UID => bundle info.
20- mapping (uint256 => BundleInfo) private bundle;
20+ mapping (uint256 => BundleInfo) public bundle;
2121
2222 /// @dev Returns the total number of assets in a particular bundle.
2323 function getTokenCountOfBundle (uint256 _bundleId ) public view returns (uint256 ) {
@@ -38,8 +38,8 @@ abstract contract TokenBundle is ITokenBundle {
3838 function _createBundle (Token[] calldata _tokensToBind , uint256 _bundleId ) internal {
3939 uint256 targetCount = _tokensToBind.length ;
4040
41- require (targetCount > 0 , "TokenBundle: no tokens to bind. " );
42- require (bundle[_bundleId].count == 0 , "TokenBundle: existent at bundleId " );
41+ require (targetCount > 0 , "no tokens to bind " );
42+ require (bundle[_bundleId].count == 0 , "existent at bundleId " );
4343
4444 for (uint256 i = 0 ; i < targetCount; i += 1 ) {
4545 _checkTokenType (_tokensToBind[i]);
@@ -50,8 +50,8 @@ abstract contract TokenBundle is ITokenBundle {
5050 }
5151
5252 /// @dev Lets the calling contract update a bundle, by passing in a list of tokens and a unique id.
53- function _updateBundle (Token[] calldata _tokensToBind , uint256 _bundleId ) internal {
54- require (_tokensToBind.length > 0 , "TokenBundle: no tokens to bind. " );
53+ function _updateBundle (Token[] memory _tokensToBind , uint256 _bundleId ) internal {
54+ require (_tokensToBind.length > 0 , "no tokens to bind " );
5555
5656 uint256 currentCount = bundle[_bundleId].count;
5757 uint256 targetCount = _tokensToBind.length ;
@@ -84,7 +84,7 @@ abstract contract TokenBundle is ITokenBundle {
8484 uint256 _bundleId ,
8585 uint256 _index
8686 ) internal {
87- require (_index < bundle[_bundleId].count, "TokenBundle: index DNE. " );
87+ require (_index < bundle[_bundleId].count, "index DNE " );
8888 _checkTokenType (_tokenToBind);
8989 bundle[_bundleId].tokens[_index] = _tokenToBind;
9090 }
@@ -93,32 +93,32 @@ abstract contract TokenBundle is ITokenBundle {
9393 function _checkTokenType (Token memory _token ) internal view {
9494 if (_token.tokenType == TokenType.ERC721 ) {
9595 try IERC165 (_token.assetContract).supportsInterface (0x80ac58cd ) returns (bool supported721 ) {
96- require (supported721, "Asset doesn't match TokenType " );
96+ require (supported721, "! TokenType " );
9797 } catch {
98- revert ("Asset doesn't match TokenType " );
98+ revert ("! TokenType " );
9999 }
100100 } else if (_token.tokenType == TokenType.ERC1155 ) {
101101 try IERC165 (_token.assetContract).supportsInterface (0xd9b67a26 ) returns (bool supported1155 ) {
102- require (supported1155, "Asset doesn't match TokenType " );
102+ require (supported1155, "! TokenType " );
103103 } catch {
104- revert ("Asset doesn't match TokenType " );
104+ revert ("! TokenType " );
105105 }
106106 } else if (_token.tokenType == TokenType.ERC20 ) {
107107 if (_token.assetContract != CurrencyTransferLib.NATIVE_TOKEN) {
108108 // 0x36372b07
109109 try IERC165 (_token.assetContract).supportsInterface (0x80ac58cd ) returns (bool supported721 ) {
110- require (! supported721, "Asset doesn't match TokenType " );
110+ require (! supported721, "! TokenType " );
111111
112112 try IERC165 (_token.assetContract).supportsInterface (0xd9b67a26 ) returns (bool supported1155 ) {
113- require (! supported1155, "Asset doesn't match TokenType " );
113+ require (! supported1155, "! TokenType " );
114114 } catch Error (string memory ) {} catch {}
115115 } catch Error (string memory ) {} catch {}
116116 }
117117 }
118118 }
119119
120120 /// @dev Lets the calling contract set/update the uri of a particular bundle.
121- function _setUriOfBundle (string calldata _uri , uint256 _bundleId ) internal {
121+ function _setUriOfBundle (string memory _uri , uint256 _bundleId ) internal {
122122 bundle[_bundleId].uri = _uri;
123123 }
124124
0 commit comments