Skip to content

Add whitelist buy hook address on BSC: 0xabf1f4421f2c4893a7fa9b411c59ddf248508080#1337

Open
titaniclhx-rgb wants to merge 7 commits intoUniswap:mainfrom
titaniclhx-rgb:whitelist-buy-hook-bsc
Open

Add whitelist buy hook address on BSC: 0xabf1f4421f2c4893a7fa9b411c59ddf248508080#1337
titaniclhx-rgb wants to merge 7 commits intoUniswap:mainfrom
titaniclhx-rgb:whitelist-buy-hook-bsc

Conversation

@titaniclhx-rgb
Copy link

Hook & Pool Information

  • Hook Address (BSC Mainnet): 0xabf1f4421f2c4893a7fa9b411c59ddf248508080
  • Hook Function: Restricts only whitelisted addresses to buy Token1 (ufo) in this pool; no restrictions on selling.
  • Hook Source Code: https://github.com/titaniclhx-rgb/uniswap_v4_hook/blob/main/WhitelistBuyHook.sol
  • Deployed Hooked Pool Link (Uniswap App): app.uniswap.org/positions/v4/bnb/215293
  • Pool Details: USDT/ufo V4 pool (BSC Mainnet), 0.3% fee tier

Additional Notes

This pool has been deployed with nominal liquidity (sufficient for testing swap functionality),
and the hook logic has been verified via local tests (all whitelist/non-whitelist swap scenarios work as expected).

@Ponx
Copy link
Contributor

Ponx commented Jan 23, 2026

@titaniclhx-rgb
Copy link
Author

titaniclhx-rgb commented Jan 28, 2026 via email

@titaniclhx-rgb
Copy link
Author

titaniclhx-rgb commented Feb 1, 2026 via email

@titaniclhx-rgb
Copy link
Author

titaniclhx-rgb commented Feb 7, 2026 via email

@titaniclhx-rgb
Copy link
Author

Hi @penx,

Thank you for your follow-up. I apologize for the confusion regarding the liquidity status.
Let me clarify and provide direct on-chain verification:

  1. On-Chain Liquidity Confirmed
    The pool at address 0xe59ed249748b6a94f36c1995e903acf3489b1a3c8eabb9e2f6ac5c9be545e499
    does contain active liquidity on BSC Mainnet. It was initialized with 100 USDT and 100,000 UFO.
    https://app.uniswap.org/explore/pools/bnb/0xe59ed249748b6a94f36c1995e903acf3489b1a3c8eabb9e2f6ac5c9be545e499

  2. Why the Frontend Shows "No Liquidity"
    The Uniswap frontend relies on the routing API, which filters out pools with unapproved hooks.
    Since this PR is precisely for whitelisting my hook (0xab8f142f4893a7f94b11c59ddf248508080),
    the pool is currently excluded from the routing layer — this is expected behavior before approval, not an issue with the pool itself.

  3. PR Readiness
    I have also resolved all merge conflicts with the main branch in this PR.
    The CI checks are now passing, and the pool has sufficient on-chain liquidity to test the whitelist buy restriction logic.

This pool is ready for your functional review. Thank you again for your time and guidance.

Best regards,
[titaniclhx-rgb]

@titaniclhx-rgb
Copy link
Author

Hi @Uniswap/routing-api-maintainers,

This PR adds the whitelist buy hook address on BSC to the routing allowlist.

The hook logic is minimal and safe—it only enforces a whitelist check on token buys (read-only operation, no state changes) and follows the least privilege principle.

Could you please approve the pending workflows to run the CI checks? Thank you for your time and review!

@titaniclhx-rgb
Copy link
Author

hi @jsy1218 @mikeki

I'm following up on this PR (#1337) for adding a BSC-based whitelist buy hook to the allowlist,
which I submitted a few days ago and have followed up on multiple times.

I understand your team is busy, so I've compiled all key details to make your review as quick as possible (1-2 minutes):

Key changes:

  1. Added the Hook contract address to lib/util/hooksAddressesAllowlist.ts:

    • Address: [0xaBf1f4421F2c4893a7Fa9B411c59Ddf248508080]
    • Chain: BSC mainnet
  2. Hook Functionality:

    • The hook is triggered on beforeSwap.
    • It checks if the transaction is a buy of Token1 (when params.zeroForOne = true).
    • If the buyer is not in the whitelist, the transaction is reverted with the error: Not whitelisted for buying Token1.
    • Selling Token1 (when params.zeroForOne = false) is not restricted.

Risk Assessment:

  • Security: The hook only performs a whitelist check and does not modify any core swap logic. It returns BeforeSwapDelta.wrap(0), ensuring no impact on the swap flow.
  • Performance: The whitelist check is a simple mapping lookup, which is gas-efficient and does not introduce significant overhead.
  • Maintainability: The hook owner can manage the whitelist via the setWhitelist function, and the restriction can be toggled on/off with setRestrictToken.

Related references:

  • Hook contract: [0xaBf1f4421F2c4893a7Fa9B411c59Ddf248508080]
  • Token0: [0x55d398326f99059ff775485246999027b3197955]
  • Token1: [0x9DCf6927a0F0145676D4ffe2DD7d7B018c5c9b18]
  • Pool: [0xe59ed249748b6a94f36c1995e903acf3489b1a3c8eabb9e2f6ac5c9be545e499]

Could you please help approve the workflows first (so CI can run fully), and then provide a quick review? Let me know if you need any additional info.

Thanks so much for your time and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants