<aside> 💡
This function is from the GlueStickERC20
or the GlueStickERC721
. To better understand the Glue Ecosystem architecture and find the correct deployment addresses, visit Lore and Architecture | License & Deployments
</aside>
You can call isStickyAsset
or getGlueAddress
on the appropriate contract for your token type:
GlueStickERC20
for ERC20 tokensGlueStickERC721
for ERC721 Enumerable tokens.isStickyAsset
returns both a boolean (true if the asset has a Glue) and the Glue Address (address(0) if not sticky).
/** @notice Checks if a given token is sticky and returns its glue address
* @dev Utility function for external contracts and front-ends to verify token status
* in the Glue protocol and retrieve the associated glue address if it exists.
*
* @param asset The address of the asset to check
* @return isSticky bool Indicates whether the token is sticky.
* @return glueAddress The glue address for the token if it's sticky, otherwise address(0).
*
* Use cases:
* - UI elements showing token glue status
* - Protocol integrations needing to verify glue existence
* - Smart contracts checking if a token can be unglued
* - External protocols building on top of the Glue protocol
*/
function isStickyAsset(address asset) external view returns (bool isSticky, address glueAddress);
getGlueAddress
returns only the Glue Address (address(0) if not sticky).
/** @notice Retrieves the glue address for a given token
* @dev Returns the glue address for the given token
*
* @param asset The address of the asset to get the glue address for
* @return glueAddress The glue address for the given token, if it exists, otherwise address(0)
*
* Use cases:
* - Retrieving the glue address for a given token
*/
function getGlueAddress(address asset) external view returns (address glueAddress);
.isStickyAsset(
"0x32.ffa" // Passing the asset address to check.
);
// If sticky, it'll returns bolean: "true" and "0x90.7fa" The Glue Address.
// If not sticky, it'll returns bolean: "false" and "0x00.000" address(0).
.getGlueAddress(
"0x32.ffa" // Passing the asset address to check.
);
// If sticky, it'll returns "0x90.7fa" The Glue Address.
// If not sticky, it'll returns "0x00.000" address(0).
These versatile functions enables complex logic and interactions with Glue, enhancing functionality and integration. You can build logic for any token by querying the GlueStick to check its Sticky status and retrieve its Glue address, if applicable.
← Previous
Next →