@@ -4,7 +4,6 @@ pragma solidity ^0.8.0;
44import "./interface/ITokenBundle.sol " ;
55
66abstract contract TokenBundle is ITokenBundle {
7-
87 /// @dev Mapping from bundle UID => bundle info.
98 mapping (uint256 => BundleInfo) private bundle;
109
@@ -25,16 +24,14 @@ abstract contract TokenBundle is ITokenBundle {
2524
2625 /// @dev Lets the calling contract create/update a bundle, by passing in a list of tokens and a unique id.
2726 function _setBundle (Token[] calldata _tokensToBind , uint256 _bundleId ) internal {
28-
2927 require (_tokensToBind.length > 0 , "TokenBundle: no tokens to bind. " );
3028
3129 uint256 currentCount = bundle[_bundleId].count;
3230 uint256 targetCount = _tokensToBind.length ;
3331 uint256 check = currentCount > targetCount ? currentCount : targetCount;
34-
35- for (uint256 i = 0 ; i < check; i += 1 ) {
3632
37- if (i < targetCount) {
33+ for (uint256 i = 0 ; i < check; i += 1 ) {
34+ if (i < targetCount) {
3835 bundle[_bundleId].tokens[i] = _tokensToBind[i];
3936 } else if (i < currentCount) {
4037 delete bundle[_bundleId].tokens[i];
@@ -45,10 +42,7 @@ abstract contract TokenBundle is ITokenBundle {
4542 }
4643
4744 /// @dev Lets the calling contract add a token to a bundle for a unique bundle id and index.
48- function _addTokenInBundle (
49- Token memory _tokenToBind ,
50- uint256 _bundleId
51- ) internal {
45+ function _addTokenInBundle (Token memory _tokenToBind , uint256 _bundleId ) internal {
5246 uint256 id = bundle[_bundleId].count;
5347
5448 bundle[_bundleId].tokens[id] = _tokenToBind;
0 commit comments