@ballkidz/defifa 0.0.2 → 0.0.3

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.
@@ -241,36 +241,6 @@ contract DefifaTokenUriResolver is IDefifaTokenUriResolver, IJB721TokenUriResolv
241
241
  return string.concat(parts[0], Base64.encode(abi.encodePacked(parts[1], parts[2], parts[3])));
242
242
  }
243
243
 
244
- /// @notice Gets a substring.
245
- /// @dev If the first character is a space, it is not included.
246
- /// @param _str The string to get a substring of.
247
- /// @param _startIndex The first index of the substring from within the string.
248
- /// @param _endIndex The last index of the string from within the string.
249
- /// @return substring The substring.
250
- function _getSubstring(
251
- string memory _str,
252
- uint256 _startIndex,
253
- uint256 _endIndex
254
- )
255
- internal
256
- pure
257
- returns (string memory substring)
258
- {
259
- bytes memory _strBytes = bytes(_str);
260
- if (_startIndex >= _strBytes.length) return "";
261
- if (_endIndex > _strBytes.length) _endIndex = _strBytes.length;
262
- _startIndex = _strBytes[_startIndex] == bytes1(0x20) ? _startIndex + 1 : _startIndex;
263
- if (_startIndex >= _endIndex) return "";
264
- bytes memory _result = new bytes(_endIndex - _startIndex);
265
- for (uint256 _i = _startIndex; _i < _endIndex;) {
266
- _result[_i - _startIndex] = _strBytes[_i];
267
- unchecked {
268
- ++_i;
269
- }
270
- }
271
- return string(_result);
272
- }
273
-
274
244
  /// @notice Formats a balance from a fixed point number to a string.
275
245
  /// @param _amount The fixed point amount.
276
246
  /// @param _token The token the amount is in.
@@ -309,4 +279,34 @@ contract DefifaTokenUriResolver is IDefifaTokenUriResolver, IJB721TokenUriResolv
309
279
  ? string(abi.encodePacked("\u039E", _integerPart, ".", _decimalPartStr))
310
280
  : string(abi.encodePacked(_integerPart, ".", _decimalPartStr, " ", IERC20Metadata(_token).symbol()));
311
281
  }
282
+
283
+ /// @notice Gets a substring.
284
+ /// @dev If the first character is a space, it is not included.
285
+ /// @param _str The string to get a substring of.
286
+ /// @param _startIndex The first index of the substring from within the string.
287
+ /// @param _endIndex The last index of the string from within the string.
288
+ /// @return substring The substring.
289
+ function _getSubstring(
290
+ string memory _str,
291
+ uint256 _startIndex,
292
+ uint256 _endIndex
293
+ )
294
+ internal
295
+ pure
296
+ returns (string memory substring)
297
+ {
298
+ bytes memory _strBytes = bytes(_str);
299
+ if (_startIndex >= _strBytes.length) return "";
300
+ if (_endIndex > _strBytes.length) _endIndex = _strBytes.length;
301
+ _startIndex = _strBytes[_startIndex] == bytes1(0x20) ? _startIndex + 1 : _startIndex;
302
+ if (_startIndex >= _endIndex) return "";
303
+ bytes memory _result = new bytes(_endIndex - _startIndex);
304
+ for (uint256 _i = _startIndex; _i < _endIndex;) {
305
+ _result[_i - _startIndex] = _strBytes[_i];
306
+ unchecked {
307
+ ++_i;
308
+ }
309
+ }
310
+ return string(_result);
311
+ }
312
312
  }