Skip to content

Commit

Permalink
Add warnings to natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
cairoeth committed Dec 11, 2024
1 parent 2e1913f commit 3805dce
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/base/BaseCustomAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import {CurrencySettler} from "v4-core/test/utils/CurrencySettler.sol";
/**
* @dev Base implementation for custom accounting, including support for swaps and liquidity management.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract BaseCustomAccounting is BaseHook {
Expand Down
6 changes: 5 additions & 1 deletion src/base/BaseCustomCurve.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ import {CurrencySettler} from "v4-core/test/utils/CurrencySettler.sol";
* to be taken or settled, and a return delta is created based on their outputs. This return delta is then
* consumed by the `PoolManager`.
*
* IMPORTANT: This base contract acts similarly to {BaseNoOp}, which means that the hook must hold the liquidity
* NOTE: This base contract acts similarly to {BaseNoOp}, which means that the hook must hold the liquidity
* for swaps.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract BaseCustomCurve is BaseCustomAccounting {
Expand Down
4 changes: 4 additions & 0 deletions src/base/BaseHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {BeforeSwapDelta} from "v4-core/src/types/BeforeSwapDelta.sol";
* This contract defines all hook entry points, as well as security and permission helpers.
* Based on the https://github.com/Uniswap/v4-periphery/blob/main/src/base/hooks/BaseHook.sol[Uniswap v4 periphery implementation].
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract BaseHook is IHooks {
Expand Down
8 changes: 6 additions & 2 deletions src/base/BaseNoOp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ import {SafeCast} from "v4-core/src/libraries/SafeCast.sol";
/**
* @dev Base implementation for no-op hooks.
*
* IMPORTANT: Given that this contract overrides default logic of the `PoolManager`, liquidity
* must be provided by the hook itself (i.e. the hook must hold the liquidity/tokens).
* NOTE: Given that this contract overrides default logic of the `PoolManager`, liquidity must be
* provided by the hook itself (i.e. the hook must hold the liquidity/tokens).
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
Expand Down
4 changes: 4 additions & 0 deletions src/fee/BaseDynamicFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
/**
* @dev Base implementation to apply a dynamic fee via the PoolManager's {updateDynamicLPFee} function.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract BaseDynamicFee is BaseHook {
Expand Down
4 changes: 4 additions & 0 deletions src/fee/BaseOverrideFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {LPFeeLibrary} from "v4-core/src/libraries/LPFeeLibrary.sol";
/**
* @dev Base implementation for automatic dynamic fees applied before swaps.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract BaseOverrideFee is BaseHook {
Expand Down
4 changes: 4 additions & 0 deletions src/fee/DynamicAfterFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
* the {afterSwap} function is called. Refer to the {AntiSandwichHook} contract as an example
* implementation of this pattern.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
abstract contract DynamicAfterFee is BaseHook {
Expand Down
4 changes: 4 additions & 0 deletions src/general/AntiSandwichHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import {StateLibrary} from "v4-core/src/libraries/StateLibrary.sol";
* NOTE: Swaps in the other direction do not get the positive price difference
* compared to the initial price before the first block swap.
*
* WARNING: This is experimental software and is provided on an "as is" and "as available" basis. We do
* not give any warranties and will not be liable for any losses incurred through any use of this code
* base.
*
* _Available since v0.1.0_
*/
contract AntiSandwichHook is DynamicAfterFee {
Expand Down

0 comments on commit 3805dce

Please sign in to comment.