Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 committed May 14, 2024
1 parent 0f3f0a4 commit c89ccfe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libraries/Hooks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,15 @@ library Hooks {
callHook(self, abi.encodeWithSelector(IHooks.beforeSwap.selector, msg.sender, key, params, hookData));

if (key.fee.isDynamicFee()) {
// equivalent: (,, lpFee) = abi.decode(result, (bytes4, int256, uint24));
assembly {
lpFee := mload(add(result, 0x60))
}
}

// skip this logic for the case where the hook return is 0
if (self.hasPermission(BEFORE_SWAP_RETURNS_DELTA_FLAG)) {
// equivalent: (, hookReturn, ) = abi.decode(result, (bytes4, int256, uint24));
assembly {
hookReturn := mload(add(result, 0x40))
}
Expand Down

0 comments on commit c89ccfe

Please sign in to comment.