When interacting with Glued Assets that are SAN (Sticky Assets Native) and have active hooks, you can use these functions to read their status:

More information about SAN here: Sticky Asset Native More information about Glued Hooks here: Hooks

<aside> 💡

To use these functions, you must use GlueERC20 or GlueERC721 contract of a specific Sticky Token. To better understand the Glue Ecosystem architecture and find the correct deployment addresses, visit visit Lore and Architecture | License & Deployments

</aside>

isExpanded

You can call isExpanded to retrieve the status of the check if the Asset have active Glued Hooks:

/**
* @notice Retrieves if the glue is expanded with active Hooks.
* @dev This function is used to get if the glue is expanded with active Hooks:
* - BIO.HOOK: The glue is expanded with active Hooks.
* - BIO.NO_HOOK: The glue is not expanded with active Hooks.
* - BIO.UNCHECKED: The glue didn't have learned yet (before the first unglue interaction).
*
* @return hooksStatus The bio of the hooks status.
*
* Use cases:
* - Knowing if the glue is expanded with active Hooks for external interactions.
*/
function isExpanded() external view returns (BIO hooksStatus);

getTotalHookSize

You can call getTotalHookSize to receive the total hook size percentage (100% = 1e18) for a specific collateral for an accurate estimation of hook effects on collateral withdrawal. In this function the contract calculates the percentage of fee both for StickyHook and CollateralHook as Sticky Hook, reduce your Supply Delta and Collateral Hook reduce the amount received.

// For Glue ERC20s

/**
* @notice Returns the total hook size for a specific collateral
* @dev Used for hook impact calculations during ungluing
* @param collateral The address of the collateral token
* @param collateralAmount The amount of collateral being processed
* @param stickyAmount The amount of sticky tokens being unglued
* @return hookSize The combined hook impact in PRECISION units
* 
* Use case: Accurate estimation of hook effects on collateral withdrawal
*/
function getTotalHookSize(address collateral, uint256 collateralAmount, uint256 stickyAmount) external view returns (uint256 hookSize);

// For Glue ERC721s

/**
* @notice Retrieves the total hook size for a sepecific collateral.
* @dev This function is used to get the total hook size for a sepecific collateral or sticky token.
*
* @param collateral The address of the collateral token.
* @param collateralAmount The amount of tokens to calculate the hook size for.
* @return hookSize The total hook size.
*
* Use cases:
* - Retrieving the total hook size for a specific collateral.
*/
function getTotalHookSize(address collateral, uint256 collateralAmount) external view returns (uint256 hookSize);

In Glue ERC20, getTotalHookSize requires stickyAmount because this type of Glue allows StickyHook to transfer Sticky Amount, which is not available in Glue ERC721.

Frequently Asked Questions (FAQ)