Hooks.wtf

Zaps

WhitelistPoolSwap.sol

[INFO] Missing override of new PoolSwap function

The new PoolSwap contract updates introduced a new swap function that includes _hookData rather than just a specific referrer address. To maintain a complete inheritence of the parent PoolSwap contract we would recommend creating a specific override for this new function.

function swap(PoolKey memory _key, IPoolManager.SwapParams memory _params, bytes memory _hookData) public payable override returns (BalanceDelta delta_) {
  return swap(_key, _params, new bytes32[](0), _hookData);
}

[INFO] Duplicated PoolKey encoding

The main swap function in this contract initially encodes the PoolKey to create a PoolId. This variable should be reused, but the PoolKey is instead encoded more times over, costing increased gas due to two unrequired keccak256 calls.

Previous
PoolSwap.sol