From 63b8404e26ff6e8b0104088f8d1fdbbdb39648fb Mon Sep 17 00:00:00 2001 From: Jeff Bennett Date: Tue, 20 Aug 2024 11:37:20 -0400 Subject: [PATCH] Initialize is now non-reentrant --- docs/concepts/core-concepts/hooks.md | 2 +- docs/developer-reference/contracts/hooks-api.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/concepts/core-concepts/hooks.md b/docs/concepts/core-concepts/hooks.md index 8c622a07..27ce0b1c 100644 --- a/docs/concepts/core-concepts/hooks.md +++ b/docs/concepts/core-concepts/hooks.md @@ -29,7 +29,7 @@ Hooks are implemented as standalone contracts that can have their own internal l - `onAfterSwap` - `onComputeDynamicSwapFeePercentage` -Refer to the [Pool hooks API](/developer-reference/contracts/hooks-api.html) page for full function references. +Refer to the [Pool hooks API](/developer-reference/contracts/hooks-api.html) page for full function references. The swap, liquidity, and dynamic swap fee hooks are reentrant (i.e., you can call additional Vault operations during them, such as a swap after adding liquidity). Each Hook contract must implement the `getHookFlags` function which returns a `HookFlags` indicating which hooks are supported: ```solidity diff --git a/docs/developer-reference/contracts/hooks-api.md b/docs/developer-reference/contracts/hooks-api.md index 450ebea6..21768faf 100644 --- a/docs/developer-reference/contracts/hooks-api.md +++ b/docs/developer-reference/contracts/hooks-api.md @@ -51,7 +51,7 @@ Returns flags informing which hooks are implemented in the contract. ```solidity function onBeforeInitialize(uint256[] memory exactAmountsIn, bytes memory userData) external returns (bool); ``` -Optional hook to be executed before pool initialization. +Optional hook to be executed before pool initialization. Note that unlike the swap and liquidity hooks, the initialize hooks are non-reentrant. **Parameters:** @@ -75,7 +75,7 @@ function onAfterInitialize( bytes memory userData ) external returns (bool); ``` -Optional hook to be executed after pool initialization. +Optional hook to be executed after pool initialization. Note that unlike the swap and liquidity hooks, the initialize hooks are non-reentrant. **Parameters:**