TaxHook
BNBTaxHook is a Uniswap v4 hook on BNB Chain. Runs code on every swap. Can take tokens from swaps. Runs at pool creation.
- Contract name
- TaxHook
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, manages liquidity for its providers and burns tokens.
Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax. Buys and sells can be taxed differently.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { uint256 amount = abi.decode(data, (uint256)); poolManager.burn(address(this), uint256(uint160(quote)), amount); poolManager.take(quote, taxRecipient, amount); return ""; }Manages liquidity for its providers
It adds and removes liquidity itself, so it can own part or all of the pool.
Burns tokens
It destroys some tokens (or sends them to an address nobody controls), so there are fewer of them.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { uint256 amount = abi.decode(data, (uint256)); poolManager.burn(address(this), uint256(uint160(quote)), amount); poolManager.take(quote, taxRecipient, amount); return ""; }Rewards to claim
It keeps track of rewards to be claimed later.
The code that does this (claimTaxes):function claimTaxes() external returns (uint256 amount) { amount = totalTaxes - paidOut; if (amount == 0) revert NothingToClaim(); paidOut += amount; poolManager.unlock(abi.encode(amount)); emit TaxesClaimed(taxRecipient, amount); }Anyone can trigger payouts
Anyone can claim what they’re owed, so nobody has to wait on the hook developer.
The code that does this (claimTaxes):function claimTaxes() external returns (uint256 amount) { amount = totalTaxes - paidOut; if (amount == 0) revert NothingToClaim(); paidOut += amount; poolManager.unlock(abi.encode(amount)); emit TaxesClaimed(taxRecipient, amount); }
Who controls it: Not upgradeable. The owner can change: taxes, tax recipient.
Based on the hook’s published code.
Hook history
- Took tax 31 times
Latest transactions
- 0xfe65bc3b…aa280f block 132,536,943
- 0x9e2bc50e…0cf779 block 132,536,708
- 0x1105deb4…d780a0 block 132,536,672
- 0xe96f77dc…442543 block 132,536,602
- 0xaa03fbc5…ba40cf block 132,536,560
- 0xa5bd525f…bfd121 block 132,536,480
- 0xbde79307…cd414d block 132,536,455
- 0xbde79307…cd414d block 132,536,455
- 0x304d04c3…b3a8bb block 132,536,453
- 0x1ad5e08e…a707cf block 132,536,425
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.
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.