# Read FAssets Settings (Solidity)

> Fetch FAsset Lot Size and Value in USD (via FTSO)

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/fassets/developer-guides/fassets-settings-solidity

## Overview[​](#overview "Direct link to Overview")

This guide will show you how to fetch FAsset [lot size](/fassets/minting#lots) for FXRP using the Solidity smart contract on the Flare network. You will deploy the contract using Hardhat and interact with it via a TypeScript script.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

-   [Flare Hardhat Starter Kit](/network/guides/hardhat-foundry-starter-kit)
-   [Flare Network Periphery Contracts](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts)
-   Node.js, TypeScript, and hardhat.config.ts with the Songbird Testnet Coston network configured

## Create Smart Contract to Fetch FAsset Lot Size[​](#create-smart-contract-to-fetch-fasset-lot-size "Direct link to Create Smart Contract to Fetch FAsset Lot Size")

To get the FAsset lot size, you can use the following smart contract:

contracts/FAssetsSettings.sol

```
// SPDX-License-Identifier: MITpragma solidity ^0.8.25;// 1. Import the Flare Contract Registryimport {ContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol";// 2. Import the AssetManager interfaceimport {IAssetManager} from "@flarenetwork/flare-periphery-contracts/coston2/IAssetManager.sol";// 3. Contract for accessing FAssets settings from the asset managercontract FAssetsSettings {    // 4. This function gets two important numbers from the asset manager settings:    // * lotSizeAMG: The smallest amount you can trade (in AMG units)    // * assetDecimals: How many decimal places the asset uses    // FAssets Operation Parameters https://dev.flare.network/fassets/operational-parameters    function getLotSize()        public        view        returns (uint64 lotSizeAMG, uint8 assetDecimals)    {        // 5. Get the AssetManager contract from the Flare Contract Registry        IAssetManager assetManager = ContractRegistry.getAssetManagerFXRP();        // 6. Get the lot size and asset decimals from the AssetManager contract        lotSizeAMG = assetManager.getSettings().lotSizeAMG;        assetDecimals = assetManager.getSettings().assetDecimals;        return (lotSizeAMG, assetDecimals);    }}
```

[Open in Remix](https://remix.ethereum.org/#url=https://github.com/flare-foundation/developer-hub/blob/main/examples/developer-hub-solidity/FAssetsAssetManagerSettingsLotSize.sol&version=builtin&evmVersion=cancun&optimize=true&runs=200)

  

### Code Breakdown[​](#code-breakdown "Direct link to Code Breakdown")

1.  Import the [ContractRegistry library](/network/guides/flare-contracts-registry#contract-registry-library) to access the Flare Network contract registry.
2.  Import the interface `IAssetManager` from the [Flare Periphery Contracts package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts), which provides access to the FAssets system.
3.  Create a contract called `FAssetsSettings` that will be used to fetch the FAssets settings from the asset manager.
4.  Use the ContractRegistry to get the FAssets FXRP asset manager address.
5.  Use the `getLotSize` function to retrieve settings from the FAssets FXRP asset manager. The function calls [`getSettings`](/fassets/reference/IAssetManager#getsettings) which returns the complete asset manager settings that you can find in the [FAssets Operational Parameters](/fassets/operational-parameters#asset-manager-operational-parameters) documentation:
    -   `lotSizeAMG`: The smallest amount you can trade (in AMG units).
    -   `assetDecimals`: How many decimal places the FAssets asset uses.
6.  The `getLotSize` function returns two values:
    -   `lotSizeAMG`: The smallest amount you can trade (in AMG units).
    -   `assetDecimals`: How many decimal places the FAssets asset uses.

Flare Hardhat Starter Kit

Using the [Flare Hardhat Starter Kit](/network/guides/hardhat-foundry-starter-kit) you can quickly deploy the contract and generate TypeChain bindings for seamless TypeScript integration. It streamlines development by providing a ready-made project structure, preconfigured networks, and needed packages.

## Deploy and Interact with the Smart Contract[​](#deploy-and-interact-with-the-smart-contract "Direct link to Deploy and Interact with the Smart Contract")

Use the following TypeScript script to deploy the contract and fetch the FAsset settings using the Hardhat tool:

scripts/fassets/getLotSize.ts

```
// yarn hardhat run scripts/fassets/getLotSize.ts --network coston2// 1. Get the contract artifactconst FAssetsSettings = artifacts.require("FAssetsSettings");async function main() {  // 2. Deploy the contract  const fAssetsSettings = await FAssetsSettings.new();  console.log("FAssetsSettings deployed to:", fAssetsSettings.address);  // 3. Call getSettings function  const lotSize = await fAssetsSettings.getLotSize();  console.log("Lot size:", lotSize[0]);  console.log("Decimals:", lotSize[1]);  // 4. Convert lot size to XRP  const lotSizeFXRP = Number(lotSize[0]) / Math.pow(10, Number(lotSize[1]));  console.log("Lot size in XRP", lotSizeFXRP);}main().catch((error) => {  console.error(error);  process.exitCode = 1;});
```

### Code Explanation[​](#code-explanation "Direct link to Code Explanation")

1.  Get the contract artifact `FAssetsSettings` from the Hardhat artifacts.
2.  Deploy the `FAssetsSettings` on the network and get the contract address.
3.  Call the `getLotSize` function to get the lot size and asset decimals.
4.  Convert the lot size to XRP.

## Run the Script[​](#run-the-script "Direct link to Run the Script")

Now you can run the script using the Hardhat tool with the following command:

```
yarn hardhat run scripts/fassets/getLotSize.ts --network coston2
```

You should see the following output:

```
Compiled 1 Solidity file successfully (evm target: cancun).Deploying FAssetsSettings...FAssetsSettings deployed to: 0x40deEaA76224Ca9439D4e1c86F827Be829b89D9ELot size: 20000000nDecimals: 6nLot size in XRP 20
```

info

This script is included in the [Flare Hardhat Starter Kit](https://github.com/flare-foundation/flare-hardhat-starter).

## Exploring Additional Parameters[​](#exploring-additional-parameters "Direct link to Exploring Additional Parameters")

The FAssets asset manager exposes key parameters like collateral ratios, minting fees, and liquidation thresholds via the `getSettings` function. See the [FAssets Operational Parameters](/fassets/operational-parameters#asset-manager-operational-parameters) for details.

## Summary[​](#summary "Direct link to Summary")

Congratulations! You have now deployed a Solidity helper contract and used a TypeScript script to:

-   Fetch FAsset FXRP lot size and decimals
-   Convert the value to a user-friendly format using decimal precision.

What's next

To continue your FAssets development journey, you can:

-   Learn how to [mint FXRP](/fassets/developer-guides/fassets-direct-minting).
-   Understand how to [redeem FXRP](/fassets/developer-guides/fassets-redeem).
-   Explore [FAssets system settings](/fassets/operational-parameters).

FAssets demo dApp

The [FAssets demo dApp](https://fassets-demo-dapp.vercel.app/) showcases the FAssets system using the [Flare wagmi periphery package](https://www.npmjs.com/package/@flarenetwork/flare-wagmi-periphery-package). This app is a Next.js reference implementation for settings, minting, tags, transfer, and redeem functionality.

The source code is available in the [fassets-demo-dapp](https://github.com/flare-foundation/fassets-demo-dapp) repository.
