Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mejango committed Jan 4, 2025
1 parent 6599e5f commit 2ea32a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/JBBuybackHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 2ea32a5

Please sign in to comment.