@@ -283,7 +283,7 @@ Customizable handler called after `_afterSwap` to handle or distribute the fees.
-Set the hook permissions, specifically [`BaseHook.beforeSwap`](/uniswap-hooks/base#BaseHook-beforeSwap-address-struct-PoolKey-struct-SwapParams-bytes-), [`BaseHook.afterSwap`](/uniswap-hooks/base#BaseHook-afterSwap-address-struct-PoolKey-struct-SwapParams-BalanceDelta-bytes-) and `afterSwapReturnDelta`.
+Set the hook permissions, specifically [`BaseHook.beforeSwap`](/uniswap-hooks/api/base#BaseHook-beforeSwap-address-struct-PoolKey-struct-SwapParams-bytes-), [`BaseHook.afterSwap`](/uniswap-hooks/api/base#BaseHook-afterSwap-address-struct-PoolKey-struct-SwapParams-BalanceDelta-bytes-) and `afterSwapReturnDelta`.
diff --git a/content/uniswap-hooks/api/general.mdx b/content/uniswap-hooks/api/general.mdx
index 3db672b..703fadb 100644
--- a/content/uniswap-hooks/api/general.mdx
+++ b/content/uniswap-hooks/api/general.mdx
@@ -158,7 +158,7 @@ Handles the before swap hook.
For the first swap in a block, it saves the current pool state as a checkpoint.
For subsequent swaps in the same block, it calculates a target output based on the beginning-of-block state,
-and sets the inherited `_targetOutput` and `_applyTargetOutput` variables to enforce price limits in [`BaseHook._afterSwap`](/uniswap-hooks/base#BaseHook-_afterSwap-address-struct-PoolKey-struct-SwapParams-BalanceDelta-bytes-).
+and sets the inherited `_targetOutput` and `_applyTargetOutput` variables to enforce price limits in [`BaseHook._afterSwap`](/uniswap-hooks/api/base#BaseHook-_afterSwap-address-struct-PoolKey-struct-SwapParams-BalanceDelta-bytes-).
@@ -471,7 +471,7 @@ Hooks into the `afterSwap` hook to get the ticks crossed by the swap and fill th
Places a limit order by adding liquidity out of range at a specific tick. The order will be filled when the
pool price crosses the specified `tick`. Takes a `PoolKey` `key`, target `tick`, direction `zeroForOne` indicating
whether to buy currency0 or currency1, and amount of `liquidity` to place. The interaction with the `poolManager` is done
-via the `unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/base#BaseCustomAccounting-unlockCallback-bytes-) function.
+via the `unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/api/base#BaseCustomAccounting-unlockCallback-bytes-) function.
@@ -492,7 +492,7 @@ Cancels a limit order by removing liquidity from the pool. Takes a `PoolKey` `ke
direction `zeroForOne` indicating whether it was buying currency0 or currency1, and recipient address `to` for the
removed liquidity. Note that partial cancellation is not supported - the entire liquidity added by the msg.sender will be removed.
Note also that cancelling an order will cancel the order placed by the msg.sender, not orders placed by other users in the same tick range.
-The interaction with the `poolManager` is done via the `unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/base#BaseCustomAccounting-unlockCallback-bytes-) function.
+The interaction with the `poolManager` is done via the `unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/api/base#BaseCustomAccounting-unlockCallback-bytes-) function.
@@ -512,7 +512,7 @@ The interaction with the `poolManager` is done via the `unlock` function, which
Withdraws liquidity from a filled order, sending it to address `to`. Takes an `OrderId` `orderId` of the filled
order to withdraw from. Returns the withdrawn amounts as `(amount0, amount1)`. Can only be called after the order is
filled - use `cancelOrder` to remove liquidity from unfilled orders. The interaction with the `poolManager` is done via the
-`unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/base#BaseCustomAccounting-unlockCallback-bytes-) function.
+`unlock` function, which will trigger the [`BaseCustomAccounting.unlockCallback`](/uniswap-hooks/api/base#BaseCustomAccounting-unlockCallback-bytes-) function.
@@ -934,8 +934,8 @@ import "uniswap-hooks/src/general/LiquidityPenaltyHook.sol";
Just-in-Time (JIT) liquidity provisioning resistant hook.
-This hook disincentivizes JIT attacks by penalizing LP fee collection during [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-),
-and disabling it during [`BaseHook._afterAddLiquidity`](/uniswap-hooks/base#BaseHook-_afterAddLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) if liquidity was recently added to the position.
+This hook disincentivizes JIT attacks by penalizing LP fee collection during [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/api/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-),
+and disabling it during [`BaseHook._afterAddLiquidity`](/uniswap-hooks/api/base#BaseHook-_afterAddLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) if liquidity was recently added to the position.
The penalty is donated to the pool's liquidity providers in range at the time of removal.
See [`LiquidityPenaltyHook._calculateLiquidityPenalty`](#LiquidityPenaltyHook-_calculateLiquidityPenalty-BalanceDelta-uint48-) for penalty calculation.
@@ -1054,7 +1054,7 @@ Sets the `PoolManager` address and the `getBlockNumberOffset`.
Tracks `lastAddedLiquidityBlock` and withholds `feeDelta` if liquidity was recently added within
the `blockNumberOffset` period.
-See [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) for claiming the withheld fees back.
+See [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/api/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) for claiming the withheld fees back.
@@ -1221,7 +1221,7 @@ Returns the `withheldFees` for a liquidity position.
`withheldFees` are UniswapV4's `feesAccrued` retained by this hook during liquidity addition if liquidity
has been recently added within the `blockNumberOffset` block time window, with the purpose of disabling fee
-collection during JIT liquidity provisioning attacks. See [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) for claiming the fees back.
+collection during JIT liquidity provisioning attacks. See [`BaseHook._afterRemoveLiquidity`](/uniswap-hooks/api/base#BaseHook-_afterRemoveLiquidity-address-struct-PoolKey-struct-ModifyLiquidityParams-BalanceDelta-BalanceDelta-bytes-) for claiming the fees back.
diff --git a/content/upgrades-plugins/api-hardhat-upgrades.mdx b/content/upgrades-plugins/api-hardhat-upgrades.mdx
index 8600642..326439a 100644
--- a/content/upgrades-plugins/api-hardhat-upgrades.mdx
+++ b/content/upgrades-plugins/api-hardhat-upgrades.mdx
@@ -15,9 +15,9 @@ The following options are common to some functions.
* `"state-variable-assignment"`: Allows assigning state variables in a contract even though they will be stored in the implementation.
* `"state-variable-immutable"`: Allows use of immutable variables, which are not unsafe
* `"constructor"`: Allows defining a constructor. See `constructorArgs`.
- * `"delegatecall"`, `"selfdestruct"`: Allow the use of these operations. Incorrect use of this option can put funds at risk of permanent loss. See [Can I safely use `delegatecall` and `selfdestruct`?](/upgrades-plugins/faq#delegatecall-selfdestruct)
+ * `"delegatecall"`, `"selfdestruct"`: Allow the use of these operations. Incorrect use of this option can put funds at risk of permanent loss. See [Can I safely use `delegatecall` and `selfdestruct`?](/upgrades-plugins/faq#can-i-safely-use-delegatecall-and-selfdestruct)
* `"missing-public-upgradeto"`: Allow UUPS implementations that do not contain a public `upgradeTo` or `upgradeToAndCall` function. Enabling this option is likely to cause a revert due to the built-in UUPS safety mechanism.
- * `"internal-function-storage"`: Allow internal functions in storage variables. Internal functions are code pointers which will no longer be valid after an upgrade, so they must be reassigned during upgrades. See [How can I use internal functions in storage variables?](/upgrades-plugins/faq#internal-function-storage)
+ * `"internal-function-storage"`: Allow internal functions in storage variables. Internal functions are code pointers which will no longer be valid after an upgrade, so they must be reassigned during upgrades. See [How can I use internal functions in storage variables?](/upgrades-plugins/faq#how-can-i-use-internal-functions-in-storage-variables)
* `"missing-initializer"`: Allows implementations where an initializer function is not detected.
* `"missing-initializer-call"`: Allows implementations where a parent initializer is not called from the child initializer.
* `"duplicate-initializer-call"`: Allows implementations where a parent initializer is called more than once from the child initializer.
@@ -39,14 +39,14 @@ The following options are common to some functions.
* `useDefenderDeploy`: (`boolean`) Deploy contracts using OpenZeppelin Defender instead of ethers.js. See [Using with OpenZeppelin Defender](/upgrades-plugins/defender-deploy).
* `verifySourceCode`: (`boolean`) When using OpenZeppelin Defender deployments, whether to verify source code on block explorers. Defaults to `true`.
* `relayerId`: (`string`) When using OpenZeppelin Defender deployments, the ID of the relayer to use for the deployment. Defaults to the relayer configured for your deployment environment on Defender.
-* `salt`: (`string`) When using OpenZeppelin Defender deployments, if this is not set, deployments will be performed using the CREATE opcode. If this is set, deployments will be performed using the CREATE2 opcode with the provided salt. Note that deployments using a Safe are done using CREATE2 and require a salt. ***Warning:*** CREATE2 affects `msg.sender` behavior. See [Caveats](/defender/tutorial/deploy#deploy-caveat) for more information.
+* `salt`: (`string`) When using OpenZeppelin Defender deployments, if this is not set, deployments will be performed using the CREATE opcode. If this is set, deployments will be performed using the CREATE2 opcode with the provided salt. Note that deployments using a Safe are done using CREATE2 and require a salt. ***Warning:*** CREATE2 affects `msg.sender` behavior. See [Caveats](/defender/tutorial/deploy#caveats) for more information.
* `metadata`: (` commitHash?: string; tag?: string; [k: string]: any; `) When using OpenZeppelin Defender deployments, you can use this to identify, tag, or classify deployments. See [Metadata](/defender/module/deploy#metadata).
* `proxyFactory`: (`ethers.ContractFactory`) Customizes the ethers contract factory to use for deploying the proxy, allowing a custom proxy contract to be deployed. See [factories.ts](https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/plugin-hardhat/src/utils/factories.ts) for the default contract factory for each kind of proxy.
* **Since:** `@openzeppelin/hardhat-upgrades@3.7.0`
* `deployFunction`: (`(hre, opts, factory, ...args) => Promise`) Customizes the function used to deploy the proxy. Can be used along with the `proxyFactory` option to override constructor parameters for custom proxy deployments. See [deploy.ts](https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/plugin-hardhat/src/utils/deploy.ts) for the default deploy function.
* **Since:** `@openzeppelin/hardhat-upgrades@3.7.0`
-Note that the options `unsafeAllow` can also be specified in a more granular way directly in the source code if using Solidity >=0.8.2. See [How can I disable some of the checks?](/upgrades-plugins/faq#how-can-i-disable-checks)
+Note that the options `unsafeAllow` can also be specified in a more granular way directly in the source code if using Solidity >=0.8.2. See [How can I disable some of the checks?](/upgrades-plugins/faq#how-can-i-disable-some-of-the-checks)
The following options have been deprecated.
diff --git a/content/upgrades-plugins/api-truffle-upgrades.mdx b/content/upgrades-plugins/api-truffle-upgrades.mdx
index 49b190d..121e90d 100644
--- a/content/upgrades-plugins/api-truffle-upgrades.mdx
+++ b/content/upgrades-plugins/api-truffle-upgrades.mdx
@@ -20,7 +20,7 @@ The following options are common to some functions.
* `"state-variable-assignment"`: Allows assigning state variables in a contract even though they will be stored in the implementation.
* `"state-variable-immutable"`: Allows use of immutable variables, which are not unsafe
* `"constructor"`: Allows defining a constructor. See `constructorArgs`.
- * `"delegatecall"`, `"selfdestruct"`: Allow the use of these operations. Incorrect use of this option can put funds at risk of permanent loss. See [Can I safely use `delegatecall` and `selfdestruct`?](/upgrades-plugins/faq#delegatecall-selfdestruct)
+ * `"delegatecall"`, `"selfdestruct"`: Allow the use of these operations. Incorrect use of this option can put funds at risk of permanent loss. See [Can I safely use `delegatecall` and `selfdestruct`?](/upgrades-plugins/faq#can-i-safely-use-delegatecall-and-selfdestruct)
* `"missing-public-upgradeto"`: Allow UUPS implementations that do not contain a public `upgradeTo` or `upgradeToAndCall` function. Enabling this option is likely to cause a revert due to the built-in UUPS safety mechanism.
* `unsafeAllowRenames`: (`boolean`) Configure storage layout check to allow variable renaming.
* `unsafeSkipStorageCheck`: (`boolean`) upgrades the proxy or beacon without first checking for storage layout compatibility errors. This is a dangerous option meant to be used as a last resort.
@@ -31,7 +31,7 @@ The following options are common to some functions.
* If set to `"onchange"`, the implementation contract is redeployed only if the bytecode has changed from previous deployments.
* `txOverrides`: (`TruffleTxOptions`) A Truffle [options](https://trufflesuite.com/docs/truffle/how-to/contracts/run-migrations/#deployerdeploycontract-args-options) object to override transaction parameters, such as `gas` and `gasPrice`. Applies to all transactions sent by a function with this option, even if the function sends multiple transactions.
-Note that the options `unsafeAllow` can also be specified in a more granular way directly in the source code if using Solidity >=0.8.2. See [How can I disable some of the checks?](/upgrades-plugins/faq#how-can-i-disable-checks)
+Note that the options `unsafeAllow` can also be specified in a more granular way directly in the source code if using Solidity >=0.8.2. See [How can I disable some of the checks?](/upgrades-plugins/faq#how-can-i-disable-some-of-the-checks)
The following options have been deprecated.
diff --git a/content/upgrades-plugins/foundry/foundry-upgrades.mdx b/content/upgrades-plugins/foundry/foundry-upgrades.mdx
index a8c9e40..dae565b 100644
--- a/content/upgrades-plugins/foundry/foundry-upgrades.mdx
+++ b/content/upgrades-plugins/foundry/foundry-upgrades.mdx
@@ -98,7 +98,7 @@ extra_output = ["storageLayout"]
1. If you are upgrading your contract from a previous version, add the `@custom:oz-upgrades-from ` annotation to the new version of your contract according to [Define Reference Contracts](/upgrades-plugins/api-core#define-reference-contracts) or specify the `referenceContract` option when calling the library’s functions.
2. Run `forge clean` before running your Foundry script or tests, or include the `--force` option when running `forge script` or `forge test`.
-If you do not want to run upgrade safety validations, you can skip the above steps and use the [`unsafeSkipAllChecks` option](/upgrades-plugins/foundry/api#Options) when calling the `Upgrades` library’s functions, or use the `UnsafeUpgrades` library instead. Note that these are dangerous options meant to be used as a last resort.
+If you do not want to run upgrade safety validations, you can skip the above steps and use the [`unsafeSkipAllChecks` option](/upgrades-plugins/foundry/api/Options) when calling the `Upgrades` library’s functions, or use the `UnsafeUpgrades` library instead. Note that these are dangerous options meant to be used as a last resort.
### Optional: Custom output directory
diff --git a/scripts/link-validation.ts b/scripts/link-validation.ts
index 3048df0..756bdfa 100644
--- a/scripts/link-validation.ts
+++ b/scripts/link-validation.ts
@@ -87,7 +87,22 @@ async function getHeadings({
data,
}: InferPageType): Promise {
const pageData = await data.load();
- return pageData.toc.map((item) => item.url.slice(1));
+ const tocHeadings = pageData.toc.map((item) => item.url.slice(1));
+
+ // Also extract actual anchor IDs from the content for API reference pages
+ const content = await data.getText("raw");
+ const anchorRegex = /<\/a>/g;
+ const anchorIds: string[] = [];
+ let match: any;
+
+ while ((match = anchorRegex.exec(content)) !== null) {
+ anchorIds.push(match[1]);
+ }
+
+ // Combine TOC headings and actual anchor IDs, removing duplicates
+ const allHeadings = [...new Set([...tocHeadings, ...anchorIds])];
+
+ return allHeadings;
}
function getFiles(scope?: string | null) {