بنقرة واحدة
lbamm-token-hook
Generate complete ILimitBreakAMMTokenHook Solidity implementations
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Generate complete ILimitBreakAMMTokenHook Solidity implementations
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Design an apptoken -- map high-level requirements to protocols, configuration steps, and implementation skills
Apptoken ecosystem knowledge -- token standards (ERC-721C, ERC-1155C, ERC-20C), apptoken categories, cross-protocol integration patterns. Use this skill whenever the user asks about apptokens, Creator Token Standards, ERC-20C/ERC-721C/ERC-1155C, Limit Break tokens, cross-protocol integration, or how the apptoken ecosystem fits together.
Generate integration code for the LBAMM CLOBTransferHandler -- on-chain limit order book with maker deposits, FIFO order filling, and price-linked lists. Generates Foundry scripts for maker flows (deposit, open/close orders, withdraw) and taker flows (filling orders through AMM swaps). Use this skill whenever the user asks about LBAMM CLOB, on-chain order books, limit orders on LBAMM, maker/taker flows, CLOB deposits, or filling CLOB orders.
LBAMM transfer handler architecture -- how transfer handlers work during swap settlement, the ILimitBreakAMMTransferHandler interface, executor validation hooks, callback patterns, and custom handler development. Use this skill whenever the user asks about LBAMM transfer handlers, swap settlement, ammHandleTransfer, custom settlement logic, ITransferHandlerExecutorValidation, how swaps use transfer data, or writing a custom handler contract.
Generate DEX integration contracts that call LBAMM
Generate integration code for the LBAMM PermitTransferHandler -- gasless swap execution via EIP-712 signed permits with optional cosigner. Generates Foundry scripts, signing code, and transferData encoding for fill-or-kill and partial fill permit swaps.
| name | lbamm-token-hook |
| description | Generate complete ILimitBreakAMMTokenHook Solidity implementations |
| user-invocable | true |
| disable-model-invocation | true |
| argument-hint | [description of desired hook behavior] |
Generate a complete ILimitBreakAMMTokenHook implementation based on the user's requirements.
Before generating code, check the user's project is configured:
foundry.toml must exist. If not: forge initlib/lbamm-core/ must exist. If not: forge install limitbreakinc/lbamm-coreremappings.txt needs @limitbreak/lbamm-core/=lib/lbamm-core/. Append if missing -- do not overwrite existing entries.lbamm-examples -- see lbamm-protocol/references/local-dev.md. Generated scripts should read addresses from environment variables (vm.envAddress) so they work with the local Anvil deployment.Parse requirements from $ARGUMENTS -- identify what the hook should do (fee collection, swap gating, LP restrictions, flashloan control, handler order validation, etc.)
Resolve ambiguities before generating -- if $ARGUMENTS mentions external contracts without addresses (e.g., "an NFT collection", "an oracle", "a whitelist registry"), ask the user whether they want to use an existing deployed contract (and get the address) or have a new one created as part of the example. Similarly, clarify fee percentages, admin roles, or other values if they're unspecified and would meaningfully change the implementation. Ask everything in a single message. If the prompt is specific enough, skip this step and proceed.
Determine which of the 10 hook flags are needed:
beforeSwap -- validate/gate swaps, charge input-side feesafterSwap -- validate post-swap state, charge output-side feesaddLiquidity -- validate/gate LP deposits, charge deposit feesremoveLiquidity -- validate/gate LP withdrawals, charge withdrawal feescollectFees -- validate fee collection, charge fees on fee claimspoolCreation -- validate/gate pool creation for this tokenhookManagesFees -- hook manages its own fee accounting (fees tracked per-hook in core)flashloans -- enable flashloans and set fees via beforeFlashloanflashloansValidateFee -- validate when another token uses this as flashloan fee tokenhandlerOrderValidate -- validate transfer handler order creationGenerate a complete Solidity contract that:
pragma solidity 0.8.24;ILimitBreakAMMTokenHookhookFlags() returning correct (requiredFlags, supportedFlags) bitmasktokenHookManifestUri()Explain flag choices and security considerations
references/token-hook-interface.md -- Full interface, all 10 flags, hookFlags() negotiation rulesreferences/token-hook-patterns.md -- Annotated examples for common token hook patternslbamm-protocolsetTokenSettings. Broadest surface -- 10 flags covering swaps, liquidity, pool creation, flashloans, and handler orders. Use when the behavior should apply to ALL pools involving a token.hookFlags() must return (requiredFlags, supportedFlags) where all required flags are also supportedbeforeSwap fee is on input token (input swap) or output token (output swap)afterSwap fee is on output token (input swap) or input token (output swap)hookForToken0 / hookForInputToken booleans tell you which side of the pool/swap this callback is for(hookFee0, hookFee1) -- these are capped by caller's maxHookFee0/maxHookFee1@limitbreak/lbamm-core/src/interfaces/hooks/ILimitBreakAMMTokenHook.sol
@limitbreak/lbamm-core/src/DataTypes.sol