diff --git a/.gitmodules b/.gitmodules index f9e805b..e671bd1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "lib/solady"] path = lib/solady url = https://github.com/vectorized/solady +[submodule "lib/multicaller"] + path = lib/multicaller + url = https://github.com/vectorized/multicaller diff --git a/foundry.toml b/foundry.toml index 2f818a7..41b695e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -12,6 +12,7 @@ via_ir = true remappings = [ "bunni-v2=lib/bunni-v2", "v4-core=lib/bunni-v2/lib/v4-core", + "multicaller=lib/multicaller", ] [rpc_endpoints] diff --git a/lib/multicaller b/lib/multicaller new file mode 160000 index 0000000..b7ef620 --- /dev/null +++ b/lib/multicaller @@ -0,0 +1 @@ +Subproject commit b7ef620605f426a93406248dcb005f6cead30673 diff --git a/src/FeeOverrideHooklet.sol b/src/FeeOverrideHooklet.sol index b170351..4cc5b64 100644 --- a/src/FeeOverrideHooklet.sol +++ b/src/FeeOverrideHooklet.sol @@ -6,6 +6,8 @@ import { IBunniHub } from "bunni-v2/src/interfaces/IBunniHub.sol"; import { IBunniToken } from "bunni-v2/src/interfaces/IBunniToken.sol"; import { SWAP_FEE_BASE } from "bunni-v2/src/base/Constants.sol"; +import { LibMulticaller } from "multicaller/src/LibMulticaller.sol"; + import { PoolId, PoolIdLibrary } from "v4-core/src/types/PoolId.sol"; import { PoolKey } from "v4-core/src/types/PoolKey.sol"; import { IPoolManager } from "v4-core/src/interfaces/IPoolManager.sol"; @@ -56,8 +58,9 @@ contract FeeOverrideHooklet is IHooklet { IBunniToken bunniToken = bunniHub.bunniTokenOfPool(id); address owner = bunniToken.owner(); + address msgSender = LibMulticaller.senderOrSigner(); - if (msg.sender != owner) { + if (msgSender != owner) { revert FeeOverrideHooklet__NotBunniTokenOwner(); }