-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ef8083
commit 5e97405
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.20; | ||
|
||
import {IHooks} from "../interfaces/IHooks.sol"; | ||
import {PoolKey} from "../types/PoolKey.sol"; | ||
import {BalanceDelta} from "../types/BalanceDelta.sol"; | ||
import {IPoolManager} from "../interfaces/IPoolManager.sol"; | ||
|
||
contract BaseTestHooks is IHooks { | ||
error HookNotImplemented(); | ||
|
||
function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, bytes calldata hookData) | ||
external | ||
virtual | ||
returns (bytes4) | ||
{ | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function afterInitialize( | ||
address sender, | ||
PoolKey calldata key, | ||
uint160 sqrtPriceX96, | ||
int24 tick, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function beforeModifyPosition( | ||
address sender, | ||
PoolKey calldata key, | ||
IPoolManager.ModifyPositionParams calldata params, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function afterModifyPosition( | ||
address sender, | ||
PoolKey calldata key, | ||
IPoolManager.ModifyPositionParams calldata params, | ||
BalanceDelta delta, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function beforeSwap( | ||
address sender, | ||
PoolKey calldata key, | ||
IPoolManager.SwapParams calldata params, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function afterSwap( | ||
address sender, | ||
PoolKey calldata key, | ||
IPoolManager.SwapParams calldata params, | ||
BalanceDelta delta, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function beforeDonate( | ||
address sender, | ||
PoolKey calldata key, | ||
uint256 amount0, | ||
uint256 amount1, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
|
||
function afterDonate( | ||
address sender, | ||
PoolKey calldata key, | ||
uint256 amount0, | ||
uint256 amount1, | ||
bytes calldata hookData | ||
) external virtual returns (bytes4) { | ||
revert HookNotImplemented(); | ||
} | ||
} |