Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Dec 11, 2023
1 parent 86f9a3e commit 2cc92ea
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion forge-test/Counter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

// TODO: update to v4-periphery/BaseHook.sol when its compatible
import {BaseHook} from "./forks/BaseHook.sol";
import {BaseHook} from "@v4-by-example/utils/BaseHook.sol";

import {Hooks} from "v4-core/libraries/Hooks.sol";
import {IPoolManager} from "v4-core/interfaces/IPoolManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion forge-test/Counter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {PoolId, PoolIdLibrary} from "v4-core/types/PoolId.sol";
import {Constants} from "v4-core/../test/utils/Constants.sol";
import {CurrencyLibrary, Currency} from "v4-core/types/Currency.sol";
import {HookTest} from "./utils/HookTest.sol";
import {Counter} from "../src/Counter.sol";
import {Counter} from "./Counter.sol";
import {HookMiner} from "./utils/HookMiner.sol";

contract CounterTest is HookTest {
Expand Down
6 changes: 3 additions & 3 deletions forge-test/FixedHookFee.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {BalanceDelta} from "v4-core/types/BalanceDelta.sol";
import {PoolId, PoolIdLibrary} from "v4-core/types/PoolId.sol";
import {Constants} from "v4-core/../test/utils/Constants.sol";
import {CurrencyLibrary, Currency} from "v4-core/types/Currency.sol";
import {HookTest} from "../utils/HookTest.sol";
import {FixedHookFee} from "../../src/examples/FixedHookFee.sol";
import {HookMiner} from "../utils/HookMiner.sol";
import {HookTest} from "./utils/HookTest.sol";
import {FixedHookFee} from "@v4-by-example/pages/fees/fixed-hook-fee/FixedHookFee.sol";
import {HookMiner} from "./utils/HookMiner.sol";

contract FixedHookFeeTest is HookTest {
using PoolIdLibrary for PoolKey;
Expand Down
4 changes: 2 additions & 2 deletions forge-test/NoOpSwap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {PoolId, PoolIdLibrary} from "v4-core/types/PoolId.sol";
import {Constants} from "v4-core/../test/utils/Constants.sol";
import {CurrencyLibrary, Currency} from "v4-core/types/Currency.sol";
import {HookTest} from "./utils/HookTest.sol";
import {NoOpSwap} from "../src/pages/hooks/no-op/NoOpSwap.sol";
import {NoOpSwap} from "@v4-by-example/pages/hooks/no-op/NoOpSwap.sol";
import {HookMiner} from "./utils/HookMiner.sol";

contract NoOpSwapTest is HookTest {
Expand All @@ -28,7 +28,7 @@ contract NoOpSwapTest is HookTest {
HookTest.initHookTestEnv();

// Deploy the hook to an address with the correct flags
uint160 flags = uint160(Hooks.BEFORE_SWAP_FLAG | Hooks.AFTER_SWAP_FLAG | Hooks.NO_OP_FLAG);
uint160 flags = uint160(Hooks.BEFORE_SWAP_FLAG | Hooks.NO_OP_FLAG);
(address hookAddress, bytes32 salt) =
HookMiner.find(address(this), flags, type(NoOpSwap).creationCode, abi.encode(address(manager)));
hook = new NoOpSwap{salt: salt}(IPoolManager(address(manager)));
Expand Down
2 changes: 1 addition & 1 deletion forge-test/utils/HookTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ contract HookTest is Test {
});

PoolSwapTest.TestSettings memory testSettings =
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true});
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true, currencyAlreadySent: false});

swapDelta = swapRouter.swap(key, params, testSettings, hookData);
}
Expand Down
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
src = "src/pages"
out = "out"
libs = ["forge-lib"]
test = "forge-test"
ffi = true
fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}]
cancun = true
Expand Down
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@v4-by-example=src/solidity-utils
@v4-by-example/=src/
@ensdomains/=forge-lib/v4-core/node_modules/@ensdomains/
@openzeppelin/=forge-lib/v4-core/lib/openzeppelin-contracts/
ds-test/=forge-lib/v4-core/lib/forge-std/lib/ds-test/src/
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fees/fixed-hook-fee/FixedHookFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

// TODO: update to v4-periphery/BaseHook.sol when its compatible
import {BaseHook} from "@v4-by-example/BaseHook.sol";
import {BaseHook} from "@v4-by-example/utils/BaseHook.sol";

import {Hooks} from "v4-core/libraries/Hooks.sol";
import {IPoolManager} from "v4-core/interfaces/IPoolManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/hooks/no-op/NoOpSwap.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {BaseHook} from "@v4-by-example/BaseHook.sol";
import {BaseHook} from "@v4-by-example/utils/BaseHook.sol";

import {Hooks} from "v4-core/libraries/Hooks.sol";
import {IPoolManager} from "v4-core/interfaces/IPoolManager.sol";
Expand Down
File renamed without changes.

0 comments on commit 2cc92ea

Please sign in to comment.