Skip to content

Commit

Permalink
update for modifyLiquidity; misc doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Mar 15, 2024
1 parent f26508e commit 0f84f4b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ There are many ways to contribute, but here are a few if you want a place to sta

## Opening an Issue

When opening an [issue](https://github.com/Uniswap/periphery-next/issues/new/choose), choose a template to start from: Bug Report or Feature Improvement. For bug reports, you should be able to reproduce the bug through tests or proof of concept integrations. For feature improvements, please title it with a concise problem statement and check that a similar request is not already open or already in progress. Not all issues may be deemed worth resolving, so please follow through with responding to any questions or comments that others may have regarding the issue.
When opening an [issue](https://github.com/Uniswap/v4-periphery/issues/new/choose), choose a template to start from: Bug Report or Feature Improvement. For bug reports, you should be able to reproduce the bug through tests or proof of concept integrations. For feature improvements, please title it with a concise problem statement and check that a similar request is not already open or already in progress. Not all issues may be deemed worth resolving, so please follow through with responding to any questions or comments that others may have regarding the issue.

Feel free to tag the issue as a “good first issue” for any clean-up related issues, or small scoped changes to help encourage pull requests from first time contributors!

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Uniswap v4 is a new automated market maker protocol that provides extensibility

## Contributing

If you’re interested in contributing please see the [contribution guidelines](https://github.com/Uniswap/periphery-next/blob/main/CONTRIBUTING.md)!
If you’re interested in contributing please see the [contribution guidelines](https://github.com/Uniswap/v4-periphery/blob/main/CONTRIBUTING.md)!

## Repository Structure

Expand All @@ -31,29 +31,29 @@ Eventually, some hooks that have been audited and are considered production-read
To utilize the contracts and deploy to a local testnet, you can install the code in your repo with forge:

```solidity
forge install https://github.com/Uniswap/periphery-next
forge install https://github.com/Uniswap/v4-periphery
```

If you are building hooks, it may be useful to inherit from the `BaseHook` contract:

```solidity
import {BaseHook} from 'periphery-next/contracts/BaseHook.sol';
import {BaseHook} from 'v4-periphery/contracts/BaseHook.sol';
contract CoolHook is BaseHook {
// Override the hook callbacks you want on your hook
function beforeModifyPosition(
function beforeAddLiquidity(
address,
IPoolManager.PoolKey calldata key,
IPoolManager.ModifyLiquidityParams calldata params
) external override poolManagerOnly returns (bytes4) {
// hook logic
return BaseHook.beforeModifyPosition.selector;
return BaseHook.beforeAddLiquidity.selector;
}
}
```

## License

The license for Uniswap V4 Periphery is the GNU General Public License (GPL 2.0), see [LICENSE](https://github.com/Uniswap/periphery-next/blob/main/LICENSE).
The license for Uniswap V4 Periphery is the GNU General Public License (GPL 2.0), see [LICENSE](https://github.com/Uniswap/v4-periphery/blob/main/LICENSE).
6 changes: 3 additions & 3 deletions contracts/hooks/examples/FullRange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ contract FullRange is BaseHook, ILockCallback {
if (poolLiquidity == 0 && liquidity <= MINIMUM_LIQUIDITY) {
revert LiquidityDoesntMeetMinimum();
}
BalanceDelta addedDelta = modifyPosition(
BalanceDelta addedDelta = modifyLiquidity(
key,
IPoolManager.ModifyLiquidityParams({
tickLower: MIN_TICK,
Expand Down Expand Up @@ -180,7 +180,7 @@ contract FullRange is BaseHook, ILockCallback {

UniswapV4ERC20 erc20 = UniswapV4ERC20(poolInfo[poolId].liquidityToken);

delta = modifyPosition(
delta = modifyLiquidity(
key,
IPoolManager.ModifyLiquidityParams({
tickLower: MIN_TICK,
Expand Down Expand Up @@ -245,7 +245,7 @@ contract FullRange is BaseHook, ILockCallback {
return IHooks.beforeSwap.selector;
}

function modifyPosition(PoolKey memory key, IPoolManager.ModifyLiquidityParams memory params)
function modifyLiquidity(PoolKey memory key, IPoolManager.ModifyLiquidityParams memory params)
internal
returns (BalanceDelta delta)
{
Expand Down

0 comments on commit 0f84f4b

Please sign in to comment.