From 2ea32a54a9260a6d2d99f191a2ac2e3f72bc27d1 Mon Sep 17 00:00:00 2001 From: mejango Date: Sat, 4 Jan 2025 15:21:54 -0300 Subject: [PATCH] fix --- src/JBBuybackHook.sol | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/JBBuybackHook.sol b/src/JBBuybackHook.sol index 7f51675..063a083 100644 --- a/src/JBBuybackHook.sol +++ b/src/JBBuybackHook.sol @@ -56,6 +56,7 @@ contract JBBuybackHook is JBPermissioned, IJBBuybackHook { error JBBuybackHook_InvalidTwapWindow(uint256 value, uint256 min, uint256 max); error JBBuybackHook_PoolAlreadySet(IUniswapV3Pool pool); error JBBuybackHook_SpecifiedSlippageExceeded(uint256 amount, uint256 minimum); + error JBBuybackHook_TerminalTokenIsProjectToken(address terminalToken, address projectToken); error JBBuybackHook_Unauthorized(address caller); error JBBuybackHook_ZeroProjectToken(); error JBBuybackHook_ZeroTerminalToken(); @@ -547,6 +548,11 @@ contract JBBuybackHook is JBPermissioned, IJBBuybackHook { // Make sure the project has issued a token. if (projectToken == address(0)) revert JBBuybackHook_ZeroProjectToken(); + // Make sure the terminal token is not the project token. + if (terminalToken == projectToken) { + revert JBBuybackHook_TerminalTokenIsProjectToken(terminalToken, projectToken); + } + // If the specified terminal token is the native token, use wETH instead. if (terminalToken == JBConstants.NATIVE_TOKEN) terminalToken = address(WETH);