Skip to content

Commit

Permalink
FullRange hook accepts currencies instead of addresses (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilz authored Aug 24, 2023
1 parent fbe8376 commit 2fe5608
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeAddInitialLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
413016
413041
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeAddLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
207282
207307
16 changes: 8 additions & 8 deletions contracts/hooks/examples/FullRange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ contract FullRange is BaseHook, ILockCallback {
}

struct AddLiquidityParams {
address token0;
address token1;
Currency currency0;
Currency currency1;
uint24 fee;
uint256 amount0Desired;
uint256 amount1Desired;
Expand All @@ -71,8 +71,8 @@ contract FullRange is BaseHook, ILockCallback {
}

struct RemoveLiquidityParams {
address token0;
address token1;
Currency currency0;
Currency currency1;
uint24 fee;
uint256 liquidity;
uint256 deadline;
Expand Down Expand Up @@ -106,8 +106,8 @@ contract FullRange is BaseHook, ILockCallback {
returns (uint128 liquidity)
{
PoolKey memory key = PoolKey({
currency0: Currency.wrap(params.token0),
currency1: Currency.wrap(params.token1),
currency0: params.currency0,
currency1: params.currency1,
fee: params.fee,
tickSpacing: 60,
hooks: IHooks(address(this))
Expand Down Expand Up @@ -163,8 +163,8 @@ contract FullRange is BaseHook, ILockCallback {
returns (BalanceDelta delta)
{
PoolKey memory key = PoolKey({
currency0: Currency.wrap(params.token0),
currency1: Currency.wrap(params.token1),
currency0: params.currency0,
currency1: params.currency1,
fee: params.fee,
tickSpacing: 60,
hooks: IHooks(address(this))
Expand Down
Loading

0 comments on commit 2fe5608

Please sign in to comment.