LatticeHook
EthereumLatticeHook is a Uniswap v4 hook on Ethereum. Runs code on every swap. Can take tokens from swaps. Runs at pool creation.
- Contract name
- LatticeHook
How this hook works
Trading taxA trading tax hook. It takes 1% of every trade and only lets approved callers create pools.
Takes 1% of every trade
On top of the normal pool fee, it takes 1% of each trade. The rate is written into the code. The fee builds up in the hook until it is collected.
The code that does this (charge):function _charge(uint256 base, bool isBuy) internal returns (uint256 fee) { fee = (base * FEE_BPS) / BPS; if (fee == 0) return 0; IPoolManager(Mainnet.POOL_MANAGER).take(address(0), address(this), fee); uint256 toOwner = (base * OWNER_SHARE_BPS) / BPS; uint256 toLattice = fee - toOwner; if (ILatticeToken(token).latticeTotal() >= 1_000 ether) { ILatticeToken(token).pourYield{value: toLattice}(); } else { toOwner = fee; toLattice = 0; } ownerOwed += toOwner; emit Fee(isBuy, base, fee, toOwner, toLattice); }Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96) external onlyManager returns (bytes4) { if ( sender != address(this) || key.currency0 != address(0) || key.currency1 != token || key.fee != Cell.LP_FEE || key.tickSpacing != Cell.SPACING || key.hooks != address(this) || sqrtPriceX96 != Cell.SQRT_TOP ) revert Refused(); return this.beforeInitialize.selector; }
Who controls it: The hook developer can call: open. The code cannot be changed.
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
- Fee 6 times
Latest transactions
- 0xd2efe83a…154e80 block 26,392,592
- 0x8f52fbf8…5d5bbb block 26,392,592
- 0xfce1f7b6…f49977 block 26,392,584
- 0xa64eb4c3…7a6670 block 26,392,579
- 0xdb105044…2bb0cb block 26,392,574
- 0xdffad930…69167f block 26,392,573
- Opened a pool 1 time
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.