library SushiswapLibrary {
  // calculates the CREATE2 address for a pair without making any external calls
  function pairFor(
    address factory,
    address tokenA,
    address tokenB
  ) internal pure returns (address pair) {
    (address token0, address token1) =
      UniswapV2Library.sortTokens(tokenA, tokenB);
    pair = address(
      uint256(
        keccak256(
          abi.encodePacked(
            hex"ff",
            factory,
            keccak256(abi.encodePacked(token0, token1)),
            hex"e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303" // init code hash
          )
        )
      )
    );
  }
}
function pairFor(
  address factory,
  address tokenA,
  address tokenB
) internal pure returns (address pair) {
  (address token0, address token1) =
    UniswapV2Library.sortTokens(tokenA, tokenB);
  pair = address(
    uint256(
      keccak256(
        abi.encodePacked(
          hex"ff",
          factory,
          keccak256(abi.encodePacked(token0, token1)),
          hex"e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303" // init code hash
        )
      )
    )
  );
}

// calculates the CREATE2 address for a pair without making any external calls