Skip to main content

Get FXRP Asset Manager Address

Overview

When building on the Flare Network, it is important to avoid hardcoding contract addresses, especially for key components such as the FXRP Asset Manager. These addresses can change between Flare testnets and mainnet deployments, and relying on fixed values can lead to broken integrations.

Instead, you should dynamically fetch the FXRP Asset Manager address using the Flare Contract Registry, the trusted source for obtaining contract addresses on any Flare network.

Get the FXRP Asset Manager Address

To get the FAssets asset manager address, you can use the Flare Contract Registry library. It is included in the Flare Periphery Contracts package.

The following example demonstrates how to get the FXRP Asset Manager address using the Flare Contract Registry library in a Solidity contract.

import { ContractRegistry } from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol";
import {IAssetManager} from "@flarenetwork/flare-periphery-contracts/coston2/IAssetManager.sol";

// Get the FXRP Asset Manager address from the Flare contracts registry
IAssetManager assetManager = ContractRegistry.getAssetManagerFXRP();

Next Steps

In this guide, you learned how to get the FXRP Asset Manager address for the FAssets system by interacting with the AssetManager contract using the IAssetManager interface.

You should not hardcode the FXRP Asset Manager address in your smart contracts.

To continue your FAssets development journey, you can: