Skip to content

Commit

Permalink
Merge pull request #138 from balancer/initialize-changes
Browse files Browse the repository at this point in the history
Initialize hooks are now non-reentrant
  • Loading branch information
mkflow27 authored Sep 30, 2024
2 parents 5272722 + 63b8404 commit 110667d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/core-concepts/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/developer-reference/contracts/hooks-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand All @@ -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:**

Expand Down

0 comments on commit 110667d

Please sign in to comment.