Hooks are specialized interceptors in the Glue Finance ecosystem that activate during ungluing operations. They serve as programmable middleware that can capture and process tokens at specific points during token transfers.
For hooks to function, they must be implemented in two places inside the specific Sticky Asset contract that will use the hooks for it’s own unique Glue.
You can build with hooks both by implementing IGluedHooks.sol interface to your asset's contract, or directly import Expansions Pack and set up a Sticky Asset Native for simpler and more reliable hook interactions.
The hook system in StickyAsset is a powerful mechanism that allows you to intercept and process tokens during ungluing operations. Think of it as "middleware" that runs automatically whenever someone unglues tokens from your Glue Address.
To interact with hooks, you can either import the IGluedHooks.sol interface to your asset's contract, or directly import Expansions Pack and set up a Sticky Asset Native for simpler and more reliable hook interactions.
Hooks only work when they are implemented in both the Sticky Asset contract and its own Glue.