BaseProtectedNative30HookV1
BaseBaseProtectedNative30HookV1 is a Uniswap v4 hook on Base. Runs code on every swap. Can take tokens from swaps. Runs at pool creation.
- Contract name
- BaseProtectedNative30HookV1
How this hook works
Launch protectionThis hook runs one token's ETH pool with a fee in ETH split between the platform and the pool creator. A launch protection module adds an opening tax for early buyers, with a few exempt wallets.
Fee in ETH
Each trade pays a fee taken from the ETH side, split between the platform and the pool creator in a fee vault where each claims their part.
The code that does this (_beforeSwap):function _beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata data) internal override returns (bytes4, BeforeSwapDelta, uint24 overrideFee) { _requirePool(key); if (!initialized) revert UninitializedPool(); if (swapActive) revert ReentrantSwap(); if (params.amountSpecified == 0) revert NoTrade(); swapActive = true; activeSwap = keccak256(abi.encode(sender, key, params, data)); overrideFee = _beforeModule(sender, key, params, data); if (params.zeroForOne && block.timestamp < ProtectedLaunchTokenV1(token).startedAt() + 300) { activeBuyer = BaseLaunchProtectionModuleV1(module).protectedBuyer(sender); } activeOpeningTaxPpm = params.zeroForOne ? BaseLaunchProtectionModuleV1(module).openingTaxPpmForSender(sender) : 0; bool nativeIsSpecified = params.zeroForOne == (params.amountSpecified < 0); if (!nativeIsSpecified) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, overrideFee); uint256 nativeAmount = _absolute(params.amountSpecified); (uint256 gross, uint256 platformFee, uint256 creatorFee, uint256 openingTax) = _quoteTradeFees(nativeAmount, params.amountSpecified > 0, params.zeroForOne, activeOpeningTaxPpm); uint256 total = platformFee + creatorFee + openingTax; if (params.amountSpecified < 0 && total >= nativeAmount) revert NoTrade(); expectedNativePoolAmount = params.amountSpecified > 0 ? gross : nativeAmount - total; if (expectedNativePoolAmount == 0) revert NoTrade(); _accrue(sender, key, params.zeroForOne, gross, platformFee, creatorFee, openingTax); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(total.toInt256().toInt128(), 0), overrideFee); }Opening tax
A protection module adds an extra tax on early buys, which goes to a separate opening tax vault.
The code that does this (_beforeModule):function _beforeModule(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata data) private view returns (uint24 overrideFee) { if (module == address(0)) return 0; _requireModuleCode(); (bytes4 selector, BeforeSwapDelta customDelta, uint24 fee) = IProtectedNativeFeeModuleV1(module).beforeSwap(sender, key, params, data); if (selector != IProtectedNativeFeeModuleV1.beforeSwap.selector) revert InvalidModuleResponse(); if (BeforeSwapDelta.unwrap(customDelta) != 0) revert UnsupportedCustomDelta(); if (fee != 0) { if (!lpFee.isDynamicFee() || !fee.isOverride()) revert InvalidDynamicFeeOverride(); if (fee.removeOverrideFlagAndValidate() > maxModuleLpFeePips) revert InvalidDynamicFeeOverride(); } return fee; }Exempt wallets
Up to three wallets set at launch are exempt from the opening tax.
The code that does this (isTaxExempt):function isTaxExempt(address wallet) public view returns (bool) { if (wallet == address(0)) return false; if (wallet == developer) return true; for (uint256 i; i < _exemptWallets.length; ++i) { if (wallet == _exemptWallets[i]) return true; } return false; }One pool only
The hook only works with its one token's pool.
The code that does this (_requirePool):function _requirePool(PoolKey calldata key) private view { if ( Currency.unwrap(key.currency0) != address(0) || Currency.unwrap(key.currency1) != token || key.fee != lpFee || key.tickSpacing != tickSpacing || address(key.hooks) != address(this) ) revert UnexpectedPool(); }
Who controls it: The fee rates, module and exempt wallets are fixed when the hook is created. The code cannot be upgraded.
What do these labels mean? Based on the hook’s published code.
What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Took its fee from a trade 194 times
Latest transactions
- 0x9e7a6f2f…19761b block 56,510,361
- 0x84ddcd6a…eba05b block 56,500,752
- 0xd40b5c3b…4129ff block 56,500,315
- 0xce131e2b…57a0f6 block 56,500,315
- 0xc4a259c4…fad343 block 56,496,525
- 0x1beed1b1…4994ee block 56,496,454
- 0xdaddb89b…064066 block 56,495,896
- 0x8cc4d8ce…5fbf1e block 56,495,869
- 0xc1179b89…98d8f3 block 56,495,723
- 0x4e2992de…1af0d6 block 56,495,695
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.