From 0f17b65aa61edee384d5129b7ea080f22905faa0 Mon Sep 17 00:00:00 2001 From: Sara Reynolds <30504811+snreynolds@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:11:44 +0000 Subject: [PATCH 1/2] update licenses (#916) * update licenses * Update README.md Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com> * formatting --------- Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com> Co-authored-by: Alice Henshaw --- LICENSE | 100 ---------------------- README.md | 8 +- licenses/BUSL_LICENSE | 63 ++++++++++++++ licenses/MIT_LICENSE | 7 ++ src/ProtocolFees.sol | 2 +- src/interfaces/external/IERC20Minimal.sol | 2 +- src/libraries/BitMath.sol | 2 +- src/libraries/FixedPoint128.sol | 2 +- src/libraries/FixedPoint96.sol | 2 +- src/libraries/LPFeeLibrary.sol | 2 +- src/libraries/LiquidityMath.sol | 2 +- src/libraries/ParseBytes.sol | 2 +- src/libraries/ProtocolFeeLibrary.sol | 2 +- src/libraries/SafeCast.sol | 2 +- src/libraries/SqrtPriceMath.sol | 2 +- src/libraries/SwapMath.sol | 2 +- src/libraries/TickMath.sol | 2 +- src/libraries/UnsafeMath.sol | 2 +- 18 files changed, 85 insertions(+), 121 deletions(-) delete mode 100644 LICENSE create mode 100644 licenses/BUSL_LICENSE create mode 100644 licenses/MIT_LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index bacf34bba..000000000 --- a/LICENSE +++ /dev/null @@ -1,100 +0,0 @@ -Business Source License 1.1 - -License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. -"Business Source License" is a trademark of MariaDB Corporation Ab. - ------------------------------------------------------------------------------ - -Parameters - -Licensor: Uniswap Labs - -Licensed Work: Uniswap V4 Core - The Licensed Work is (c) 2023 Uniswap Labs - -Additional Use Grant: Any uses listed and defined at - v4-core-license-grants.uniswap.eth - -Change Date: The earlier of 2027-06-15 or a date specified at - v4-core-license-date.uniswap.eth - -Change License: GNU General Public License v2.0 or later - ------------------------------------------------------------------------------ - -Terms - -The Licensor hereby grants you the right to copy, modify, create derivative -works, redistribute, and make non-production use of the Licensed Work. The -Licensor may make an Additional Use Grant, above, permitting limited -production use. - -Effective on the Change Date, or the fourth anniversary of the first publicly -available distribution of a specific version of the Licensed Work under this -License, whichever comes first, the Licensor hereby grants you rights under -the terms of the Change License, and the rights granted in the paragraph -above terminate. - -If your use of the Licensed Work does not comply with the requirements -currently in effect as described in this License, you must purchase a -commercial license from the Licensor, its affiliated entities, or authorized -resellers, or you must refrain from using the Licensed Work. - -All copies of the original and modified Licensed Work, and derivative works -of the Licensed Work, are subject to this License. This License applies -separately for each version of the Licensed Work and the Change Date may vary -for each version of the Licensed Work released by Licensor. - -You must conspicuously display this License on each original or modified copy -of the Licensed Work. If you receive the Licensed Work in original or -modified form from a third party, the terms and conditions set forth in this -License apply to your use of that work. - -Any use of the Licensed Work in violation of this License will automatically -terminate your rights under this License for the current and all other -versions of the Licensed Work. - -This License does not grant you any right in any trademark or logo of -Licensor or its affiliates (provided that you may use a trademark or logo of -Licensor as expressly required by this License). - -TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -TITLE. - -MariaDB hereby grants you permission to use this License’s text to license -your works, and to refer to it using the trademark "Business Source License", -as long as you comply with the Covenants of Licensor below. - ------------------------------------------------------------------------------ - -Covenants of Licensor - -In consideration of the right to use this License’s text and the "Business -Source License" name and trademark, Licensor covenants to MariaDB, and to all -other recipients of the licensed work to be provided by Licensor: - -1. To specify as the Change License the GPL Version 2.0 or any later version, - or a license that is compatible with GPL Version 2.0 or a later version, - where "compatible" means that software provided under the Change License can - be included in a program with software provided under GPL Version 2.0 or a - later version. Licensor may specify additional Change Licenses without - limitation. - -2. To either: (a) specify an additional grant of rights to use that does not - impose any additional restriction on the right granted in this License, as - the Additional Use Grant; or (b) insert the text "None". - -3. To specify a Change Date. - -4. Not to modify this License in any other way. - ------------------------------------------------------------------------------ - -Notice - -The Business Source License (this document, or the "License") is not an Open -Source license. However, the Licensed Work will eventually be made available -under an Open Source License, as stated in this License. \ No newline at end of file diff --git a/README.md b/README.md index 53abf7601..3a8a52716 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,4 @@ contract MyContract is IUnlockCallback { ## License -The primary license for Uniswap V4 Core is the Business Source License 1.1 (`BUSL-1.1`), see [LICENSE](https://github.com/Uniswap/v4-core/blob/main/LICENSE). Minus the following exceptions: - -- Some [libraries](./src/libraries) have a GPL license -- Both [FullMath.sol](./src/libraries/FullMath.sol) and [Hooks.sol](./src/libraries/Hooks.sol) have an MIT License -- [Interfaces](./src/interfaces) and [types](./src/types/) have an MIT license - -Each of these files states their license type. +Uniswap V4 Core is licensed under the Business Source License 1.1 (`BUSL-1.1`), see [BUSL_LICENSE](https://github.com/Uniswap/v4-core/blob/main/licenses/BUSL_LICENSE), and the MIT License (`MIT`), see [MIT_LICENSE](https://github.com/Uniswap/v4-core/blob/main/licenses/BUSL_LICENSE). Each file in Uniswap V4 Core states the applicable license type in the header. diff --git a/licenses/BUSL_LICENSE b/licenses/BUSL_LICENSE new file mode 100644 index 000000000..8cbb61926 --- /dev/null +++ b/licenses/BUSL_LICENSE @@ -0,0 +1,63 @@ +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: Universal Navigation Inc. + +Licensed Work: Uniswap V4 Core + The Licensed Work is (c) 2023 Universal Navigation Inc. + +Additional Use Grant: Any uses listed and defined at + v4-core-license-grants.uniswap.eth + +Change Date: The earlier of 2027-06-15 or a date specified at + v4-core-license-date.uniswap.eth + +Change License: MIT License + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate. + +If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. + +MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark "Business Source License", as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation. + +2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. + +----------------------------------------------------------------------------- + +Notice + +The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License. diff --git a/licenses/MIT_LICENSE b/licenses/MIT_LICENSE new file mode 100644 index 000000000..e1ac41ac3 --- /dev/null +++ b/licenses/MIT_LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 Universal Navigation Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/ProtocolFees.sol b/src/ProtocolFees.sol index 8d6c5d9ce..36d29d666 100644 --- a/src/ProtocolFees.sol +++ b/src/ProtocolFees.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Currency} from "./types/Currency.sol"; diff --git a/src/interfaces/external/IERC20Minimal.sol b/src/interfaces/external/IERC20Minimal.sol index 1d3d982a2..11e1db4e9 100644 --- a/src/interfaces/external/IERC20Minimal.sol +++ b/src/interfaces/external/IERC20Minimal.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Minimal ERC20 interface for Uniswap diff --git a/src/libraries/BitMath.sol b/src/libraries/BitMath.sol index 764fe55fb..6c20495bb 100644 --- a/src/libraries/BitMath.sol +++ b/src/libraries/BitMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title BitMath diff --git a/src/libraries/FixedPoint128.sol b/src/libraries/FixedPoint128.sol index 2dbdfc1e5..ef69ae80e 100644 --- a/src/libraries/FixedPoint128.sol +++ b/src/libraries/FixedPoint128.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title FixedPoint128 diff --git a/src/libraries/FixedPoint96.sol b/src/libraries/FixedPoint96.sol index 46ef263de..8e704cb34 100644 --- a/src/libraries/FixedPoint96.sol +++ b/src/libraries/FixedPoint96.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title FixedPoint96 diff --git a/src/libraries/LPFeeLibrary.sol b/src/libraries/LPFeeLibrary.sol index b7e145332..5a68f963e 100644 --- a/src/libraries/LPFeeLibrary.sol +++ b/src/libraries/LPFeeLibrary.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {CustomRevert} from "./CustomRevert.sol"; diff --git a/src/libraries/LiquidityMath.sol b/src/libraries/LiquidityMath.sol index 68885578b..ce5cfcd4f 100644 --- a/src/libraries/LiquidityMath.sol +++ b/src/libraries/LiquidityMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Math library for liquidity diff --git a/src/libraries/ParseBytes.sol b/src/libraries/ParseBytes.sol index 2f6ba2175..3503fe4a4 100644 --- a/src/libraries/ParseBytes.sol +++ b/src/libraries/ParseBytes.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; diff --git a/src/libraries/ProtocolFeeLibrary.sol b/src/libraries/ProtocolFeeLibrary.sol index 512a49928..c155b86aa 100644 --- a/src/libraries/ProtocolFeeLibrary.sol +++ b/src/libraries/ProtocolFeeLibrary.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @notice library of functions related to protocol fees diff --git a/src/libraries/SafeCast.sol b/src/libraries/SafeCast.sol index b2acd8c2c..118b02cd1 100644 --- a/src/libraries/SafeCast.sol +++ b/src/libraries/SafeCast.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {CustomRevert} from "./CustomRevert.sol"; diff --git a/src/libraries/SqrtPriceMath.sol b/src/libraries/SqrtPriceMath.sol index 659b750e1..0b706ba13 100644 --- a/src/libraries/SqrtPriceMath.sol +++ b/src/libraries/SqrtPriceMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {SafeCast} from "./SafeCast.sol"; diff --git a/src/libraries/SwapMath.sol b/src/libraries/SwapMath.sol index 2142655a7..92599e5d3 100644 --- a/src/libraries/SwapMath.sol +++ b/src/libraries/SwapMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {FullMath} from "./FullMath.sol"; diff --git a/src/libraries/TickMath.sol b/src/libraries/TickMath.sol index daebab87d..e5dc4adca 100644 --- a/src/libraries/TickMath.sol +++ b/src/libraries/TickMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {BitMath} from "./BitMath.sol"; diff --git a/src/libraries/UnsafeMath.sol b/src/libraries/UnsafeMath.sol index 4c313952a..ed88beca3 100644 --- a/src/libraries/UnsafeMath.sol +++ b/src/libraries/UnsafeMath.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Math functions that do not check inputs or outputs From b619b6718e31aa5b4fa0286520c455ceb950276d Mon Sep 17 00:00:00 2001 From: Mark Gretzke <65617397+vimageDE@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:14:04 +0100 Subject: [PATCH 2/2] standardize the init code hash (#917) disable the inclusion of the metadata hash in the creation code --- foundry.toml | 1 + snapshots/PoolManagerTest.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 1e633aaed..7cc053d2d 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,6 +6,7 @@ fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}, { access solc = "0.8.26" evm_version = "cancun" gas_limit = "300000000" +bytecode_hash = "none" [profile.default.fuzz] runs = 1000 diff --git a/snapshots/PoolManagerTest.json b/snapshots/PoolManagerTest.json index 4b6cd6039..d43defca1 100644 --- a/snapshots/PoolManagerTest.json +++ b/snapshots/PoolManagerTest.json @@ -5,7 +5,7 @@ "donate gas with 2 tokens": "145510", "erc20 collect protocol fees": "57500", "native collect protocol fees": "59643", - "poolManager bytecode size": "24050", + "poolManager bytecode size": "24009", "removeLiquidity with empty hook": "130613", "removeLiquidity with native token": "112523", "simple addLiquidity": "161276",