Skip to content

Commit

Permalink
add base hook for tests (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds authored and wildmolasses committed Oct 30, 2023
1 parent 7ef8083 commit 5e97405
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions contracts/test/BaseTestHooks.sol
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();
}
}

0 comments on commit 5e97405

Please sign in to comment.