@@ -646,33 +646,17 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
646
646
return userType;
647
647
}
648
648
649
- function _shuffle (IStrategy[] memory strats ) internal returns (IStrategy[] memory ) {
650
- // Fisher-Yates shuffle algorithm
651
- for (uint i = strats.length - 1 ; i > 0 ; i-- ) {
652
- uint randomIndex = _randUint ({min: 0 , max: i});
653
-
654
- // Swap elements
655
- IStrategy temp = strats[i];
656
- strats[i] = strats[randomIndex];
657
- strats[randomIndex] = temp;
658
- }
659
-
660
- return strats;
661
- }
662
-
663
649
/**
664
650
* @dev Converts a bitmap into an array of bytes
665
651
* @dev Each byte in the input is processed as indicating a single bit to flip in the bitmap
666
652
*/
667
653
function _bitmapToBytes (uint bitmap ) internal pure returns (bytes memory bytesArray ) {
668
- for (uint i = 0 ; i < 256 ; ++ i) {
669
- // Mask for i-th bit
670
- uint mask = uint (1 << i);
671
-
672
- // If the i-th bit is flipped, add a byte to the return array
673
- if (bitmap & mask != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (1 << i)));
674
- }
675
- return bytesArray;
654
+ // Asset type flags
655
+ if (bitmap & NO_ASSETS != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (1 )));
656
+ if (bitmap & HOLDS_LST != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (2 )));
657
+ if (bitmap & HOLDS_ETH != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (4 )));
658
+ if (bitmap & HOLDS_ALL != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (8 )));
659
+ if (bitmap & HOLDS_MAX != 0 ) bytesArray = bytes .concat (bytesArray, bytes1 (uint8 (16 )));
676
660
}
677
661
678
662
function _hash (string memory x ) internal pure returns (bytes32 ) {
0 commit comments