Skip to content

Commit 6572c6c

Browse files
committed
natspec why permissions are true without override functions
1 parent 622defa commit 6572c6c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/UniswapHook.sol

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@ contract UniswapHook is BaseHook {
142142
}
143143

144144
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
145+
/**
146+
* @dev Hook Permissions without overrides:
147+
* - beforeInitialize, beforeDoate, beforeAddLiquidity
148+
* We use BaseHook's original reverts to *intentionally* revert
149+
*
150+
* beforeInitialize: the hook reverts for initializations NOT going through EulerSwap.activateHook()
151+
* we want to prevent users from initializing other pairs with the same hook address
152+
*
153+
* beforeDonate: because the hook does not support native concentrated liquidity, any
154+
* donations are permanently irrecoverable. The hook reverts on beforeDonate to prevent accidental misusage
155+
*
156+
* beforeAddLiquidity: the hook reverts to prevent v3-CLAMM positions
157+
* because the hook is a "custom curve", any concentrated liquidity position sits idle and entirely unused
158+
* to protect users from accidentally creating non-productive positions, the hook reverts on beforeAddLiquidity
159+
*/
145160
return Hooks.Permissions({
146161
beforeInitialize: true,
147162
afterInitialize: false,

0 commit comments

Comments
 (0)